Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon.

Pages: 1-

cadr etc ...

Name: Anonymous 2007-12-07 10:02

would it be possible to have a function somthing like
(indexof i l), where i is the index and l is the list and instead of it returning the index it return the car position of it?

for example, (indexof 2 l) would evaluate to (cadr l)

Name: Anonymous 2007-12-07 10:12

Yes

Name: Anonymous 2007-12-07 10:30

>>1
car position

What the fuck learn to proper Lisp names.

Name: Anonymous 2007-12-07 10:48

>>1
I don't think CADR does what you want, unless you're just looking to rewrite NTH.

(defmacro consn (n list)
  `(,(read-from-string
      (concatenate 'string
           "ca"
           (make-string n :initial-element #\d)
           "r"))
     ,list))

Name: Anonymous 2009-03-06 7:27


The GoF book The   Structure and Interpretation   of computer programs   3 structure and   overdo something so   much They were   going to end   the first chapter   with duck typing.

Don't change these.
Name: Email:
Entire Thread Thread List