jed-users mailing list

[2006 Date Index] [2006 Thread Index] [Other years]
[Thread Prev] [Thread Next]      [Date Prev] [Date Next]

Re: list to array conversion?


G. Milde wrote:
On 12.04.06, Marko Mahnic wrote:
What i would like to do is using the where() function to test a list for a
value without the need to loop over it.
This will fail in general since you can have mixed types in a list.

Not necessarily, as there is the Any_Type[N] array available.

> A list2array function could also take an optional type argument
>
>  Array_Type = list2array([DataType_Type type], List_Type list);
>

I meant that where() would fail on a list in general. You could extract
the objects of the desired type from the list into the array,
but wouldn't that slow down the execution and unnecessarily
allocate memory?

Maybe there could be a where() version for lists:

  where([DataType_Type type,] condition)

? It would only perform a test on a certain type of elements.

If not, the proposed list2array makes sense.

Marko



--------------------------
To unsubscribe send email to <jed-users-request@xxxxxxxxxxx> with
the word "unsubscribe" in the message body.
Need help? Email <jed-users-owner@xxxxxxxxxxx>.


[2006 date index] [2006 thread index]
[Thread Prev] [Thread Next]      [Date Prev] [Date Next]