[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Emacs-diffs] feature/byte-switch 44c95c5: bytecomp.el: Don't store
Re: [Emacs-diffs] feature/byte-switch 44c95c5: bytecomp.el: Don't store non-keyword symbols in jump-tables.
Sun, 5 Feb 2017 22:54:42 +0530
On Sun, Feb 5, 2017 at 8:44 PM, Stefan Monnier <address@hidden> wrote:
> I suggest you document the property that you need this to satisfy.
> E.g. something like "OBJ is a constant expression whose value can be
> compared with `eq`" or something like that. And you might like to see if
> maybe you can use macroexp-const-p in here (there are many different
> definitions of "constant", tho).
macroexp-const-p seems to be a much better alternative to this. I've replaced
byte-compile-cond-valid-obj2-p altogether with this. It seems to return non-nil
for constant expressions that would work in a jump table implementation.
At some point, I would like to extend this to forms that call functions, but
that would need additional code to make sure that the callee function doesn't
modify the value of the variable we're comparing against (is there some way
to do that already?).