On Wed, 21 May 2008, Arne Vajh?j wrote:
Tom Anderson wrote:
On Tue, 20 May 2008, Arne Vajh?j wrote:
Tom Anderson wrote:
The combination of default parameters and keyword arguments is a
simple, clean and convenient way of managing complicated argument
lists. Examples from python - subprocess.Popen:
PS: It would of course have to be something else than = to not break
existing code that passes a boolean expression.
Arne, please don't tell me you're confusing = and ==!
I am babbling nonsense. == would be a boolean expression. = is an
assignment. It is of course the assignment that is a problem.
int i = 0;
m(i = 2);
is legal Java and if m was declared as m(int i) the above syntax would
require one to memorize the (future) JLS to know what the code does.
Balls. I'd forgotten that assignments were expressions in java. IMHO,
they shouldn't be!
You're right, it would have to be : or something. It could even just be
a space, actually, but that would look weird. Colons:
input = new CsvReader(myfile, dialect: "excel", skipinitialspace: true) ;
Spaces:
input = new CsvReader(myfile, dialect "excel", skipinitialspace true) ;
I think I would suggest := if they ever decided to implement that.