Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Another opposite extreme is an OOP language which has no methods. And instead each "method" is really just a data variable which is a closure, making it behave nearly identically to a real method. You could avoid needing these "methods" defined for every instance by simulating inheritance using lexical scoping from a parent class.

Although you would need to provide dynamic scope or pass the first argument as self for it to truly behave like a normal method.

The simplicity of this model is appealing to me but I do not know if any existing languages use it?



Consider applying for YC's Fall 2026 batch! Applications are open till July 27.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: