gf dispatch on prototype #1371

Open
opened 2025-10-07 00:58:48 +00:00 by fare · 1 comment
fare commented 2025-10-07 00:58:48 +00:00 (Migrated from github.com)

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.

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 commented 2025-10-07 00:59:27 +00:00 (Migrated from github.com)

@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.

@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.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
mighty-gerbils/gerbil#1371
No description provided.