all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Stefan Monnier <monnier@IRO.UMontreal.CA>
To: Leo Liu <sdl.web@gmail.com>
Cc: 25280@debbugs.gnu.org
Subject: bug#25280: 25.1; define-inline doesn't support &rest
Date: Wed, 28 Dec 2016 22:25:40 -0500	[thread overview]
Message-ID: <jwvy3yz79lb.fsf-monnier+emacsbugs@gnu.org> (raw)
In-Reply-To: <m137h7xzo4.fsf@gmail.com> (Leo Liu's message of "Thu, 29 Dec 2016 10:00:11 +0800")

> I misunderstood no support for `,@' implied `. ,'.

No: I can turn

    (a b c . ,d)

into

    (apply #'a b c d)

but doing that for

    (a b ,@c d)

is more cumbersome.

> Good to know it is not the case.  My experiment seems to suggest that
> inline-letevals is only needed for variables that are eval'd more than
> once.

There are cases where inline-letevals can be skipped, indeed, but
"eval'd only once" is not quite sufficient: you also have to make sure
it's eval'd at least once, and that the various arguments are evaluated
in the right order and before anything else happens (to stay true to
the behavior of a function call).

> I also get compiler warning: 
>
> In rest:
> t2.el:4:38:Warning: reference to free variable ‘vector’
>
> where t2.el has the contents:
>
> ;;; -*- lexical-binding: t -*-
>
> (define-inline rest (&rest xs)
>   (inline-letevals xs (inline-quote (vector . ,xs))))

I assume this is with an Emacs build that doesn't yet have my recent
patch, right?


        Stefan





  parent reply	other threads:[~2016-12-29  3:25 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-12-27  2:42 bug#25280: 25.1; define-inline doesn't support &rest Leo Liu
2016-12-27  3:21 ` Stefan Monnier
2016-12-27  4:25   ` Leo Liu
2016-12-27 15:25     ` Stefan Monnier
2016-12-27 17:42       ` Stefan Monnier
2016-12-29  2:00         ` Leo Liu
2016-12-29  2:41           ` Leo Liu
2016-12-29  3:25           ` Stefan Monnier [this message]
2016-12-29  5:54             ` Leo Liu

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=jwvy3yz79lb.fsf-monnier+emacsbugs@gnu.org \
    --to=monnier@iro.umontreal.ca \
    --cc=25280@debbugs.gnu.org \
    --cc=sdl.web@gmail.com \
    /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.