gerbil icon indicating copy to clipboard operation
gerbil copied to clipboard

gf dispatch on prototype

Open fare opened this issue 2 months ago • 1 comments

Implement generic functions that dispatch not based on the class of an object argument, but directly on the class argument—which later may generalize to dispatching on prototypes that are not themselves classes, or not used to instantiate anything.

Duncan Mak requested the feature to port code from Dylan, but it is useful in general, enables a variety of object protocols (e.g. to allocate, instantiate and initialize one or multiple objects when you have the desired class but not yet an object itself), and supports Prototype OO as we'd like to do with POM.

fare avatar Oct 07 '25 00:10 fare

@vyzo I can handle the runtime, but I don't understand where are the compile-time optimizations that I need to modify afterwards. I'll start with working on the runtime for now.

fare avatar Oct 07 '25 00:10 fare