Arc Forumnew | comments | leaders | submitlogin
2 points by almkglor 6070 days ago | link | parent

Ah, ok. So: how do we implement multiple dispatch when functions are attached to objects? ^^


1 point by cchooper 6069 days ago | link

I'm working on it :)

-----

1 point by almkglor 6068 days ago | link

Hmm. Any ideas yet? I can't think of any so far.

Somehow I feel that having two layers - an is-a type attached to an object, and has-a interface semantics attached to functions on an object, might work. Basically a type declares a set of has-a interfaces, and provides (using multiple dispatch) the functions used to implement the interface. So an object is-a ship and is-a missile and is-a asteroid and is-a player-ship, and each of those types has-a collideable interface, defining how different objects react to being bashed against one another.

Or not. Dunno.

-----