[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Short function definition syntax; thoughts on Lua
- From: steve donovan <steve.j.donovan@...>
- Date: Fri, 4 Dec 2009 12:07:33 +0200
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.
> I have always been of the opinion that to save typing a few more
> characters is not a priority in language design. A good editor goes a
> long way.
Oh sure, any half-decent editor can expand an abbreviation, it's not
about typeability, but readability. For instance, people use 'map'
functions not really because they can't be bothered to type for-loops,
but they want to concisely and clearly express what they are doing.
It's not about APL-style compression.
There is the statement that 'newbies will find it confusing'. Well,
any newbie was doing mathematical calculations will quickly get that
to plot a function one just passes something like '|x| x*(x-1)'. In
fact, I wager that a person from a procedural background would choke
over the long form, because of the prejudice that _functions are
statements_.
steve d.