home .. forth .. nosc mail list archive ..

[ColorForth] Newbie questions


I'm a newbie myself, so this might not be entirely accurate, but here's what
I've figured out:

colorForth has two word lists: 'macro' and 'forth'.  Words in the macro list
are treated like IMMEDIATE words in ANS Forth: they are executed in a
definition rather than being compiled.  Most of the macros compile machine-code
instructions.

Within a definition, the macro list is searched first, and the word is executed
if found.   Otherwise, the forth list is searched, and a call to the word is
compiled.

Outside of a definition, the macro list is not searched: the interpreter only
searches the forth list and executes the word if found.  This is why common
words like 'drop' and 'swap' don't work when entered as commands--they are only
defined as macros.

What I did was add my own definitions:

forth
: drop drop ;
: swap swap ;
\ etc.

-- Kris


--- Leslie Snively <les@xxxxxxxxxxxxxx> wrote:
> 	I've found a PC on which colorForth boots and runs - somewhat as 
> expected.  However, there are parts don't seem to work, and I'm not sure 
> if that's due to the hardware I'm running it on, or if I'm not 
> understanding some aspects of using colorForth.  Following is a 
> description of what's happening, and any guidance or suggestions would 
> be appreciated.  Thanks, in advance.
> 	The editor and keyboard all behave as described in the Users 
> Guide.  Some words execute as expected such as 'save' and 'dump'.  
> However, many of the words that appear as though they have been loaded 
> don't seem to function.  For example, after entering numbers on the 
> stack, using 'drop' or 'swap', and most stack operators, appear to have 
> no effect; executing the word causes the word to be followed by a '?' 
> suggesting that the word is not recognized.
> 	As I currently understand color.com, block 18 causes certain other 
> blocks containing macros and word definitions to be loaded.  And, I 
> assumed that block 18 was loaded as part of the boot process.  However, 
> that doesn't appear to be happening.  I tried manually loading blocks 
> such as 24 that contain many of the useful macros and word definitions.  
> The ones in the loaded blocks still didn't seem to be available, 
> resulting in the '?' after their invocation, suggesting, strongly, that 
> I'm not understanding some of the basics.
> 	I also tried adding my own words to one of the unused blocks.  
> However, it didn't result in something that worked either, again acting 
> as though it didn't recognize the new word I created.
> 	Finally, showing my ignorance even more blatantly, what's the 
> difference between a 'macro' and an ordinary word definition?  Why is it 
> that some apparently integral words are redefined as macros?  What are 
> the advantages or requirements for doing this?
> 	My apologies to the list for probably missing something that is 
> obvious to everyone else.  However, I'd like to join the growing ranks 
> of colorForthers rather than just being a wannabe, and I seem to be 
> having trouble getting there on my own.
> 
> Leslie Snively


__________________________________________________
Do You Yahoo!?
Make international calls for as low as $.04/minute with Yahoo! Messenger
http://phonecard.yahoo.com/
------------------------

To Unsubscribe from this list, send mail to Mdaemon@xxxxxxxxxxxxxxxxxx with:
unsubscribe ColorForth
as the first and only line within the message body
Problems   -   List-Admin@xxxxxxxxxxxxxxxxxx
Main ColorForth site   -   http://www.colorforth.com