help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Why is result of `car' ⇒ quote ?


From: Emanuel Berg
Subject: Re: Why is result of `car' ⇒ quote ?
Date: Tue, 14 Jun 2022 12:24:15 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux)

>> Here I do not understand it quite, why do I get result of
>> `car' below, to be `quote'?
>>
>> (nth 2 (car exporters)) ; ("Block 227, Plot 20086, Kakajja
>> Zone") (car (nth 2 (car exporters))) ; quote
>
> And the answer is ...
>
> You have quoted the list twice!
>
> (setq exporters '((1 2 '("Block 227, Plot 20086, Kakajja Zone"))))
>
> (nth 2 (car exporters)) ; '("Block 227, Plot 20086, Kakajja Zone")
>
> (car (nth 2 (car exporters))) ; quote

Instead of quoting the list twice, use `list' three times

  (setq exporters (list (list 1 2 (list "Block 227, Plot 20086, Kakajja 
Zone"))))
  (nth 2 (car exporters))
  (car (nth 2 (car exporters))) ; "Block 227, Plot 20086, Kakajja Zone"

and then it works :)

-- 
underground experts united
https://dataswamp.org/~incal




reply via email to

[Prev in Thread] Current Thread [Next in Thread]