Earlier I said:
> I can't believe I'm proposing another change to curly-infix, that's been put
> in stone for ages. But after fiddling with curly-infix, I have a new idea
> for handling one and two parameters (3+ parameters are unchanged).
...
> We might make "normal" use of curly-infix more consistent if we interpreted:
> * Two-parameter {X Y} maps to (X Y).
> * One-parameter {X} maps to X - note that there is NO list.
The more I look at this, the more I like it.
It turns out this has other benefits too. It means that if someone uses
neoteric-expressions but uses e{FIRST SECOND}, they're the same as e(FIRST
SECOND) which is almost certainly what was intended, e.g.:
f{- x} maps to (f (- x)). You can do that already with f(- x), but I can
easily imagine someone using curly braces accidentally instead.
In short, this change along with the zero-length changes I recommended earlier
would mean that neoteric-expressions with short parameter lists would do what
users probably expect:
* f{} maps to (f)
* f{a} maps to (f a)
* f{a b} maps to (f (a b))
and that might eliminate a lot of bugs.
Examples:
* {-{a} / -{b}} maps to (/ (- a) (- b))
* f{- a} maps to (f (- a))
* {{+ a} * {- b}} maps to (* (+ a) (- b))
And again, it means that {SYMBOL} is a perfectly good - and less clunky -
escape mechanism for the special sweet-expression symbols. So you could use
{!}(5) at the beginning of the line if you insist on using "!" as the name for
the factorial.
I think of "nfx ..." as a mechanism for handling precedence, to arbitrate
between different symbols. But on short lists, it makes no sense to
arbitrate.. better to have a fixed meaning built into the reader, if they make
sense (and I think these do).
I would call these "short" curly-infix lists. Here's some new text, just
before "Other infix lists..." in the [Solutions] text on curly-infix:
"An {} maps to (), {e} maps to e, and {e f} maps to (e f)."
--- 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