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

> an object is a struct with associated functions

And inheritance and polymorphism, which I don’t think you can reproduce with closures.



Inheritance and polymorphism: https://okmij.org/ftp/Scheme/oop-in-fp.txt

The link at the bottom is dead, but here's the same file at his current site: https://okmij.org/ftp/Scheme/pure-oo-system.scm

You can reproduce these with closures, though you'll need more plumbing since it's not built into the language.


> more plumbing since it's not built into the language

Well, sure - you can "reproduce" encapsulation, inheritance and polymorphism in plain-old C (heck, I've done it in Cobol), too. I'm not sure that's really the same, though.




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

Search: