From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: tomas@tuxteam.de Newsgroups: gmane.lisp.guile.user Subject: Re: GOOPS functional setter Date: Sun, 15 Jan 2017 10:31:11 +0100 Message-ID: <20170115093111.GA19468@tuxteam.de> References: <871sw6g4je.fsf@dustycloud.org> <20170113205646.GB10416@tuxteam.de> <87vatie6gf.fsf@dustycloud.org> <20170114100839.GA3366@tuxteam.de> <87shole411.fsf@dustycloud.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; x-action=pgp-signed X-Trace: blaine.gmane.org 1484472719 15122 195.159.176.226 (15 Jan 2017 09:31:59 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sun, 15 Jan 2017 09:31:59 +0000 (UTC) User-Agent: Mutt/1.5.21 (2010-09-15) Cc: guile-user@gnu.org To: Christopher Allan Webber Original-X-From: guile-user-bounces+guile-user=m.gmane.org@gnu.org Sun Jan 15 10:31:55 2017 Return-path: Envelope-to: guile-user@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cShAB-0002es-Kl for guile-user@m.gmane.org; Sun, 15 Jan 2017 10:31:47 +0100 Original-Received: from localhost ([::1]:50868 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cShAC-0008G5-Gv for guile-user@m.gmane.org; Sun, 15 Jan 2017 04:31:48 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:42617) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cSh9o-0008G0-Vc for guile-user@gnu.org; Sun, 15 Jan 2017 04:31:25 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cSh9l-0001oN-Oc for guile-user@gnu.org; Sun, 15 Jan 2017 04:31:24 -0500 Original-Received: from mail.tuxteam.de ([5.199.139.25]:47248 helo=tomasium.tuxteam.de) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cSh9l-0001nH-J1 for guile-user@gnu.org; Sun, 15 Jan 2017 04:31:21 -0500 Original-Received: from tomas by tomasium.tuxteam.de with local (Exim 4.80) (envelope-from ) id 1cSh9b-00056y-UV; Sun, 15 Jan 2017 10:31:11 +0100 In-Reply-To: <87shole411.fsf@dustycloud.org> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy] X-Received-From: 5.199.139.25 X-BeenThere: guile-user@gnu.org X-Mailman-Version: 2.1.21 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" Xref: news.gmane.org gmane.lisp.guile.user:13102 Archived-At: -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Sat, Jan 14, 2017 at 03:16:10PM -0600, Christopher Allan Webber wrote: > tomas@tuxteam.de writes: > > > Curiously, Jan (also in this thread) came up with "clone", > > independently. > > Yes you're right. :) > > Speaking of Jan and I both thinking about clone'ish things [...] > Here's what it looks like in practice, adapting from the > (srfi srfi-9 gnu) code: > > (define fsf-address > (make
> #:street "Franklin Street" > #:city "Boston" > #:country "USA")) > > (define rms > (make > #:age 30 > #:email "rms@gnu.org" > #:address fsf-address)) > > (define new-rms > (clone rms > ((.age) 60) > ((.address .street) "Temple Place"))) > > scheme@(guile-user)> (.age rms) > $12 = 30 > scheme@(guile-user)> (.age new-rms) > $13 = 60 > scheme@(guile-user)> (.street (.address rms)) > $14 = "Franklin Street" > scheme@(guile-user)> (.street (.address new-rms)) > $15 = "Temple Place" > > ... not bad, eh? You folks rock, seriously :-) > Updated copy of goops-functional-setter.scm attached! What do other > people think? Should I try to get this upstream in Guile? I'd love that kind of interface. Feels pretty natural. regards - -- t -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.12 (GNU/Linux) iEYEARECAAYFAlh7QV8ACgkQBcgs9XrR2kbd5wCfVghdRDiJG5/AfrQ0kWkkNBzC aZIAn3SFxYRIe4C5pG5LpEzsG2dunJgf =i7FL -----END PGP SIGNATURE-----