[plt-scheme] union types in Swindle?

From: Doug Orleans (dougorleans at gmail.com)
Date: Fri Jun 2 17:48:09 EDT 2006

[This is pretty much just for Eli, but I thought I'd ask in public in
case anyone else has some thoughts.]

Have you thought about union types in Swindle?  I'm finding myself
often wanting to define methods that specialize on things like
"(or <foo> (singleton #f))" or "(or <pair> <null>)" or
"(or <string> <symbol>)".  I think I could do this by making custom
generic and method metaclasses and override compute-methods and
compute-method-more-specific?, but it seems like it would be easy to
add this to "subclass?", "instance-of?", "specializer?", and
"more-specific?" (which are all plain procedures instead of generics).

--dougorleans at gmail.com


Posted on the users mailing list.