[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Lightweight syntax: a dissident view
- From: Mark Hamburg <mark@...>
- Date: Sat, 27 Nov 2010 12:07:33 -0800
On Nov 27, 2010, at 10:42 AM, Axel Kittenberger wrote:
>> Or to put a more focused point on this discussion but stepping away from syntactic specificities: Should functions (or some functions) be as well supported syntactically as tables? What would be gained by doing so? How much clarity would be lost by doing so? Etc. (Obviously the clarity question fairly rapidly comes back to syntax.)
>
> {[( The core problem may be ASCII only has 3 types of brackets and a
> <pseudo one> - as if viewing this from a human language perspective
> wouldn't be kinda of funny already - this isn't enough)]}
Nice observation. So, perhaps what we need are pseudo-brackets.
<[ x, y => { foo = x, baz = y } ]>
Or:
<< x, y => { foo = x, baz = y } >>
This, however, gets ugly with functions as results:
<< x => << y => { foo = x, baz = y } >> >>
Even replacing the internal separator only sort of helps:
<< x | << y | { foo = x, baz = y } >> >>
This is seeming like a good test of whether a proposed syntax decays into line noise...
1. \x ( \y ( { foo = x, baz = y } ) ) -- Parentheses feel arbitrary
2. \x \y { foo = x, baz = y } -- Probably makes the ML crowd happy
3. \( x ) \( y ) { foo = x, baz = y } -- As above
4. | x | | y | { foo = x, baz = y } -- Much like 2 but more friendly to longer parameter lists
5. \[ x => \[ y => { foo = x, baz = y } ] ] -- Not as compact, but to me the rhythm seems better
This discussion, however, probably also increases pressure for a viable ternary expression or other conditional form.
Mark
- References:
- Re: Lightweight syntax: a dissident view, Philippe Lhoste
- Re: Lightweight syntax: a dissident view, Pierre-Yves Gérardy
- Re: Lightweight syntax: a dissident view, Mark Hamburg
- Re: Lightweight syntax: a dissident view, Pierre-Yves Gérardy
- Re: Lightweight syntax: a dissident view, Pierre-Yves Gérardy
- Re: Lightweight syntax: a dissident view, Axel Kittenberger
- Re: Lightweight syntax: a dissident view, steve donovan
- Re: Lightweight syntax: a dissident view, phlnc8
- Re: Lightweight syntax: a dissident view, Doug Lua
- Re: Lightweight syntax: a dissident view, Dirk Laurie
- Re: Lightweight syntax: a dissident view, Luis Carvalho
- Re: Lightweight syntax: a dissident view, Mark Hamburg
- Re: Lightweight syntax: a dissident view, Axel Kittenberger