j
: Next unread message k
: Previous unread message j a
: Jump to all threads
j l
: Jump to MailingList overview
I need to make a word that can define another word. What I have tried is take the definition of the ':' and ';' words and do something like this:
: createWord
" MyWord" header 1 , ] ." hello from MyWord!" ( lit ) h# b7db9018 , reveal ( lit ) h# b7db9950 execute
;
This doesn't work either:
: createWord
: MyWord ." hello from MyWord!" ;
;
Anyone know how to define a word from within another word?
I need to make a word that can define another word.
You're probably better off using a string and doing an "eval" of it.
E.g.:
: createword " : myword stuff ;" eval ;
On 5/25/10 10:02 PM, Programmingkid wrote:
I need to make a word that can define another word. What I have tried is take the definition of the ':' and ';' words and do something like this:
Read up about CREATE and DOES> in your favorite forth book, i.e. the ANS Forth standard.
Stefan