Hacker News new | ask | show | jobs
by ilyash 1297 days ago
OOP implementation in Next Generation Shell was inspired by CLOS but it's way simpler.

Defining a type: type MyType.

At any point one can declare method: F myMethod(..., mt:MyType, ...) some_code()

Anything defined by F is automatically a multimethod. When invoked, all methods in the multimethod are searched bottom up. The first one where the call arguments match the parameters (by type, with inheritance) is invoked.

That's roughly it.