Why did converting && and || to `and` and `or` die?

question
proposal

#1

Relatively new to Julia, and like most people here love it. But I miss the readability of and and or. I discovered a few git issues on moving to a python-like syntax for the and and or operators (like https://github.com/JuliaLang/julia/issues/5238).

The issue comments seem numerous and more or less universally in favor of the change, with interjections in favor from people like @StefanKarpinski as recently as 2015 (two years after the issue was technically closed), so I was just wondering: why did this die? Does it still have to?


#2

The issue has been discussed ad nauseum and it was decided not to be a good idea. I don’t believe there are any plans to revisit it. Rather than rehashing the discussion, I’ll point you to https://github.com/JuliaLang/julia/pull/19788 for reference. Like anything, && and || will just take some getting used to for those coming from languages that have other ways of writing that.


#3

it was decidedly not a good idea.

@ararslan, just curious, did you mean what was written, or that it was “decided that it was not a good idea”? :slight_smile:

Cheers!


#4

There’s just not enough in favor of it aside from some very subjective judgements. Julia currently sticks to very standard operators for this functionality and there’s no really strong technical argument for changing that. Sure, some people would prefer writing and and or instead of && and ||, but then again some people feel the opposite way. We really don’t want both options in the language – that has only led to confusion and sadness in Perl and Ruby. So without a really strong reason to change this, the decision goes to the status quo.


#5

This post was flagged by the community and is temporarily hidden.


#6

Thanks @ararslan! Looks like the discussion was in that pull, not the issue, so I missed it. Not sure that, in reading it, that it’s fair to characterize the consensus as “decidedly not a good idea” – seems it was rather close – but happy to see it got a fair hearing!


#7

Yes I meant the latter, thanks.


#8

What about the option and(a, b)?
Namely it would be great to have those in both forms.


#9

No it is not a function call and must not be written like one.


#10

You’re correct.
I mixed Short Circuit operation and Logical Operation.