Re: select/3 for lists?

From: Joachim Schimpf <j.schimpf_at_icparc.ic.ac.uk>
Date: Mon 27 Jan 2003 05:34:24 PM GMT
Message-ID: <3E356DA0.27D16F98@icparc.ic.ac.uk>
Ulrich Scholz wrote:
> 
> I'm looking for a library function to get the n-th element of a list.
>

The reason this is not in the standard lists-library
is to discourage people from using it :-)
My point is: if you want to access elements based on
their position, you should not use lists at all.
Almost any other data structure (array, hash table,
trees...) is better for this purpose.

Having said that, the (public domain) library lib(listut)
contains predicates nth0/3,4 and nth1/3,4.


-- 
 Joachim Schimpf              /             phone: +44 20 7594 8187
 IC-Parc                     /            mailto:J.Schimpf@ic.ac.uk
 Imperial College London    /    http://www.icparc.ic.ac.uk/eclipse
Received on Mon Jan 27 17:35:14 2003

This archive was generated by hypermail 2.1.8 : Wed 16 Nov 2005 06:07:21 PM GMT GMT