Jan Wedekind <j...@wedesoft.de>: > GOOPS supports "open" classes and multiple-dispatch. E.g. you can extend > the "write" method to control how an object is displayed within the > Guile REPL [1]. Another interesting approach are multi-methods in > Clojure which don't even require explicit types for dispatching. > > [1] http://wedesoft.de/oop-with-goops.html
Your example demonstrates my problem with GOOPS: you are redefining (display) by penetrating the black box with (slot-ref). What would happen to your method if I changed the implementation of <a> so it no longer has the slot x, even virtually. GOOPS' has the worst possible object model: objects are seen as mere data records. The concept of a "slot" is an anathema to OOP. Think of a UNIX file. You access it through open(2), write(2), read(2), close(2) and so on. You don't know and you shouldn't care how the file contents are organized on the disk (if there is a disk!). GOOPS would like to abandon the system calls and just expose the bytes (slots) on the disk. Then, GOOPS lets you define any kind of system calls you see fit. Marko