Perfect. That's exactly what I was looking for. Any idea where "{}" type
array construction is mentioned in the documentation? That's a hard thing
to search for.
On Friday, May 30, 2014 10:45:42 AM UTC-6, John Myles White wrote:
>
> There's two things going on here:
>
> (1) Julia's arrays are homogeneously typed, so that Python's list is
> effectively always like Julia's Array{Any}, which is created using {}, not
> [].
>
> (2) Julia currently assumes you want to flatten arrays, which is something
> a lot of people dislike and might change. That's being done by vcat IIRC.
>
> -- John
>
> On May 30, 2014, at 9:39 AM, Dustin Lee <[email protected] <javascript:>>
> wrote:
>
> > In python if I create a list like:
> > [[1,2,3], 2, [1,2]] or [[true]]
> >
> > They retain their structure. In Julia all the nesting vanishes.
> >
> > E.g. they become (essentially): [1,2,3,2,1,2] and [true]
> >
> > Two questions:
> > - what is this process of "auto-de-nesting" called? (I'm assuming there
> is a word for this)
> > - What would be the idiomatic way of creating the nested lists as above
> so they retrain their structure?
> >
> > Thanks,
> >
> > dustin
>
>