In my experience, I can think of a single time when having an array of a
specific abstract type was useful (how multiple Period arithmetic is
handled:
https://github.com/karbarcca/Dates.jl/blob/master/src/periods.jl#L88).

Almost always, I'm concentrating on making sure Arrays I work with are of a
specific, concrete type to ensure performance and memory benefits. If I
really realize a few different types might make it in an Array, I usually
just go straight to a {} (Any Array) and move on.

-Jacob


On Tue, Apr 29, 2014 at 12:01 PM, Oliver Woodford <oliver.woodf...@gmail.com
> wrote:

>
>
> On Tuesday, April 29, 2014 4:53:05 PM UTC+1, Matt Bauman wrote:
>>
>> I use cell arrays very often in Matlab, too, but I've found that I often
>> don't really need to even worry about the distinction in julia.  Square
>> brackets will constrain the types as much as possible, and if it's not
>> possible, Any[] == {}.
>>
>> Moreover, most of what I used cell arrays for in Matlab are completely
>> obviated in Julia — Cell arrays of strings (strings are first class) and
>> passing/parsing/splatting varargs (keyword arguments are wonderful and any
>> Julian collection can be splatted).
>>
>>
> Yes, I'd been thinking I would use heterogeneous arrays less in Julia, for
> the reasons you mention.
>
>
>

Reply via email to