guile-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: anyone define port types?


From: Marko Rauhamaa
Subject: Re: anyone define port types?
Date: Wed, 30 Mar 2016 23:07:10 +0300
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux)

Jan Wedekind <address@hidden>:

> 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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]