I\'m mucking about with Julia and can\'t seem to get multidimensional array comprehensions to work. I\'m using a nightly build of 0.20-pre for OSX; this could conceivably be
I kind of like the answer @fawr gave for the efficiency of the datatypes while retaining mutability, but this quickly gets you what you asked for (working off of Shawn's answer):
hcat(1:5,6:10)
hcat({i for i=1:5},falses(5))
The cell-array comprehension in the second part forces the datatype to be Any instead of IntXX
This also works:
hcat(1:5,{i for i in falses(5)})
I haven't found another way to explicitly convert an array to type Any besides the comprehension.