Closed
Description
openedon Dec 27, 2018
New to Julia, so please have patience if I am missing something in this suggestion.
Since the .=
operator is used for in-place assignment, it does not currently make sense to define a function using this operator. That is to say, the statement f(x) .= 3+4x
would not have any meaning. The statement and variations such as f .= x -> 3+4x
indeed trigger strange errors.
I think it would be elegant to hijack the .=
operator when the LHS is a function definition or RHS is a lambda; my hijack proposal is to make f(x) .= 3+4x
and/or f .= x -> 3+4x
into f(x) = @. 3+4x
or something similar. This is less in-line with the behavior of .=
as an "in-place assignment" operator, and more in-line with the dot as a broadcast operator.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment