Article View: gnu.emacs.bug
Article #98986byte-compiler
From: Jamie Zawinski
Date: Mon, 17 Dec 1990 20:24
Date: Mon, 17 Dec 1990 20:24
26 lines
1805 bytes
1805 bytes
I wish the byte-compiler gave us more control over the compilation environment. For example, if I define a defstruct-like macro, where (my-defstruct foo slot-1 slot-2) expands into something like (progn (defmacro foo-slot-1 (x) (list 'aref x 0)) (defmacro foo-slot-2 (x) (list 'aref x 1))) and, in the same file, I make use of the foo-slot-1 macro, that file cannot be byte-compiled without loading it first, because the byte- compiler does not expand top-level calls to macros (and consequently evaluate any defmacros in the expansion). Also, I have some code that can interface with a certain package if that package is around. If this is to be done, that package must be loaded at compile time (because of macros) but if the package cannot be loaded, that's ok (the interface to it just won't be used). This means I'd like to have something like (condition-case c (require 'foobar) (error nil)) evaluated at compile-time. Currently there is no way to specify that arbitrary forms should be evaluated at compile-time; defmacros and requires are special-cased when they appear at top-level. Something like Common Lisp's (eval-when (load eval compile) ... ) idiom is needed. -- Jamie
Technical Details
Message-ID:
<9012172024.AA00924@sunvalleymall>Path:
arc1-ca.pugleaf.net!gmdzi!unido!mcsun!uunet!shelby!agate!ucbvax!tut.cis.ohio-state.edu!LUCID.COM!jwzShow Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fb2f1,88f95f4b2ae81620,start X-Google-Attributes: gidfb2f1,public X-Google-ArrivalTime: 1990-12-17 12:24:41 PST Path: arc1-ca.pugleaf.net!gmdzi!unido!mcsun!uunet!shelby!agate!ucbvax!tut.cis.ohio-state.edu!LUCID.COM!jwz From: jwz@LUCID.COM (Jamie Zawinski) Newsgroups: gnu.emacs.bug Subject: byte-compiler Message-ID: <9012172024.AA00924@sunvalleymall> Date: 17 Dec 90 20:24:41 GMT Sender: daemon@tut.cis.ohio-state.edu Distribution: gnu Organization: GNUs Not Usenet Lines: 26 Approved: bug-gnu-emacs@prep.ai.mit.edu