On Saturday 29 November 2008 19:09:30 Glenn Tarcea wrote:
> This was really neat. In the spirit of trying things out, here is a
> slightly different way I came up with.
I welcome these excursions!
> The nice thing about the above is that you don't need any
> redefinitions of bi, tri, etc...
Now that's kinda neat... I hadn't thought of having '\\' and '\\\' do the
promotion to quotations for you. That's one approach, but then the semantics
of '\\' are different from '\' so it's a trade off I guess.
You could also do a 'bi:' parsing word:
10 bi: 1- 1+
> and this code works when you want to
> put more than one operation in a quote.
>
> For example:
> TUPLE: example a b ;
> C: <example> example
> 10 20 <example>
> \\ a>> 1+ $ b>> 1- $ bi
>
> versus:
> 10 20 <example>
> [ a>> 1+ ] [ b>> 1- ] bi
Interesting. A while back I think it was Joe Groff who came up with a
shorthand notation for multiple literal sequences that are back-to-back. This
reminds me of that.
With the enhanced 'bi', each input must be either a quotation or a word, so
you're "rewarded" with concision if you can get things down to a single word.
I kinda like that aspect.
> To my eyes, the $ don't stand out in the same way to help identify
> what is a part of a quote. Part of that is undoubtedly that its a
> different syntax than I used, but for me it would take some playing
> around with to see if it becomes easier to read. Maybe it's like fry?
> '[ didn't stand out at first until I got used to looking for it.
It's an interesting experiment. Get a feel for it in your own code and see how
you like it.
Ed
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Factor-talk mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/factor-talk