[gambit-list] New types

david rush kumoyuki at gmail.com
Tue Feb 8 13:02:20 EST 2005


On Sat, 5 Feb 2005 05:24:37 -0600, Eduardo Cavazos
<wayo.cavazos at gmail.com> wrote:
> My simple object system builds 'objects' out of procedures with local
> state.

This is a standard approach to OOP in Scheme. Most people build one of
these at some point :)
 
> The (classic?) problem here is that my 'objects' don't look different
> from procedures. ...I need a way to have a 'new' procedure type. A 
> type of primitive item that acts just like a procedure but answers #f 
> to the 'procedure?' predicate.

A lot depends on what space/speed tradeoffs you want to make.
Redefining procedure? is an option that can work, but it will be
expensive, especially if you use many objects.

> I guess I am abusing procedures with this style of object system. 

Not at all, but you should ask yourself why you need objects at all.
Really. There is an important revelation about types that lies at the
bottom of the object/procedure duality.

david rush
-- 
DIsruptive Technology!


More information about the Gambit-list mailing list