List of overloadable operators

269 views
Skip to first unread message

Francesco Bonazzi

unread,
Dec 14, 2013, 6:14:09 AM12/14/13
to julia...@googlegroups.com
Hi! I tried to look for a list of all overloadable operators in Julia, but I didn't find it.

Did I miss the correct webpage or isn't there any?

Isaiah Norton

unread,
Dec 14, 2013, 8:21:32 AM12/14/13
to julia...@googlegroups.com

Stefan Karpinski

unread,
Dec 14, 2013, 9:35:57 AM12/14/13
to Julia Users
Huh, it never even occurred to us to list that since almost all operators in Julia are overloadable – since they're just functions with special syntax. The only things that aren't overloadable are control flow operators like &&, || and ?: and ones that are actually just syntax for using another operator in a particular way, like += and so on.

Steven G. Johnson

unread,
Dec 16, 2013, 3:37:32 PM12/16/13
to julia...@googlegroups.com
On Saturday, December 14, 2013 9:35:57 AM UTC-5, Stefan Karpinski wrote:
Huh, it never even occurred to us to list that since almost all operators in Julia are overloadable – since they're just functions with special syntax. The only things that aren't overloadable are control flow operators like &&, || and ?: and ones that are actually just syntax for using another operator in a particular way, like += and so on.

Yes, but there are a lot of infix operators in Julia, so it's not clear at first glance what is available to refine.   This list in the parser source code is a good starting point:

https://github.com/JuliaLang/julia/blob/master/src/julia-parser.scm#L1-L19
Reply all
Reply to author
Forward
0 new messages