Email list hosting service & mailing list manager

Re: Problems with field initialization: Proposal Andre van Tonder (15 Sep 2005 16:35 UTC)
Re: Problems with field initialization: Proposal Michael Sperber (15 Sep 2005 18:15 UTC)
Re: Problems with field initialization: Proposal Andre van Tonder (15 Sep 2005 20:41 UTC)
Re: Problems with field initialization: Proposal Michael Sperber (16 Sep 2005 07:11 UTC)
Re: Problems with field initialization: Proposal Andre van Tonder (16 Sep 2005 12:56 UTC)
Re: Problems with field initialization: Proposal Michael Sperber (16 Sep 2005 17:12 UTC)
Re: Problems with field initialization: Proposal Andre van Tonder (16 Sep 2005 15:23 UTC)
Re: Problems with field initialization: Proposal Michael Sperber (16 Sep 2005 17:14 UTC)

Re: Problems with field initialization: Proposal Michael Sperber 15 Sep 2005 18:14 UTC

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

>  As an example, the hash-table example could be expressed:
>
>   (define-type hash-table
>     (constructor (k) (lambda (pred hasher size)
>                        (k pred
>                           hasher
>                           (make-vector (nearest-prime size))
>                           0)))
>     (fields (pred   immutable)
>             (hasher immutable)
>             (data   mutable)
>             (count  mutable))))
>
>   (define-type eq-hash-table
>     (parent hash-table)
>     (constructor (k) (lambda (pred hasher size)
>                        (k pred
>                           hasher
>                           size
>                           0)))
>     (fields (gc-count mutable)))

Thanks for writing this up---this helps imagining what it'd look like.

I'm confused about the K argument in the EQ-HASH-TABLE example.  Does
it call the primitive constructor of the underlying record type, or
the construction procedure of the supertype?  If the former, there's
one argument missing.  (And I'd ask how I could reuse the construction
procedure of the supertype.)  If the latter, what's it's return value,
and how do I transform it into an instance of the subtype?

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