[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: omit parenthesis for functions of zero arguments /customcontrol structures
- From: Julien Hamaide <julien.hamaide@...>
- Date: Wed, 01 Mar 2006 00:32:34 +0100
I'm not sure it's a good idea. I frequently return function as variable.
For a game, I've implemented a state chart keeping state as a function
If a function without parameter is automatically call without (), I
can't do something like this
if( must_change_state )
function my_state( ) ... end
Olivier Delannoy a écrit :
It's easyer to type () than rembering names are function call one
month or even a week later.
On 2/28/06, Bret Victor <firstname.lastname@example.org> wrote:
Lisa Parratt writes:
I mention this in part because in Perl
Why does everyone always suggest features from that aborted
abomination of a language, rather than ones from SPARK, Z, or other
languages with a bit of class and back bone?
Well, the feature in question (syntactically sugary closures) is in Smalltalk
and (therefore) Ruby, both of which have class. (Or, at least, classes.)
I imagine Perl adopted it from there.
I'm personally a fan of any syntax that makes abstraction easier to type.
Lua: function () return foo + bar end
Smalltalk: [ foo + bar ]