[plt-scheme] overriding insert in text%

From: Ethan Aubin (ethan.aubin at pobox.com)
Date: Thu Oct 23 18:05:03 EDT 2003

Hi, I'm trying to make a subclass of text%, but am running into
problems overriding the insert method(s). There are 8 variants of the
insert method w/ different signatures mentioned in the documentation
and I'd like to override more than one.

I could define insert with an opt-lambda and then look at the type of
arguments to call specialized helper functions. This isn't too hard
(there's enough information in the arguments of the particular methods
I want to overload to disambiguate which method is intended), but it
feels odd to me (I'd have to write a custom dispatch for every
function w/ adhoc polymorphism which I overload). Has anyone come up
w/ a nice solution to situation, or is there an idiomatic way to do
this I haven't figured out? Thanks, -- ethan.aubin at pobox.com

Posted on the users mailing list.