Position of lists within lists
From: Padu (padu_at_merlotti.com)
Date: 06/17/04
- Next message: Kaz Kylheku: "Re: [OT][Long][You All Know Everything Dept] Recommendations for Stat book?"
- Previous message: André Thieme: "Re: Lisp vs. Java vs. C++ speed comparison time?"
- Next in thread: André Thieme: "Re: Position of lists within lists"
- Reply: André Thieme: "Re: Position of lists within lists"
- Reply: André Thieme: "Re: Position of lists within lists"
- Reply: Kenny Tilton: "Re: Position of lists within lists"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Wed, 16 Jun 2004 19:16:00 -0700
One more basic question.
If I have a given list (setq x '(a b c)) and I want to find the index of
element 'b in that list, I know that position works well
(position 'b x) => 1
now, imagine that my list is composed of tuples:
(setq x '((1 0) (1 1) (1 2) (2 0) (2 1) (2 2)))
and I want to find what is the position of element (1 2)
I would use pos again,
(position '(1 2) x) => NIL
but it returns nil... am I using the wrong function or there's simply no way
to do it using a single function (and therefore I'll have to create a small
function for that)?
Thanks
Padu
- Next message: Kaz Kylheku: "Re: [OT][Long][You All Know Everything Dept] Recommendations for Stat book?"
- Previous message: André Thieme: "Re: Lisp vs. Java vs. C++ speed comparison time?"
- Next in thread: André Thieme: "Re: Position of lists within lists"
- Reply: André Thieme: "Re: Position of lists within lists"
- Reply: André Thieme: "Re: Position of lists within lists"
- Reply: Kenny Tilton: "Re: Position of lists within lists"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]