Re: `position' in rep...?



Am 29.05.2011 16:03, schrieb Jeremy Hankins:
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.
You would need it for every GtkComboBox in SawfishConfig, to set the initial value, to what the user previously selected (or to what the default value is).

Chris


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]