--- In claireprogramminglanguage@yahoogroups.com, ycaseau
<no_reply@y...> wrote:
> --- In claireprogramminglanguage@yahoogroups.com, "paidi_creed"
> <paidi_creed@y...> wrote:
> > Not quite as brief as the other ones but they do the job.
> >
> > Another question, is it possible to get a list representation of
> the
> > range of a table. I tried to cast the table to a list but got a
> > segmentation fault.
> >
>
> Hi,
>
> a couple of things:
>
> (1) getting a seg fault is a bug. If you can isolate your code
> please report it as a bug (clairebugs@y...) (unless you wrote a
> program and compiled it with safety 5 without runing it under the
> interpreter first :-) )
>
> (2) using table is fine, but have you considered using arrays ?
>
> (3) there is no easy code for converting a table into a list,
> especially because a table encapsulate various methods for storing a
> set of value, from a h-table to an array. You may look at the source
> code and start from the graph attribute of the table. If all you
> need is the set of values contained in the table (set of y for which
> there exists an x such that R[x] = y), you should be able to write
> this code yourself.
>
> Cheers,
>
> -- Yves
Thanks for the advice Yves. I don't think an array would do the job
here, I'm using the table as a dictionary. Would it be better to use
an array and a hash function instead
Thanks,
Paidi