That's true, but it's actually the other way around – the Int[] syntax came
first and then the Int[f(x) for x in xs] syntax was added to match. The
unfortunate thing about Int[] is that it's actually indexing into a type
object. It's so visually suggestive that it's easy to forget that this is
what's going on, but it's kind of a syntax pun. I would kind of like to
come up with something better. Vector{Int}(0) works but doesn't exactly
roll of the fingertips.On Fri, Jun 19, 2015 at 12:06 PM, Lyndon White <[email protected]> wrote: > > Nice thing about: Int[] is that it is visially similar to a empty Array > comprehension, > eg Int[round(Int, x) for x in xs] > > > > > On Friday, 19 June 2015 23:49:01 UTC+8, Seth wrote: >> >> >> >> I note that Int[] works in 0.3 and 0.4, but Vector{Int}() and >> Array{Int,1}() were introduced at some point in 0.4 (but this syntax >> hasn't been backported or Compat'ed for 0.3 - I have an issue open for >> that). Going forward, what's the recommended way to do this? (Am I missing >> another constructor?) >> >
