emacs-devel
[Top][All Lists]
Advanced

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

Re: Question on pcase


From: Michael Heerdegen
Subject: Re: Question on pcase
Date: Mon, 26 Oct 2015 17:07:32 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux)

Hi Oleh,

will read the rest of your post carefully later, but

> (macroexpand '(pcase test
>                (`(,foo . ,baz)
>                 (cons baz foo))))
> ;; =>
> ;; (if (consp test)
> ;;     (let* ((x (car test))
> ;;            (x (cdr test)))
> ;;       (let ((baz x)
> ;;             (foo x))
> ;;         (cons baz foo)))
> ;;   nil)
>
> The macroexpanded code returns (2 . 2) when evaluated. This I don't
> understand.

This is due to printing again.  With the default settings,

  (compose print read)

(so to say) is not guaranteed to preserve semantics of code.

Try with
 
  (setq print-gensym t)
  (setq print-circle t)

as I had suggested in a prior post.


Regards,

Michael.




reply via email to

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