Ben Booth:
> Here's a quick example of how this could be implemented. I'm going to
call this "extended curly infix" notation:
{{{+ 1 l} {- 1 l} {* 2 l} {/ 2 l} {= 0 r}} x = 5 * 3 - 2 + 1 y =
x * 3 + 2}
So the syntax is a bit like (let ...), each operator gets associativity
and precedence values that remain in place for the extent of the code
block.
Interesting. I appreciate the outside-the-box thinking.
However, I think the curly-infix is a lot easier to work with. In particular,
when you want precedence, you can define an "nfx" in that scope, and get many
of the benefits of this alternative without the complications.
We have a toy implementation of "nfx" in the example/ directory. It might be
nice to implement a full-up nfx with easily-configurable precedence levels,
associativity, and so on. Anyone want to improve our current nfx
implementation, so that people who want precedence and associativity can
quickly get it?
--- David A. Wheeler
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Readable-discuss mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/readable-discuss