Opinions about whether this is ugly or improves clarity are besides the point really. Calling a function as f ( x )
was originally allowed in Julia syntax, but it caused a syntax ambiguity in macro calls, so it was disallowed. The ambiguity, if I recall correctly, was that we allow macros to be called either as @m a b
or as @m(a, b)
, both of which are useful in different cases. But then what does @m (a, b)
mean? Is it a call with two arguments or a call with a single tuple argument? If you disallow the whitespace between the function and its arguments in function call syntax, then this ambiguity is resolved (it has to be a macro with a single argument that is a tuple).
14 Likes