From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Michael Tiedtke Newsgroups: gmane.lisp.guile.user Subject: Re: Message Passing with GOOPS Date: Fri, 26 Jun 2015 12:15:07 +0200 Message-ID: <558D262B.8020803@o2online.de> References: <558B1158.4020607@o2online.de> <20150626081827.GA12072@seid-online.de> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1435313750 1026 80.91.229.3 (26 Jun 2015 10:15:50 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 26 Jun 2015 10:15:50 +0000 (UTC) To: "guile-user@gnu.org" Original-X-From: guile-user-bounces+guile-user=m.gmane.org@gnu.org Fri Jun 26 12:15:44 2015 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 1Z8Qfd-0001DC-Mi for guile-user@m.gmane.org; Fri, 26 Jun 2015 12:15:41 +0200 Original-Received: from localhost ([::1]:59188 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z8Qfc-0002dA-JU for guile-user@m.gmane.org; Fri, 26 Jun 2015 06:15:40 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:50368) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z8QfN-0002cb-BQ for guile-user@gnu.org; Fri, 26 Jun 2015 06:15:26 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Z8QfI-00062Y-Ar for guile-user@gnu.org; Fri, 26 Jun 2015 06:15:24 -0400 Original-Received: from mail150c50.megamailservers.eu ([91.136.10.160]:60283 helo=mail50c50.megamailservers.eu) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z8QfI-0005xo-09 for guile-user@gnu.org; Fri, 26 Jun 2015 06:15:20 -0400 X-Authenticated-User: michele.titke.o2online.de Original-Received: from [10.34.218.181] ([89.204.154.181]) (authenticated bits=0) by mail50c50.megamailservers.eu (8.14.9/8.13.1) with ESMTP id t5QAFALc005274 for ; Fri, 26 Jun 2015 10:15:15 +0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.6.0 In-Reply-To: <20150626081827.GA12072@seid-online.de> X-CTCH-RefID: str=0001.0A020204.558D2635.0053, ss=1, re=0.000, recu=0.000, reip=0.000, cl=1, cld=1, fgs=0 X-CTCH-VOD: Unknown X-CTCH-Spam: Unknown X-CTCH-Score: 0.000 X-CTCH-Rules: X-CTCH-Flags: 0 X-CTCH-ScoreCust: 0.000 X-CSC: 0 X-CHA: v=2.1 cv=etPmkOZX c=1 sm=1 tr=0 a=LjtCMpFRv14PzK93lj5ZDg==:117 a=LjtCMpFRv14PzK93lj5ZDg==:17 a=tJe01QhAHdwA:10 a=N659UExz7-8A:10 a=4jxiIbArvk5dLca0iDwA:9 a=pILNOxqGKmIA:10 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x (no timestamps) [generic] X-Received-From: 91.136.10.160 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:11875 Archived-At: On 26/06/2015 10:18, Ralf Mattes wrote: > ... >> This is a first "raw" definition where the parameter /message/ has to be a >> quoted symbol. >> >> (define-method (call (receiver ) message . arguments) >> (apply (slot-ref receiver message) arguments)) >> >> >> The class definition still looks like traditional GOOPS but it works. >> >> An example: >> >> (define-class () >> (msg #:init-value (lambda () 'hello-world))) >> >> (define r (make )) >> (call r 'msg) => 'hello-world >> >> >> Now I'd like to have an easier syntax for describing the slot. The >> definition might be: >> >> (define-syntax define-message >> (syntax-rules () >> ((_ (message-name arguments ... ) body ...) >> (message-name #:init-value (lambda (arguments ...) body ...))))) >> >> But the following example doesn't work in 1.8: >> >> (define-class () >> (define-message (phone n) >> (repeat n (lambda () (bell) 'rang)) )) >> >> GOOPS complains about malformed slots and *seems* to see the unexpanded >> form.* > Here: > > $ guile-1.8 > guile> (use-modules (oop goops)) > guile> define-class > # > > Why would you expect a macro to evaluate its arguments? :-) The use of macros within macros is yet to be evaluated. But as syntax transformers sometimes check their arguments before these expressions are expanded if they are macros - one should really think about Scheme's macro expansion model. Do you think syntax transformers have in any way anything to do with the evaluation of code? > >> I could use a little help here, anyone?* Even for the naming scheme: /send/ >> is already used by unix sockets and methods are part of the implementation >> of generics. Perhaps /message/ isn't that bad. > That's what modules are for. > > guile> (define-module (ios) #:export (send)) ; ios = Inferior Object System > > and then: > > guile> (ios:send ....) Yes, just call it r-0b-delta-36x7 and let people rename it to find out what it means. > >> [...] >> PS >> Perhaps it's better to recreate a clean object model without 3,000 lines of >> C code like GOOPS. But then GOOPS really creates the illusion of an object >> oriented environment with a MOP ... > Why, 3000 lines of C code seems like a rather lean codebase for an objet system. Seems like your sentence is not a valid expression in Scheme.