[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Gcl-devel] methods
From: |
Raymond Toy |
Subject: |
Re: [Gcl-devel] methods |
Date: |
Fri, 17 Jan 2014 09:51:51 -0800 |
User-agent: |
Gnus/5.101 (Gnus v5.10.10) XEmacs/21.5-b34 (darwin) |
>>>>> "Leo" == Leo Butler <address@hidden> writes:
Leo> Hi, I don't understand the following behaviour.
>> (defstruct w (a))
Leo> W
>> (defmethod print-object ((w w) s) (format s "#s(w :a ~a) ;; w
>> struct" (w-a w)))
Leo> #<Standard-Method PRINT-OBJECT (W T) 74054530>
>> #s(w a 1)
Leo> #S(W A 1)
>> (print-object * t)
Leo> #s(w :a 1) ;; w struct
Leo> NIL
Leo> My expectation is that the last 2 outputs should be the
Leo> same. Why aren't they? Note that
Perhaps gcl's defstruct doesn't support print-object? I know cmucl
had this problem long ago. The most portable way is to specify a
:print-function. I guess as a bonus, this allows you to print an
abbreviated form if the current print depth is too deep. I don't
think you get with :print-object.
Ray