4 ms·
I tried to convince the julia authors to make a.b(c) synonymous to b(a,c) like in nim (for similar reasons as in the article). They didn't like it.
by singularity2001 1y ago
I tried to convince the julia authors to make a.b(c) synonymous to b(a,c) like in nim (for similar reasons as in the article). They didn't like it.
- queuebert 1y agoWhat were their reasons?
- pansa2 1y agoI suspect: Julia's multiple dispatch means that all arguments to a function are treated equally. The syntax `b(a, c)` makes this clear, whereas `a.b(c)` makes it look like `a` is in some way special.
- sparkie 1y agoI don't like it either, because it promotes method `b` to the global namespace. There may be many such `b` methods on different, unrelated types. I think that the latter should be prefixed with the typename or module name. a.b(c) == AType.b(a, c) (or AType::b(a, c) , C++ style)
- singularity2001 1y agoIt's the other way around: in Julia b are functions which are globally visible by default and I just suggested to optionally hide them or find them via the object a.