OT: Punctuation-starved Programming Languages
Josef Chessor
josefcub at gmail.com
Fri Jun 23 12:33:08 CDT 2006
> One could add one more level to the typical forth interpreter. Most
> Forth interpreters first check to see it the word is in the dictionary.
> If it is not there, it would see if it could be a number. If not
> that, it must be an error.
> One could add one additional level to cause a word to be placed
> on a sting stack or string buffer.
> Something like:
>
> Hello$ World$ 2 $type
>
> would replay with:
>
> Hello World
>
When I was toying with interpreted Forth (Don't ask;), I simply had
the parser take everything from the first quote till the last quote as
one memory object, and shove it on the stack as a string for the
interpreter loop. (This is how some mission-specific Forth-like
dialects do it). Is that "read-ahead"? I know it doesn't help the
lack of punctuation any.
Example:
: Hi
"Hello world" me @ swap notify
;
Obviously not a professional programmer,
Josef
--
"I laugh because I dare not cry. This is a crazy world
and the only way to enjoy it is to treat it as a joke."
-- Hilda "Sharpie" Burroughs,
"The Number of the Beast" by Robert A. Heinlein
More information about the cctech
mailing list