Stating the same reason again: it is confusing! See the discussion of Array{Array{2}}
above for specific examples. I was lucky to catch a similar issue early in my code (when I changed a .+ b
to a ./ b
) because inner arrays were 1D instead of 2D in my case and thus the resulting type became wrong.
I really do encourage you to keep working with Julia and give this concept some time to settle. I know personally, dot-broadcasting has changed how I think about programs. I know in Julia that f(x)
is going to operate directly on x
â and not its elements. Pretty much universally. And thatâs a really awesome expressive power.
technicalities
Just for what itâs worth, thereâs a technical reason why we canât completely hide this functionality behind using LinearAlgebra
: The method table for +
is global and shared across every single package/module. And we want to enable linear algebra semantics on all AbstractArray
subtypes (including Array
). So even if we âburiedâ this behavior into the LinearAlgebra
package and didnât automatically bundle it with a base install of Julia, the moment any other package wrote using LinearAlgebra
youâd get these behaviors everywhere. Thus, in this case, itâs more consistent to just have these behaviors built in to Julia from the get-go.
Ok, I get it, 2d-arrays-are-matrices-by-default wonât go anywhere Just wanted to help future new users, at least hope they will stumble on this thread before encountering problems.
Itâs here in the manual, but NB the addition is Ⲡ== \prime
not '
.
Being able to write greek letters was (for me) a big enough incentive to ditch anything limited to ASCII. For me at least, Jupyter understands \alpha + tab
etc (as long as Iâm in a code cell). But I agree itâs nice that this isnât obligatory.
Oh, really⌠Thatâs another reason not to use fancy unicode - confusion E.g. I see literally no difference between these symbols in my browser.
Sorry, I wasnât specific enough. Code cells autocomplete such sequences for me as well, but jupyter text file editor doesnât.
Yes I have yet to write something with a decorated operator for serious use, partly for confusion reasons. Some other infix operators are clear, like const \otimes = kron
.
I have never used Jupyterâs text editor. But was very pleased to find recently that my mac can easily map caps lock to the greek keyboard, which mostly removes this need.
Weâre getting pretty far afield here, but I absolutely love my custom defaultkeybindings.dict setup for extending emacs-like word navigation with the option key all throughout the OS. And then I also added sequence option-g + alpha to be greek, e.g., option-g + a is Îą, option-g + b is β, etc. Itâs great â and now that I think of it I should similarly extend it for easy super- and sub-scripts.
https://gist.github.com/mbauman/b54e9ef755caccb9bcfe34b480e627ce
If you find something that could be improved on in either the manual in general or specifically the Differences from other Languages section, making a PR would achieve this.