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

CLOS classes are very similar to the "modern" concept of traits. It was released in 1990, same year as Haskell.

https://en.m.wikipedia.org/wiki/Common_Lisp_Object_System

> Another unusual feature is that methods do not "belong" to classes; classes do not provide a namespace for generic functions or methods. Methods are defined separately from classes, and they have no special access (e.g. "this", "self", or "protected") to class slots.

Of course, the whole idea of having methods as separate entities might sound a bit "alien" today. Still, the idea of traits as abstract contracts, with separate and potentially multiple distinct implementations, comes directly from this, IMHO.



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

Search: