On Thu, Mar 01, 2001 at 03:07:04PM +0100, Martin Atzmueller wrote:
> William Harold Newman wrote:
> > On Fri, Feb 23, 2001 at 01:35:26AM +0100, Martin Atzmueller wrote:
> > > I've ported some of the latest patches from cmucl-18c
> > > to SBCL.
> > [etc.]
> > I merged the patches in 0.6.11.5, I tweaked them a little in 0.6.11.6,
> > and I plan to check in a few more tweaks in 0.6.11.7 once I finish
> > running some tests.
By the way, I discovered and fixed another bug in your patches when
working on 0.6.11.7: the patched GENERATE-BYTE-CODE-FOR-SET could
generate an extra DUP. A test case for this is in the new
Hopefully I'm done messing with those patches now.
> > I had two questions:
> > * Why did you escape the CHAR-NAME in OUTPUT-CHARACTER? I'm having
> > trouble thinking of a situation where it would help. (I left this
> > change as it is for now.)
> Well, this was the code as in CMU CL. Since we want readable output of
> the old code fails on #\^\\ (sb-impl::*char-name-list* defined in
> Before the patch SBCL's output was #\^\ but I think it should be #\^\\.
> The patch does just that.
> Test case:
> (let ((*print-escape* t)) (write #\^\\))
OK, I see, that makes sense. I hadn't realized that the #\^ form was
the system's preferred way to output unprintable characters. I'm
surprised that there seems to be no way to output such characters as
their numerical codes. (I wonder how Common Lisps that support Unicode
deal with glyphs which aren't supported on the current display.)
I find output like that to be pretty hard to read, even in simple
cases like #\^A, and moreso in cases like #\^^ and #\^\\. I'm sort of
tempted to change it to #\Ctrl-A, #\Ctrl-^, #\Ctrl-\\, etc. (Still
accept the #\^A form on input, just add the new #\Ctrl-FOO names and
use them as the default on output.)
> > * Why do you prefer (MAKE-HASH-TABLE :TEST #'FOO) instead of
> > (MAKE-HASH-TABLE :TEST 'FOO)? I don't see any advantage of the
> > first form, and I think the second form has the small advantage
> > that things will continue to work if EQUALP or EQL or whatever
> > is recompiled. (I removed this change for now.)
> Yes, this is not really that important.
> Hmm, I think I did this because I saw it in the CMU CL sources,
> and for stylistic reasons. I just prefer to use functions as function
> designators, but symbols are valid as well, of course.
> It has no clear advantage, if the compiler will use the function anyway,
> I guess, but why should one recompile EQL or EQUALP ...
> (ok, maybe for the fun of hacking :)
For things which are really being passed as functions (i.e. to be
executed) I also prefer the #' form. But MAKE-HASH-TABLE is basically
using its :TEST argument to dispatch on, i.e. ECASE, not FUNCALL,
comparing the argument for equality with various constants. And I
prefer to avoid tests of function equality because function values
change when they're redefined, even when the new definition is the
same as the old. It's true that we don't usually redefine EQUAL, but
hey, I did say it was a *small* advantage.
William Harold Newman <william.newman@...>
PGP key fingerprint 85 CE 1C BA 79 8D 51 8C B9 25 FB EE E0 C3 E5 7C