clash with anything? julia does not have the less binding “and” and “or” keywords afaik. I would love them, too.
I think the user meaning for the ‘&&’ construct is amply clear, but julia of course complains (correctly) about an invalid assignment location. yes, special cases are ugly and confusing and should be created only very rarely.
currently I use
julia> (x==2) && ( y=2 )
but it looks a little too similar to (x==2) && (y==2) to me. I know that special cases are not particularly desirable. ‘and’ and ‘or’ would be better.
It would also be possible to make the precedence of = relative to && and || depend on whether it’s on the left or the right. We do that with some other operators and syntaxes.
what scares me about context-dependent precedence is unforeseen consequences…I am not so smart as to anticipate everything that could happen in the future.
the “and” and “or” keywords seem safe, should be painless to implement, and do pretty much for the user what they are expected to do. I doubt that they would find a better use elsewhere.
I will be happy to take anything. looking at my current project, about 1 in 10-20 of the lines in my code seem to consist of a condition deciding on an assignment, though not suitable for the trinary.