lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]

I think this is poor identifier, because default has no meaning by
itself, this is always the default of something, and hence an identifier
shall also include the default of what it is. There can be many things
with default.  So it is better naming default_something than just

This is also poor because often used as a keyword in languages, notably
C which Lua interfaces too. When using translators, this may lead to
name mangling.

I find it short to say you don't see the need. 

Do you never use this mechanism when it is present in a language (like
C++, python...) because you consider this is a poor construct, pruning
bad design? 
(I've seen interesting article claiming than default value was sign of
over specification or too much generalization, but more in API context)

and if not, do you think that the complexity involved in parser would
make you miss your code size targets?

This is also paradoxical. Because, when you don't use it, having it
present or not have no incidence on you providing that default keyword
isn't use, but else or that you don't name variables with default

-----Original Message-----
[] On Behalf Of Paul Hudson
Sent: Tuesday, September 19, 2006 5:46 PM
To: 'Lua list'
Subject: RE: Default value in function parameters?

Default is a perfectly reasonable name for a default in a language that
not reserve the word default (phew :)

I don't see the need for this syntactic sugar. The current ways of doing
seem clear enough to me.


-----Original Message-----
[] On Behalf Of Grellier,
Sent: 19 September 2006 14:57
To: Lua list
Subject: RE: Default value in function parameters?

There is also the possibility to introduce a new default keyword (gasp).

I hope that people are not used to name variables with so poor name, so
that it doesn't break many programs...