3 ms·
If I understand this correctly, this gives users the power to add even more features to C++. Don't get me wrong, this isn't a terrible idea in that it does hav
by armchairhacker 3y ago
If I understand this correctly, this gives users the power to add even more features to C++.
Don't get me wrong, this isn't a terrible idea in that it does have some use cases. But also, I wonder if the authors would be better off adding the MOP to a language like C which is simpler and would benefit more from having extra features.
- Jtsummers 3y agoWhat would it mean to have a MOP for a language which doesn't have objects in the OO sense? Especially C.
- wudangmonk 3y agoisn't CLOS OO based on generic functions and not objects? as far as I know Lisp doesn't have objects in the OO sense either.
- lispm 3y agoObjects are instances of classes in CLOS. Classes, Methods, Generic Functions, ... are also instances of classes. Classes support multiple inheritance. Instances have an identity, slots and a class. CLOS does not use methods attached to classes, which can be invoked by message sending or similar. Instead CLOS uses Generic Functions which consist of one or more Methods. Methods are dispatched over classes, using possibly multiple arguments. Generic Functions are themselves objects and they are defined outside of classes. When a Generic Function gets called, all the applicable Methods are combined to an Effective Method that then will be executed.
- toolslive 3y agoWell, in C you have function calls, so you can still do reification on that, turn it in to a value (ie a record that holds the parameters and the pointer of the function) and fiddle with it. Some examples: - you can send it to another machine turning it into RPC, and you can encrypt (some of) the parameters because of this - you can add save the program state before you execute it for checkpointing purposes - you can log the parameters for tracing - ...
- lelanthran 3y agoPresumably it would standardise the current way of doing OO in C while the MOap is being standardised. Just because some language does not have classes doesn't mean you cannot implement a functional substitute.