[Top][All Lists]

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

Re: [Chicken-users] Peculiar TinyCLOS specialization bit

From: Chris Double
Subject: Re: [Chicken-users] Peculiar TinyCLOS specialization bit
Date: Fri, 31 Dec 2004 13:18:43 +1300

> Above basically means that I have to either specialize a method twice,
> once for object and once for #f or not specialize it at all (top) and
> check the passed value in my method. Right?

You really do have two methods though. The alternative would be to have
to check (ie. typecheck) inside the body to see if the passed argument
is #f and act accordingly. With method specialisation you let the
dispatch do that for you.

In Dylan it is possible to do 'type unions' which allow you to combine
types to do what you want though. So they have a 'false-or' type that
accepted instances of the object or #f. You could probably write the
appropriate meta-machinery to do this in tiny-clos if it's not already

  Chris Double

reply via email to

[Prev in Thread] Current Thread [Next in Thread]