Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

"How do you xor two numbers in Julia?"

"a ⊻ b"

"... am I supposed to type (or copy paste) that symbol every time I want to xor two numbers? There must be a better way right?"

"Sorry, no."

I immediately gave up the language after this. Too bad, I really loved it and was looking forward to progress in DL stack in Julia at that time. Too math-y.



You can always just use `xor(a,b)`. Julia makes sure that there aren't any unicode operators that don't have an ascii equivalent (in Base at least). Also, most editors will allow you to type ⊻ as `\xor` and tab complete to ⊻.


So you gave up the language after someone gave you a flat out wrong answer to a single question? That's too bad.


> "... am I supposed to type (or copy paste) that symbol every time I want to xor two numbers? There must be a better way right?" > "Sorry, no."

This just false. From https://stackoverflow.com/a/60173810/2990344

help?> ⊻ "⊻" can be typed by \xor<tab>


La mayoría de humans ist gewohnt avoir mehr letters que clés de toute façon.


Julia has built in support for special characters like that by typing \charname<tab>. You have to remember the name but it's not all that hard to type.


If this is why you stopped using the language then you can't have spent more than an hour on it. \symbol<tab>




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: