[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Fixing numerous `message' bugs..

From: Dave Goel
Subject: Re: Fixing numerous `message' bugs..
Date: Mon, 10 Dec 2007 17:44:44 -0500
User-agent: Gnus/5.110006 (No Gnus v0.6) Emacs/21.4 (gnu/linux)

> (message "%s" (or x ""))
> will work instead of the proposed (message t x) 

(a) This looks like a neat "trick", but is confusing code.  Code
should be readable and as manifest as possible, and not rely on such
"hidden" tricks.  On the obfuscation scale, this is far worse than
something as innocuous as (or foo (error bar)), and note that some
authors even oppose that..

(b) This code also relies on an undocumented feature of `message' - that
"" as the first argument makes it behave almost the same as if the
argument were nil.

(c) Also note that (message "") is not exactly the same as (message
nil), because they return different values.  

> and considering that it rarely occurs (I think I should have got
> most cases),

Most, but not all.  

> I don't think it is really worth the trouble.

Hm, but where is the trouble?  This is a backward-compatible change.
After all, it doesn't change a thing for those that are well-versed in
the proper use of `message' and always remember to use the first
argument as a format string.

I, for one, still think instinctively think of (message) and (error)
as if they called their strings literally.  It is obvious that many
others do too.  Perhaps, (message t ..) would slowly become a habit
for such authors looking for literal strings, just as (format nil .. )
is a habit for common-lispers...  

In fact, I would prefer such a functionality for `error' as well..

reply via email to

[Prev in Thread] Current Thread [Next in Thread]