|
|
|
|
|
by TeMPOraL
2854 days ago
|
|
> "protocol" seems to be the older name (per one of the guys that wrote Java) Quite likelym as another Guy (Steele) responsible for Java was also a big name in the Lisp world, including chairing the committee that wrote ANSI standard for Common Lisp. In the Lisp world, protocols were a known concept. In CL nomenclature, a protocol is a set of generic functions and types used by those functions. Which is kind of like a Java interfaces, except with multiple dispach based on any of the arguments instead of the typical single dispatch of Java and friends. For example from TFA, a CL protocol would be a #'draw generic function and a 'drawable and 'renderer abstract types. The particular #'draw methods could be specialized on either argument (or both), and we could also imagine another protocol consisting of (the same) renderer type and some geometry-related generic functions. Point being, protocols are both an old and very useful concept, and like usual, C++/Java-like languages only allow expressing a small subset of it. |
|
I am fascinated, though, by your claim that Lisp also used this term... before reading it I would have been 100% sure that it didn't. I just spent ten minutes trying to find documentation of this, and can't find it... but I am not a native speaker of Lisp and so don't always know where to look; can you point me at a reference? (FWIW, I know of the meta-object protocol, which afaik is a singular thing at a different level of abstraction, and I know about classes and methods and generic functions and mulmethods, which seem like what you are talking about but aren't described by protocol?)