>
> How can I return #undef from a function?

You will have to modify the internals of Julia so that *#undef* becomes a 
value that can be passed around. Currently it isn't, but we have a new 
concept in 0.4-dev with nullable types 
<http://docs.julialang.org/en/latest/manual/nullable-types/> that might 
suit your need.

Ivar

kl. 14:27:02 UTC+2 torsdag 9. oktober 2014 skrev David van Leeuwen følgende:
>
> Hi, 
>
> I am trying to implement type of Array where the values are indexed, i.e., 
> the value of  `a[i]` is `a.value[a.array[i]]`, with `a.value` the discrete 
> set of values and `a.array` the indices.  In the end it should look like 
> the element type of `a` is just the element type of `a.value`. 
>
> For functions like similar() I would want to be able to return values 
> #undef to `getindex(a, ...)`, e.g., by setting a.array[:] = 0 indicating 
> that the array has not been initialized yet. 
>
> How can I return #undef from a function?
>
> Cheers, 
>
> ---david
>

Reply via email to