-
-
Notifications
You must be signed in to change notification settings - Fork 5.7k
Open
Labels
compiler:loweringSyntax lowering (compiler front end, 2nd stage)Syntax lowering (compiler front end, 2nd stage)
Description
Should one-line function definitions be allowed in multiple-LHS assignment statements? Julia (1.7.1) is inconsistent on this matter as the example below shows. My own opinion is that it should not be allowed, because there are too many weird corner cases if it is allowed.
julia> f(x),g(x)=3,5;
julia> f(12) + g('a')
8
julia> f(x),g(x)=x*x,x*x*x
ERROR: UndefVarError: x not defined
Stacktrace:
[1] top-level scope
@ REPL[22]:1This issue was initially raised in discourse by Angel_Ramirez_Reyes: https://discourse.julialang.org/t/why-is-this-a-malformed-expression/86391/6
Metadata
Metadata
Assignees
Labels
compiler:loweringSyntax lowering (compiler front end, 2nd stage)Syntax lowering (compiler front end, 2nd stage)