On Monday, April 27, 2015 at 10:21:11 AM UTC-4, Kevin Squire wrote: > > Just a note, Matlab-style [a b] concatenation has been deprecated in > Julia v0.4 <https://github.com/JuliaLang/julia/pull/7998>. See the > linked issues for details. The main issue is that this functionality makes > it challenging to create arrays of arrays (or arrays of ranges), which are > less useful in Matlab, but quite useful for general programming. >
I thought the suggestion was for `a [] b`... I hadn't seen `[a b]`, it seems pretty bad to me also... I did run across `[a ; b]`, which I don't like at all either... it seems you are giving the ; special meaning only when it is between [ ]. Why does `a ; b` mean evaluate a, then b, and return b, but `[ a ; b ]` mean concatenate a and b? To be consistent, `[a ; b]` should return a one element array `[a]`. The syntax [a , b] seems to return the same thing as [a ; b], is there a difference? The [a b] syntax doesn't seem to be deprecated in v0.4, at least, it is still in the documentation for latest... > Aside: a colleague who was a pretty proficient perl programmer found it > quite confusing that "+" was used for string concatenation in Python, > because he couldn't understand how you could add two strings... > Any of the many M/Mumps, ObjectScript, Multivalue or Pick programmers would tell you, it *obviously* means take the numeric interpretation of the string(s), and add them together! They get all confused when they see + used for concatenation, instead of having a dedicated concatenation operator. Scott
