Hi Alex,

Correct me if I'm wrong, but I think what you're looking for is the
equivalent of a numpy structured array: an array where each element is a
composite data structure. Normally in Julia, you'd use an array of your
custom type to achieve this. However, the desire here is that the fields
and types of the data structure can be determined at runtime according to
the contents of a file, for example.

You might want to look at the DataFrames package, and particularly at this
issue:
https://github.com/JuliaStats/DataFrames.jl/issues/744

- Kyle

On Mon, Feb 2, 2015 at 8:15 AM, alex codoreanu <[email protected]>
wrote:

> Hi,
>
> I am trying to figure out how to erase a previous instance of a type
> definition. I am writing a function that can dynamically create a
> return_type based on the variables passed to it. For example:
>
> instance 1
> type data_return_type
>    spec_name::String
>    lambda::Vector(Float32}
>    spec::Vector(Float32}
> end
>
> instance 2
> type data_return_type
>    spec_name::String
>    lambda::Vector(Float32}
>    spec::Vector(Float32}
>    continuum::Vector(Float32}
> end
>
>
> The problem I am having is that I get the message:
>
> " Invalid redefinition of constant type data_return_type"
>
> so I would like to erase the previous instance of data_return_type or is
> there a more traditional way to create a structure?
>
>
>
> Thank you!
>

Reply via email to