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

Re: (none)

> From: jar@VOID.AI.MIT.EDU (Jonathan Rees)
>    Date: Tue, 4 Oct 88 17:07:39 edt
>    From: jbennett@amax.npac.syr.edu (James P. Bennett)
>    In The T Manual, 4th ed., make-stype takes two arguments.  In T3.0 and 3.1,
>    it requires a third.  I've clearly missed some post-l984 development.  Can
>    someone fill me in?
>                         I think the third argument has something to do
> with making structures handle generic operations.  The source code for
> DEFINE-STRUCTURE-TYPE (in macros.t, I think) might be of some use in
> figuring out what's going on.  Or perhaps someone else on this list
> will volunteer the information.

The third argument to make-stype is a handler (this can be nil, oops, '#f, if
you don't want to specify one).  If specified, the handler is joined with the
default stype handler.  (See struct.t and macros.t).

For example:

    > (define-structure-type ship x y)
    #{Structure-type SHIP}

    > (make-ship)
    #{Structure SHIP 1}

    > (define-structure-type ship x y
         (((print self stream) (format stream "#{Ship ~a}" (object-hash self)))))
    #{Structure-type SHIP}

    > (make-ship)
    #{Ship 2}

-- Ashwin.

ARPA:    Ram-Ashwin@cs.yale.edu
UUCP:    {decvax,ucbvax,harvard,cmcl2,...}!yale!Ram-Ashwin
BITNET:  Ram@yalecs