[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: eval-when-compile help?
From: |
Stefan Monnier |
Subject: |
Re: eval-when-compile help? |
Date: |
Tue, 05 Oct 2021 15:53:06 -0400 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) |
>> BTW, maybe a better option is to use a macro like:
>> (defmacro if-when-compile (test then else)
>> (if (eval test t) then else))
>> and then do
>> (if-when-compile (version< emacs-version "28")
>> (progn
>> (require 'eieio)
>> (defclass xref-location () ()
>> :documentation
>> "(Obsolete) location represents a position in a file or
>> buffer.")))
>
> That gives me
>
> Wrong number of arguments: (3 . 3), 2
;-)
> What would I put in the 'else' branch anyway?
I was thinking of a generic `if-when-compile` which wouldn't be specific
to this use (and `when-when-compile` sounds just odd ;-).
Stefan