all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Alex <agrambot@gmail.com>
To: Michael Heerdegen <michael_heerdegen@web.de>
Cc: 27177@debbugs.gnu.org
Subject: bug#27177: 26.0.50: Macroexpanding cl-loop and friends (make-symbol usage)
Date: Wed, 31 May 2017 18:29:41 -0600	[thread overview]
Message-ID: <87shjk7doq.fsf@gmail.com> (raw)
In-Reply-To: <87tw40y48h.fsf@drachen> (Michael Heerdegen's message of "Thu, 01 Jun 2017 01:51:42 +0200")

Michael Heerdegen <michael_heerdegen@web.de> writes:

> Also in Elisp:
>
> (eval (macroexpand '(cl-loop for x in '(1 2 3)
>                         for y in '(a b c)
>                         collect (list x y))))
> ==>
> ((1 a)
>  (2 b)
>  (3 c))

Right, sorry for not being clear. I was referring to printing the output
into a buffer and evaluating that instead of feeding it directly into
eval.

Though I was wrong that SBCL does this correctly by default (you have to
set *print-gensym* to nil).

> Note that `make-symbol' doesn't return an interned symbol - what is
> printed as "--cl-var--" above are actually different symbols.  You need
> to enable `print-gensym' to make that visible when printing the
> macroexpansion.  If you print with print-gensym bound to nil, you don't
> get a correct printed representation.

Enabling print-gensym in this case is even worse, since evaluating the
macroexpanded code yields a (void-variable #:--cl-var--) error.

> So I think there is not a bug, unless your complaint is about human
> readability or the default value of `print-gensym'.

Human readability is indeed a large part of my complaint.

Also, evaluating the macroexpanded code directly would allow for easier
debugging, since one could make small adjustments to the output to see
immediate results.






  reply	other threads:[~2017-06-01  0:29 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-31 23:23 bug#27177: 26.0.50: Macroexpanding cl-loop and friends (make-symbol usage) Alex
2017-05-31 23:51 ` Michael Heerdegen
2017-06-01  0:29   ` Alex [this message]
2017-06-01  0:52     ` npostavs
2017-06-01  1:01     ` Michael Heerdegen
2017-06-01  2:02       ` Alex
2017-06-02  3:27         ` Michael Heerdegen
2017-06-02  4:42           ` Alex
2017-06-02 23:09             ` Michael Heerdegen
2017-06-02 23:17             ` npostavs
2017-06-02 23:46               ` Alex
2017-06-03  2:33             ` Stefan Monnier
2017-06-04  0:24               ` Alex
2017-06-06  4:20                 ` Stefan Monnier
2017-06-06 20:31                   ` Alex
2020-08-24 14:53               ` Lars Ingebrigtsen
2017-06-01  0:29   ` npostavs

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87shjk7doq.fsf@gmail.com \
    --to=agrambot@gmail.com \
    --cc=27177@debbugs.gnu.org \
    --cc=michael_heerdegen@web.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.