[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Emacs-diffs] master 1b4442b: Don't expand body inside a let-binding
From: |
Mark Oteiza |
Subject: |
Re: [Emacs-diffs] master 1b4442b: Don't expand body inside a let-binding when there are no bindings |
Date: |
Thu, 16 Feb 2017 23:44:22 -0500 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/26.0.50 (gnu/linux) |
Stefan Monnier <address@hidden> writes:
>> + (if vars
>> + `(let ,(mapcar (lambda (b) (list (car b) (cdr b))) vars)
>> + ,@code)
>> + `(progn ,@code)))
>
> Just curious here:
>
> I resisted the temptation to do that when working on that code because
> I thought that it should (both in the sense that I expect the current
> code to behave that way, and in the sense that if it doesn't behave that
> way, we should fix it) make no difference to the byte-code we generate.
>
> So, I'm wondering if you've found a concrete case where it makes
> a difference, or it's just that you wanted the output to look
> more pretty.
Nope, AFAICT the bytecode remains the same.
In the past I noticed that pcase expanded things to (let nil ...), which
I think is a bit annoying wrt readability, yes; however just recently I
was poking at elint.el, which complains about such forms with
Empty varlist in let: (let nil <snip>)
so I was more inclined to change it.
Between vars possibly being expensive, and--one step beyond that--using an
uninterned symbol to ameliorate evalling vars twice incurring a cost
with dynamic binding, I suppose this change was short sighted.