>
> Just be careful that foo does not go out of scope while you use the result 
> of "typevec!" 

this basically makes typevec! unsafe right? So, it probably should be 
prefixed like this.

Am Donnerstag, 5. März 2015 10:51:36 UTC+1 schrieb Tamas Papp:
>
> If I have a composite type 
>
> type Foo 
>   a 
>   b 
>   c 
> end 
>
> I can initialize it with a vector like this: 
>
> x = Foo([1,2,3]...) 
>
> But how can I get the fields as a vector, eg [x.a,x.b,x.c] without 
> enumerating them? convert(x, Vector) does not work. 
>
> I need this to go back and forth between the type and the vector 
> representation of a set of parameters when using NLopt. 
>
> Best, 
>
> Tamas 
>

Reply via email to