GNU bug report logs -
#27016
possible bug in `defsetf'
Previous Next
Reported by: Rafael D Sorkin <rsorkin <at> perimeterinstitute.ca>
Date: Mon, 22 May 2017 06:40:01 UTC
Severity: minor
Tags: fixed, patch
Found in versions 24.4, 25.2
Fixed in version 26.1
Done: npostavs <at> users.sourceforge.net
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
Stefan Monnier <monnier <at> IRO.UMontreal.CA> writes:
> Looks about right.
Except that it isn't. While compiling map.el, I get
../../emacs-master/lisp/emacs-lisp/map.el:292:1:Error: Symbol’s function definition is void: internal-make-closure
I can fix this with
@@ -146,7 +146,7 @@ (defmacro gv-define-expander (name handler)
HANDLER is a function which takes an argument DO followed by the same
arguments as NAME. DO is a function as defined in `gv-get'."
(declare (indent 1) (debug (sexp form)))
- `(function-put ',name 'gv-expander ,handler))
+ `(function-put ',name 'gv-expander (eval-when-compile ,handler)))
But that doesn't look like the right thing.
> I know it's not how it's done everywhere now, but I like to put the
> byte-defop-compiler-1 next to the handler function.
Makes sense.
>> +(defun byte-compile-function-put (form)
>> + (pcase form
>> + (`(,_ (,(or 'quote 'function) ,(and fun (guard (symbolp fun))))
>> + ',prop ,(or `#',value (and value (guard (functionp value)))))
>
> The value doesn't have to be `functionp` (it is in the case of
> gv-expander, but it depends on the property).
Right. I got a bit turned around with the quoting levels. And given
the error above, I'm still not sure I have it worked out correctly.
>> + (let ((fplist (assq fun byte-compile-plist-environment)))
>> + (if fplist
>> + (setcdr fplist (plist-put (cdr fplist) prop value))
>> + (push (cons fun (list prop value))
>> + byte-compile-plist-environment)))))
>
> I'd just unconditionally use `push`:
>
> (push (cons fun `(,prop ,value . ,fplist))
> byte-compile-plist-environment)))))
Yeah, that is simpler.
This bug report was last modified 7 years and 290 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.