Why is this a "malformed expression"?

Yeah, this part is not surprising to me; I mentioned it just as a warning for people here who might want to try it out in their existing sessions (and end up with a messed up REPL).

Perhaps avoiding first and using a different example would make things clearer:

julia> foo((t, )), b = 3, 5
ERROR: syntax: malformed expression
Stacktrace:
 [1] top-level scope
   @ REPL[1]:1

julia> foo((t, )) = 3
foo (generic function with 1 method)

julia> foo(t), b = 3, 5
(3, 5)

This is sort of what I was getting at as the main issue in the post, I just didn’t word it clearly enough. Specifically, it seems like it should be ok, since foo(t), b = 3, 5 works, but foo((t, )), b = 3, 5, which should be the same thing but with a tuple-destructuring argument, leads to a malformed expression error.

1 Like