[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Lightweight function syntax (again) Re: [ANN] Lua 5.2.0 (alpha-rc2) now available
- From: Tony Finch <dot@...>
- Date: Mon, 22 Nov 2010 16:00:34 +0000
On Mon, 22 Nov 2010, Gavin Wraith wrote:
I think this is drifting off the topic, since we have been discussing
an abbreviated lambda syntax - there's no discussion about function
> What we are seeing here are the ripples from the clash, in the early
> 1920s, between traditional mathematical notation [ f(x,y,...) ] and
> that of the new logicians, Schoenfinkel, Curry et al, [f x y ... ]
> whom the mathematical community tended to cold-shoulder till well
> after the coming of computers, Lisp, etc. I love Haskell notation,
> myself, but I can well understand that is not to the taste of others.
> It comes down to whether the application operator should be distfix or
There's also the importance of partial application and currying.
Haskell-style application syntax isn't very useful if the syntax for
defining curried functions is klunky - as is the case in Lua.
Having said that, one can argue that the difference between distfix
and invisible application operators isn't actually a difference in the
operator but in which arguments it can take on the right-hand-side.
In most languages in the Algol tradition, the right hand argument can only
be a tuple, and tuples are not first class.
Lua is a bit closer to functional syntax, since the argument can also be a
string or table literal.
Proper functional syntax also allows a number or bare variable name as the
right hand argument, and it makes tuples first class.
f.anthony.n.finch <firstname.lastname@example.org> http://dotat.at/
HUMBER THAMES DOVER WIGHT PORTLAND: NORTH BACKING WEST OR NORTHWEST, 5 TO 7,
DECREASING 4 OR 5, OCCASIONALLY 6 LATER IN HUMBER AND THAMES. MODERATE OR
ROUGH. RAIN THEN FAIR. GOOD.