Csaba Henk <[EMAIL PROTECTED]> wrote:
> I wonder if it is possible to have dynamic word resolution akin the
> "method_missing" like methods in OO languages (invoked as a fallback if
> a method is not defined).

Definitely. All production concatenative languages have such a feature
already: any word in the form "\<[0-9]+\>" is treated as a number.
Adding new types of literals is not a severe difficulty in general.

Forth behaves as follows: it first grabs a blank-delimited string,
tries to look it up in the dictionary; if defined, it executes it.
Otherwise it tries to interpret it as a number; if valid, it pushes
the value on the stack. Otherwise it errors out.

Some Forths, such as "ficl", allow you to "chain" your own token
recognisers onto that sequence, so that you can do the things you've
described.

> Csaba

-Billy

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Factor-talk mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/factor-talk

Reply via email to