Void
Void

Reputation: 3

Dotted list in lisp

I'm trying to recreate this structure with lisp (key . (list of values))

Ex: (a . (b c))

I managed to recreate the opposite ((a b) . c), but is not what i need. Is possible?

Upvotes: 0

Views: 235

Answers (1)

Barmar
Barmar

Reputation: 780984

(cons 'a (list 'b 'c))

Note that when you print this it will be printed as

(A B C)

because a cons whose cdr is a list is printed using list notation, not dotted notation.

Upvotes: 2

Related Questions