lisp - Returning an element from a list -
I am trying to learn lisp and as soon as I'm making my first step, I was stuck. How can I get the following elements: (ab (cd))
I have tried: (caar (last '(ab (cd))) )
but it returns the CD and not only c # it works even if there are spaces between C, D: (caar (last ('ab (c. D))) )
The problem I am trying to solve is that space is specified without spaces. Can it be done or a typo in exercise?
Thank you.
LE : Is it possible that this issue is due to implementation? Your code is right, is it a typo (or maybe a very bad font?) In exercise
In Lisp (Common Lisp and Scheme I have just checked, I do not know about Closer), [Approximately] The only division between symbols is spaces and brackets even if it is. If you type '(cd)
you are used as a literal syntax for conflict
, you get a symbol in a list, in a conservative chamber No two symbols.
For example,
'cd; Is a symbol '(c. D); There is two symbols in a single cell '((c) d); Two symbols, first in the nested list, edit
: Since you are using normal Lisp, here and here. To summarize, (
and )
are ending characters , while .
is not there. CLisp is performing according to general Lisp device.
Comments
Post a Comment