[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: [ANN] GSL Shell new beta release with anti-gran graphics module
- From: steve donovan <steve.j.donovan@...>
- Date: Thu, 3 Dec 2009 12:31:41 +0200
On Thu, Dec 3, 2009 at 11:50 AM, David Kastrup <dak@gnu.org> wrote:
> function(x) return x*(x-1) end
The notation really shines when you start doing functional things like currying:
> div = |x| |y| x/y
> = div(1)(10)
0.1
But the real motivation is that it makes using functions like 'map' a
little more pleasing:
squares = map(|x| x*x, values)
Also, for 'quoting' an expression so that it can be called in another context:
timer(1000,|| print 'timer finished')
Perhaps the issue here is that those two little lines are easy to get
lost in the otherwise keyword-driven syntax of Lua?
steve d.