[Coco] [Color Computer] Polymorphisim in BASIC?

Arthur Flexser flexser at fiu.edu
Wed Jul 29 14:50:37 EDT 2009


Plus, that's a situation where a self-modifying Basic program is
probably the EASIEST way to do the job using Basic.  Earlier, I
couldn't think of any situation where the desired result couldn't be
accomplished in a more straightforward way.  One could also use a
modifiable DEF FN statement, though unfortunately CoCo Basic limits
DEF FN to functions of a single variable only.

A variation on self-modifying Basic is the technique of having a Basic
program generate a second Basic program.  The only example I know of
this (though there are probably others) is PIXCMP, which I wrote with
Mikeyterm author Mike Ward and Marty Goodman, to turn PMODE images
into runnable ASCII Basic programs that displayed the images.  The
idea was to compress the images and get them into a format that could
be uploaded or downloaded, back in the days before CoCo programs that
could do binary file transfers were commonly available, so that
everything had to be in ASCII.

Art

On Wed, Jul 29, 2009 at 2:05 PM, tim lindner<tlindner at macmess.org> wrote:
> On Wed, Jul 29, 2009 at 6:48 AM, Wes<wlhaynes1248 at gmail.com> wrote:
>> In the September '86 issue of the Rainbow there is a 3D graphing program by
>> Jeff Harper which is polymorphic. The user enters a mathematical function
>> which is then parsed, tokenized, and POKE'd back into a reserved line
>> number. The program then calls this line as it draws its graph. Its
>> tokenizer only handles math functions, but it's still pretty neat.
>> Definitely worth checking out if you're interested in that sort of thing.
>>
>
> Thanks for the pointer. That is a real interesting bit of
> self-modifying BASIC code.
>
>
> --
> tim lindner
>
> --
> Coco mailing list
> Coco at maltedmedia.com
> http://five.pairlist.net/mailman/listinfo/coco
>



More information about the Coco mailing list