From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Jan Wedekind Newsgroups: gmane.lisp.guile.user,gmane.lisp.guile.devel Subject: Re: anyone define port types? Date: Wed, 30 Mar 2016 20:43:57 +0100 (BST) Message-ID: References: <87y492mnjp.fsf@pobox.com> <87io046wp7.fsf@drakenvlieg.flower> <87a8lfx37i.fsf@elektro.pacujo.net> Reply-To: Jan Wedekind NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Trace: ger.gmane.org 1459367083 2035 80.91.229.3 (30 Mar 2016 19:44:43 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 30 Mar 2016 19:44:43 +0000 (UTC) Cc: Andy Wingo , "guile-user@gnu.org" , guile-devel To: Marko Rauhamaa Original-X-From: guile-user-bounces+guile-user=m.gmane.org@gnu.org Wed Mar 30 21:44:33 2016 Return-path: Envelope-to: guile-user@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1alM2a-0008H3-DD for guile-user@m.gmane.org; Wed, 30 Mar 2016 21:44:32 +0200 Original-Received: from localhost ([::1]:56497 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1alM2Z-00067f-Ik for guile-user@m.gmane.org; Wed, 30 Mar 2016 15:44:31 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:38127) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1alM2C-0005me-I8 for guile-user@gnu.org; Wed, 30 Mar 2016 15:44:09 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1alM2B-0006Ds-IR for guile-user@gnu.org; Wed, 30 Mar 2016 15:44:08 -0400 Original-Received: from basicbox4.server-home.net ([195.137.212.26]:54968) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1alM26-0006Br-Ff; Wed, 30 Mar 2016 15:44:02 -0400 Original-Received: from wedemob.default (unknown [95.150.201.149]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by basicbox4.server-home.net (Postfix) with ESMTPSA id 3BFC51530663; Wed, 30 Mar 2016 21:43:59 +0200 (CEST) X-X-Sender: jan@wedemob In-Reply-To: <87a8lfx37i.fsf@elektro.pacujo.net> User-Agent: Alpine 2.11 (DEB 23 2013-08-11) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 195.137.212.26 X-BeenThere: guile-user@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: General Guile related discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-user-bounces+guile-user=m.gmane.org@gnu.org Original-Sender: guile-user-bounces+guile-user=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.user:12530 gmane.lisp.guile.devel:18257 Archived-At: On Wed, 30 Mar 2016, Marko Rauhamaa wrote: > Panicz Maciej Godek : > >> 2016-03-30 13:18 GMT+02:00 Jan Nieuwenhuizen : >> >>> Panicz Maciej Godek writes: >>> >>>> I also used GOOPS, which I regret to this day, and so the >>>> whole framework needs a serious rewrite >>> >>> What is it that you do not like about GOOPS? >> >> Most specifically, I dislike its middle three letters. The problem >> with OOP is that it requires to know exactly what ones want -- it is >> difficult to change the design of your program after it's been written >> (and it is also difficult to come up with a good design from the >> beginning), and -- since it is based on state mutation - it makes it >> difficult to reason about your program. >> >> On the practical side, it was a bit counterintuitive that and >> were unrelated, and I think that there were some issues with >> and types. > > I like OOP, only I don't like GOOPS. Its classes and generic functions > seem so idiomatically out of place, unschemish, if you will. > > This is how OOP ought to be done: > > l#OO-Closure> > > I have created a tiny Guile module ("simpleton") that generalizes the > principle. In particular, > > * You don't need classes for OOP. You only need objects. > > * Do tie methods to objects. Don't pretend methods are external to > objects. > > * Don't expose the internal state of objects. Only interact with the > object through methods. > > > Marko 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