Re: `position' in rep...?
- From: Jeremy Hankins <nowan nowan org>
- To: sawfish-list gnome org
- Subject: Re: `position' in rep...?
- Date: Sun, 29 May 2011 09:03:53 -0500
Christopher Roy Bratusek <nano tuxfamily org> writes:
> just a small question, whether I'm blind, or whether rep really
> doesn't ship a function like `position'.
>
> so `nth' gives the the value of the nth element:
>
> (setq mylist '("Crux" "StyleTab" "get-S-tabbed"))
> (nth 1 mylist)
>
> => StyleTab
>
> but now for the opposite? other lisps do ship `position':
>
> (position "Crux" mylist)
>
> => 0
>
> Now it seems to me that REP does not ship a position function? Atleast
> I couldn't find one in the docs neither via `git grep'. I think that's
> essential, so I'm sure it's somewhere. Or... did John expect everyone
> to loop through lists?
I don't know of such a thing, but how often would you really need to
know the position of an element? In most cases I can think of where you
might use a position "member" would do what you need without the use of
a position.
--
Jeremy Hankins <nowan nowan org>
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]