I’ working on a code which, for the sake of clarity, has long keyword names.
A simple example is:
function foo(;ABooleanKeyword=false, AnotherLooongKeyword=2) println(ABooleanKeyword) println(AnotherLooongKeyword) end
Is there a simply way to call the
foo function with abbreviated keyword names, such as
foo(ABoo=true, Another=4) ?
There would be no ambiguity in this case…
Also, since the default value of the first keyword is a boolean, it would be nice and clear (IMHO) if I could use it as an on/off switch being on when the keyword is provided, off otherwise, i.e.
foo(ABoo) ==> ON foo() ==> OFF
In the first case there would be an ambiguity on whether
ABoo is the keyword or another symbol. However, a syntax similar to
foo(;ABoo) etc… would remove any ambiguity.
Is there a simple way to do this already implemented in Julia ?