[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: require printing causes an error
From: |
Stefan |
Subject: |
Re: require printing causes an error |
Date: |
Sun, 14 Nov 2004 00:19:04 -0500 |
User-agent: |
Gnus/5.11 (Gnus v5.11) Emacs/21.3.50 (darwin) |
> Well, the byte-compiler said as warning, but the code byte-compiled didn't
> run properly. So, I thought it was a byte-compiler problem.
Most likely it's because the warning was indeed about a real problem.
You'd have to give more precise info to get a more useful answer.
>> (defalias 'foo-A
>> (cond
>> (some-condition-A
>> (lambda () code-for-A ))
>> (t
>> (lambda () code-for-B))))
>>
>> This makes it obvious to the byte-compiler that `foo-A' will be defined.
>> Admittedly, the byte-compiler only started to recognize the above form
> a few
>> days ago.
> Good! :)
> Is this new form recognized by Emacs 20 byte-compiler?
By "recognize" I meant that it prevents the spurious warnings. As far as
the generated code goes, it's been "recognized" for as long as I can remember.
I.e. it'll work in Emacs-19 as well, but you'll get spurious warnings unless
you byte-compile with Emacs-CVS.
> The other form used in printing package is:
> (cond
> (some-condition-A
> (defun foo-A () code-for-A ))
> (some-condition-B
> (defvar var-B some-default-B)
> (defun foo-A () code-for-B)))
Oh yes, IIRC the (defvar var-B some-default-B) is just to turn off warnings
as well, in which case it should really be moved to the toplevel and turned
into
(defvar var-B) ;; Without any default value. It's only a byte-compiler hint.
-- Stefan