3 ms·
Closure is more fundamental though. Add a structure (define an ADT) to a closure and you will have an object. The classic example is a closure with message-pas
by lngnmn 9y ago
Closure is more fundamental though. Add a structure (define an ADT) to a closure and you will have an object.
The classic example is a closure with message-passing, which was the original concept in Smalltalk.
- lngnmn 9y agoWell, it seems that having a structure is the most fundamental principle. While in reality structures formed and maintained according to the laws of physics, in CS we have to explicitly define the rules, which is what Abstract Data Types (which define Interfaces) are. Protocols and Interfaces are mere generalizations of ADTs. There are, however, at least some "laws of the universe" in CS. These are Interrupts (the only way to do I/O right), specialized Syscalls, etc. One should respect them.