[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Short function definition syntax; thoughts on Lua
- From: David Kastrup <dak@...>
- Date: Fri, 04 Dec 2009 11:49:28 +0100
steve donovan <steve.j.donovan@gmail.com> writes:
> On Fri, Dec 4, 2009 at 11:51 AM, Thomas Lauer <thomas.lauer@virgin.net> wrote:
>> If *IT* is really just a matter of taste, *IT* should probably not be
>> implemented.
>
> Well, that argument cuts in other ways. 'function fun(x) .. end' is
> just sugar for 'fun = function(x) ... end', it isn't strictly
> necessary.
But wouldn't it feel inconsistent to have a shorthand for
function(x) return x*x end
but not for
function(x) if x>0 then return 1 else return 0 end end
When you write a program and half the anonymous functions look like |x|
x*x and the other utterly differently?
Wouldn't maintaining that elegance require that you get expression
shorthands for most control structures in use for "short functions"?
--
David Kastrup
- References:
- Re: [ANN] GSL Shell new beta release with anti-gran graphics module, steve donovan
- Re: [ANN] GSL Shell new beta release with anti-gran graphics module, David Kastrup
- Re: [ANN] GSL Shell new beta release with anti-gran graphics module, Norman Ramsey
- Re: [ANN] GSL Shell new beta release with anti-gran graphics module, David Kastrup
- Re: [ANN] GSL Shell new beta release with anti-gran graphics module, Norman Ramsey
- Short function definition syntax; thoughts on Lua (was Re: [ANN] GSL Shell new beta release...), Doug Rogers
- Re: Short function definition syntax; thoughts on Lua, David Kastrup
- Re: Short function definition syntax; thoughts on Lua, Miles Bader
- Re: Short function definition syntax; thoughts on Lua, Thomas Lauer
- Re: Short function definition syntax; thoughts on Lua, steve donovan