N9I - 4/18/2010
Written on Mon, 19 Apr 2010 01:00:57 +0000 - Last updated on Mon, 19 Apr 2010 01:19:56 +0000A journal entry in the development of the N9I programming language, dated April 18, 2010.
Named parameters
A feature I'm considering is allowing parameter names to be specified in a function call. For example, for function
public void foo(int bar, string baz, Object qux) ...
an appropriate call to this function might be
foo(10, "an argument", new Object());
However, this might also be possible:
foo(baz = "an argument", qux = new Object(), bar = 10);
or for the styles to be mixed:
foo(qux = new Object(), 10, "an argument");When a parameter is named, it is "removed" from the parameter order. So the normal order of bar, baz, qux becomes simply bar, baz when quxis given as a named parameter. If baz were given as a named parameter, the order of the unnamed parameters would then be bar, qux.