GNU bug report logs -
#66136
29.1; byte-compiler reports "misplaced interactive spec" with empty fct in lexical environment
Previous Next
Full log
View this message in rfc822 format
[Message part 1 (text/plain, inline)]
22 sep. 2023 kl. 23.39 skrev Stefan Monnier <monnier <at> iro.umontreal.ca>:
> I know Mattias played with this part of the code (mostly to try and
> figure what to do about the ordering of the various possible kinds of
> declarations, which is a related yet different issue). Maybe he has
> a more informed opinion.
Can't lay much claim to that I'm afraid. In this case I'd just have macroexp-parse-body return an empty body and be done with it. Suggested patch attached.
Our triptych of meta-forms in function bodies (documentation, declare, interactive) is still not handled in a very principled or robust way. We keep parsing and re-parsing them in several places. I'm tempted to replace lambda with an intermediate form where these things are already parsed, early in the front-end (maybe even macroexpand-all).
There are all sorts of little annoyances, such as:
- if nothing comes after a (literal) doc string, the doc string also becomes the function body
- `declare` is only allowed in named definitions because it is macro-expanded very early, so we have no way of annotating lambda expressions
- not sure :documentation is handled correctly everywhere since it's a late addition
- that 'misplaced interactive spec' warning shouldn't be emitted from the Lisp optimiser at all but fully handled in the front-end like all syntax errors
[macroexp-parse-body.diff (application/octet-stream, attachment)]
This bug report was last modified 1 year and 299 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.