[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Dylan implementation question
At Tue, 05 Mar 2002 01:30:02 -0500, Steve Schafer wrote:
> Thanks to all for the hint--it makes sense now. I guess the only
> additional complication is that the presence of specializers attached
> to keyword parameters might require the use of several different
> "not-supplied" constants of different types.
That's not usually necessary. You could just use a type-union:
define method foo(bar :: <bar>,
#key baz :: type-union(<baz>, singleton($not-supplied))
= $not-supplied);
// ...
if($baz ~== $not-supplied)
// at this point the compiler knows baz must be of type <baz>
// ...
end if;
// ...
end method;
-Peter-