Slava Pestov <[EMAIL PROTECTED]> wrote: > I'm not sure what benefit there is to writing "(X,X) => (X+X)" over > "dup +" or even just "2 *".
I made a dialect of Forth use a syntax I called stack shuffle notation. Instead of "-rot", for example, my notation would say abc--cab. Doing that required hacking into the Forth's error handler -- anytime an unknown word was encountered my little shuffle parser would be called, and it would try to parse and then generate the appropriate code (or pass control back to the original error handler). I definitely prefer that ab--bb notation to classical Forthlike "dup -rot swap drop" and so on. I've seen one attempt to implement this in Factor; the implementor wrote a defining word that, given an integer 'depth', generated all words that permuted the stack to the given depth. (That's a LOT of words to define!) As impressive of a feat as that was... I hope it's possible to do something less resource-intensive :-). Does Factor have reader-macros (to use the Lisp term)? Is there some other way of getting this kind of thing done? > Slava -Billy ------------------------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now >> http://get.splunk.com/ _______________________________________________ Factor-talk mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/factor-talk
