Email list hosting service & mailing list manager

Accessor visibility Andre van Tonder (03 Jan 2006 07:33 UTC)
Re: Accessor visibility Michael Sperber (03 Jan 2006 17:04 UTC)
Re: Accessor visibility Andre van Tonder (03 Jan 2006 18:30 UTC)

Re: Accessor visibility Michael Sperber 03 Jan 2006 17:01 UTC

Andre van Tonder <xxxxxx@now.het.brown.edu> writes:

> Just a small question:  Are the accessors visible in the protocol <exp>?

Yes.  This is implied by the fact that the accessors are defined in
the environment of the DEFINE-RECORD-TYPE form.

We actually spent a fair amount of time on the wording spelling out
how the names are bound---i.e. that DEFINE-RECORD-TYPE expands into a
bunch of DEFINEs without saying that it expands into a bunch of
DEFINEs.  If you could suggest on how to improve the spec, that would
be a great help.

> Here is an example that would use this to copy a record.
>
> (define-record-type point
>
>   (protocol
>     (lambda (new)
>       (case-lambda
>         ((x y)       (new x y))                     ; Create new
>         ((old-point) (new (point-x old-point)       ; Copy existing
>                           (point-y old-point)))))
>
>   (fields (immutable x)
>           (immutable y)))

Are you actually asking if we can "do C++" with SRFI 76? :-)

--
Cheers =8-} Mike
Friede, Völkerverständigung und überhaupt blabla