[plt-scheme] Some struct requests

From: Lauri Alanko (la at iki.fi)
Date: Mon Sep 9 05:26:12 EDT 2002

Hello. There are some things that I think structures (and user-defined types
in general) could use:

Custom print handlers. Some structures could have a much more concise and
clear textual representation than #<struct:foo> or a plain dump of the fields.

Custom apply handlers. Oftentimes I have structures which have one
overwhelmingly common operation on them, and it is convenient for me to
actually spread around a function wrapper that calls that operation on the
structure rather than using the structure object itself. However, the
wrapper and the structure are still distinct objects (eq?-wise) which
sometimes forces me to maintain a separate mapping between the objects and
their wrappers. If structures _themselves_ could be called as function
objects, there would be no problem.

Do these make any sense?

Lauri Alanko
la at iki.fi

Posted on the users mailing list.