Re: [colorforth] arrays in source
- Subject: Re: [colorforth] arrays in source
- From: "Howerd Oakford" <howerd.oakford@xxxxxxxxxxxx>
- Date: Sat, 27 Dec 2003 00:22:42 -0000
Hi Mark & all,
At last I have joined the colorForth mailing list...
I like your aray idea.
I particularly like the fact that you can extend the number tokens in any
way that you like.
I presume that you are using colours 2 and 5 for this.
This will be quite simple to do when the editor has been ported to
colorForth...
Below is a more general and more complicated idea that I present for
discussion :
I have been thinking about what I call a "blue class" :
Token 1 : colour blue ( = 0x0D ), name of "class"
Token 2 : name of word to display parameter field
Token 3 : name of word to execute ( sort of "code field" ), plus a count of
the number of tokens in the parameter field in the place of the colour bits.
Token 4 ... n : parameter field.
Perhaps "class" is not a good name - it implies CREATE ... DOES> - which
this is not.
The idea is that the editor uses token 2 to display the parameter field (
could be a string ).
When the blue name is compiled it lays down a pointer to token 3.
When the blue name is executed it executes token 3 and uses the parameter
field for data.
Example :
Token 1 : [blue] myname
Token 2 : dotquote
Token 3 : [ skip over the parameter field ] ( has count in place of colour
bits )
Token 4 : [ the string to display ]
Regards
Howerd
----- Original Message -----
From: "Mark Slicker" <maslicke@xxxxxxxxxxx>
To: <ColorForth@xxxxxxxxxxxxxxxxxx>
Sent: Friday, December 26, 2003 6:16 PM
Subject: [colorforth] arrays in source
> colorForth has the concept of source code as data, prominently the magneta
> variable.
>
> In the colorForth preparsed source there is potential for whole arrays to
> be stored in source.
>
> Large numbers require 2 32-bit words.
>
> 5 bits of the first 32-bit word denotes the color of the number and the
> type of display. The second word is the actual number.
>
> To generalize this, let the remaining 27 bits of the first word denote a
> count, and let there be a corresponding number of 32-bit words which folow
> the first word.
>
> For count > 1 place the address in source on the data stack, otherwise
> place the actual number.
>
> Mark
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: colorforth-unsubscribe@xxxxxxxxxxxxxxxxxx
> For additional commands, e-mail: colorforth-help@xxxxxxxxxxxxxxxxxx
> Main web page - http://www.colorforth.com
>
---------------------------------------------------------------------
To unsubscribe, e-mail: colorforth-unsubscribe@xxxxxxxxxxxxxxxxxx
For additional commands, e-mail: colorforth-help@xxxxxxxxxxxxxxxxxx
Main web page - http://www.colorforth.com