From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: ludo@gnu.org (Ludovic =?utf-8?Q?Court=C3=A8s?=) Newsgroups: gmane.lisp.guile.devel Subject: Re: Functional record "setters", a different approach Date: Sat, 10 Nov 2012 22:40:41 +0100 Message-ID: <87txsxyw4m.fsf@gnu.org> References: <87fwcaah4w.fsf@netris.org> <87hap189i3.fsf@tines.lan> <87r4o47k00.fsf@tines.lan> <87625fdi8p.fsf@gnu.org> <87ip9f77nn.fsf@tines.lan> <87ip9d2zhy.fsf@gnu.org> <87vcdd9t6g.fsf@tines.lan> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1352583662 28684 80.91.229.3 (10 Nov 2012 21:41:02 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 10 Nov 2012 21:41:02 +0000 (UTC) Cc: guile-devel@gnu.org To: Mark H Weaver Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Sat Nov 10 22:41:12 2012 Return-path: Envelope-to: guile-devel@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 1TXIne-0006Na-Vn for guile-devel@m.gmane.org; Sat, 10 Nov 2012 22:41:11 +0100 Original-Received: from localhost ([::1]:38352 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TXInV-0000UE-0z for guile-devel@m.gmane.org; Sat, 10 Nov 2012 16:41:01 -0500 Original-Received: from eggs.gnu.org ([208.118.235.92]:58076) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TXInQ-0000Om-EV for guile-devel@gnu.org; Sat, 10 Nov 2012 16:40:59 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TXInN-00029W-Cs for guile-devel@gnu.org; Sat, 10 Nov 2012 16:40:56 -0500 Original-Received: from [2a01:e0b:1:123:ca0a:a9ff:fe03:271e] (port=36471 helo=xanadu.aquilenet.fr) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TXInN-00027l-6P for guile-devel@gnu.org; Sat, 10 Nov 2012 16:40:53 -0500 Original-Received: from localhost (localhost [127.0.0.1]) by xanadu.aquilenet.fr (Postfix) with ESMTP id C9A3E78B8; Sat, 10 Nov 2012 22:40:42 +0100 (CET) Original-Received: from xanadu.aquilenet.fr ([127.0.0.1]) by localhost (xanadu.aquilenet.fr [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 2osRFtkzhRAd; Sat, 10 Nov 2012 22:40:42 +0100 (CET) Original-Received: from pluto (reverse-83.fdn.fr [80.67.176.83]) by xanadu.aquilenet.fr (Postfix) with ESMTPSA id 223531F7; Sat, 10 Nov 2012 22:40:42 +0100 (CET) X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: 20 Brumaire an 221 de la =?utf-8?Q?R=C3=A9volution?= X-PGP-Key-ID: 0xEA52ECF4 X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc X-PGP-Fingerprint: 83C4 F8E5 10A3 3B4C 5BEA D15D 77DD 95E2 EA52 ECF4 X-OS: x86_64-unknown-linux-gnu In-Reply-To: <87vcdd9t6g.fsf@tines.lan> (Mark H. Weaver's message of "Sat, 10 Nov 2012 14:03:35 -0500") User-Agent: Gnus/5.130005 (Ma Gnus v0.5) Emacs/24.2 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 2a01:e0b:1:123:ca0a:a9ff:fe03:271e X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Developers list for Guile, the GNU extensibility library" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Original-Sender: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.devel:15144 Archived-At: Mark H Weaver skribis: > ludo@gnu.org (Ludovic Court=C3=A8s) writes: [...] >> BTW, why does =E2=80=98set-field=E2=80=99 has the record as its 2nd argu= ment instead of >> 1st (unlike =E2=80=98set-fields=E2=80=99)? > > Good question. I followed the syntax of 'set-field' from your original > patch, but that argument order did not make sense for 'set-fields'. In the meantime we concurred on IRC that keeping the record as the first argument in both cases may be best. >> +The @code{(srfi srfi-9 gnu)} module extends SRFI-9 with facilities to >> +return new record instances based on existing ones, only with one or >> +more field values changed---@dfn{functional setters}. First, the >> +@code{define-immutable-record-type} works like >> +@code{define-record-type}, except that setters are defined as functional >> +setters. > > "except that the fields are immutable and the setters are ..." OK. >> +@deffn {Scheme Syntax} set-field (field sub-fields ...) record value >> +Return a new record of @var{record}'s type whose fields are equal to >> +the corresponding fields of @var{record} except for the one specified by >> +@var{field}. >> + >> +@var{field} must be the name of the getter corresponding to the field of >> +@var{record} being ``set''. Subsequent @var{sub-fields} must be record > > This is the first time that "getter" is used, but it has not been made > clear that you mean what has been called an "accessor" elsewhere in the > doc. More generally, there is a confusing mixture of the > accessor/modifier and getter/setter terminology. I wonder if it would > made sense to do some kind of find/replace in this section. Yeah. I ended up leaving =E2=80=9Cgetter=E2=80=9D, because that=E2=80=99s = the term used in the SRFI-9 node from the beginning. But I agree we might need to do some find/replace at some point. Ludo=E2=80=99.