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

Re: Problem with <each-subclass-slot-info>



>From: "Chris Double" <doublec@xtra.co.nz>
>To: <info-dylan@ai.mit.edu>
>Subject: Re: Problem with <each-subclass-slot-info>
>Date: Fre, 22. Mär 2002 23:51 Uhr
>

> Functional Developer has <each-subclass> so you could try that. Or a
> workaround is:
>
> define class <one> (<object>)
>   each-subclass slot abcd;
> end;
>
> Is equivalent to:
>
> define class <one> (<object>)
> end;
>
> define constant $abcd = make(<table>);
>
> define method abcd(c :: <one>) => (o :: <object>)
>   $abcd[c]
   $abcd[c.object-class]
> end;
>
> define method abcd-setter(v :: <object>, c :: <one>) => (o :: <object>)
>   $abcd[c] := v
   $abcd[c.object-class] := v
> end;
>
> begin
>   let a = make(<one>);
>   a.abcd := 10;
>   format-out("%s\n", a.abcd);
> end;
>
> Untested, but you hopefully get the idea.

See my corrections above.

Bye,

    Gabor


>
> Chris.
>
>