Subject: bug#25280: closed (Re: bug#25280: 25.1; define-inline doesn't support &rest)

From: [email-masked] (GNU bug Tracking System)
Date: Thu, 29 Dec 2016 05:55:02 +0000

Your bug report

#25280: 25.1; define-inline doesn't support &rest

which was filed against the emacs package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to [email-masked].

-- 
25280: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=25280
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: Re: bug#25280: 25.1; define-inline doesn't support &rest
From: Leo Liu <[email-masked]>
To: Stefan Monnier <[email-masked]>
Cc: [email-masked]
Date: Thu, 29 Dec 2016 13:54:05 +0800
List-Id: <debbugs-submit.debbugs.gnu.org>

version: 25.2

On 2016-12-28 22:25 -0500, Stefan Monnier wrote:
>> 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.

Thanks.

>> 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).

Understood.

>> In rest:
>> t2.el:4:38:Warning: reference to free variable ‘vector’
> I assume this is with an Emacs build that doesn't yet have my recent
> patch, right?

Exactly.

Leo

Subject: 25.1; define-inline doesn't support &rest
From: Leo Liu <[email-masked]>
To: [email-masked]
Date: Tue, 27 Dec 2016 10:42:13 +0800
List-Id: <debbugs-submit.debbugs.gnu.org>

inline.el has a comment FIXME: How can this work with CL arglists? but
it is worse. it doesn't support &rest.

Try compile the following example:

  (define-inline rest (&rest xs)
    (inline-quote (apply #'vector ,xs)))
  
  (princ (rest 1 2))

In toplevel form:
test.el:7:1:Warning: ‘1’ is a malformed function

The header comment says defsubst: not as efficient. Could this be made
clearer? In what way is defsubst less efficient?

What is the outlook for defsubst or cl-defsubst? Are they on their way
out? 

Thanks,
Leo