How to do ((A.B).(C.D)) in lisp

I'm trying to figure out how to do this using cons:

((A . B) . (C . D))

where (A . B) and (C . D) are in each cons cell

I've tried doing this (cons (cons 'a 'b) (cons 'c 'd)) but it gives me this:

((A.B) C . D)

I also tried this: (cons (cons 'a 'b) (cons (cons 'c 'd) ())) but it gives me this:

((A . B) (C . D))

Any idea how to achieve this?

5
задан darkwingcode 15 December 2010 в 01:13
поделиться