From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: ludo@gnu.org (Ludovic =?iso-8859-1?Q?Court=E8s?=) Newsgroups: gmane.lisp.guile.devel Subject: Re: How can I tell guile to shut up? ;) Date: Fri, 01 Jul 2011 15:04:37 +0200 Message-ID: <87tyb65eze.fsf@gnu.org> References: <99db88be1896528082d33a77ec4cadbe.squirrel@webmail.kapsi.fi> <87y60lsjx5.fsf@pobox.com> <87r56cxgax.fsf@rotty.yi.org> <87r56bd656.fsf@pobox.com> <871uyb1030.fsf@gnu.org> <87zkky8lgi.fsf@pobox.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: dough.gmane.org 1309526204 14427 80.91.229.12 (1 Jul 2011 13:16:44 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Fri, 1 Jul 2011 13:16:44 +0000 (UTC) Cc: guile-devel@gnu.org To: Andy Wingo Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Fri Jul 01 15:16:40 2011 Return-path: Envelope-to: guile-devel@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1QcdaH-0003xI-Si for guile-devel@m.gmane.org; Fri, 01 Jul 2011 15:16:38 +0200 Original-Received: from localhost ([::1]:37533 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QcdaG-0007w5-Em for guile-devel@m.gmane.org; Fri, 01 Jul 2011 09:16:36 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]:47168) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QcdOj-0004sA-OH for guile-devel@gnu.org; Fri, 01 Jul 2011 09:04:43 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QcdOh-0005NK-SI for guile-devel@gnu.org; Fri, 01 Jul 2011 09:04:41 -0400 Original-Received: from solo.fdn.fr ([80.67.169.19]:34668) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QcdOh-0005Mz-If for guile-devel@gnu.org; Fri, 01 Jul 2011 09:04:39 -0400 Original-Received: from nixey (unknown [193.50.110.208]) (using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (Client did not present a certificate) (Authenticated sender: lcourtes) by smtp.fdn.fr (Postfix) with ESMTPSA id 6236444376; Fri, 1 Jul 2011 15:04:38 +0200 (CEST) X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: 13 Messidor an 219 de la =?iso-8859-1?Q?R=E9volution?= 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: <87zkky8lgi.fsf@pobox.com> (Andy Wingo's message of "Fri, 01 Jul 2011 10:16:29 +0200") User-Agent: Gnus/5.110017 (No Gnus v0.17) Emacs/24.0.50 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 80.67.169.19 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:12628 Archived-At: Hello! Andy Wingo skribis: > Third time's the charm, as they say... here's the deal. `with-fluids' > is fairly efficient, because its body does not need to be allocated as a > closure, but it doesn't provide you any guarantees about the values > bound to the fluids. Parameter objects are better in that way, because > their converter can check the values. Parameterize is just as short as > with-fluids, but preserves this correctness property, so it's a good > thing. Yes, agreed. I prefer parameters too, but I was concerned that using parameters in Guile=E2=80=99s API would introduce an inconsistency, break t= he rule of least surprise, etc. > However parameterize was not as efficient as `with-fluids', because its > body must be a closure. This version fixes that, so perhaps parameters > are the thing now. OK, understood. >> How about exposing the fluids the underlie =E2=80=98current-input-port= =E2=80=99 & >> co. instead? This would allow the use of =E2=80=98with-fluids=E2=80=99 = instead of >> fiddling with =E2=80=98dynamic-wind=E2=80=99 and the like, while being c= onsistent with >> the rest of Guile. > > Would you like users to be able to (fluid-set! %current-input-port > 'not-a-port)? Or to (with-fluids ((%current-input-port 'foo)) ...) ? > Probably not. No, but OTOH, I *think* it would lead to a graceful type error sooner or later, as opposed to a crash. > I think that we should be switching to parameters for user-facing > dynamic bindings. Fluids are to dynamic bindings what variables are > to toplevel bindings: useful building blocks, but not usually what you > want to give to the user. Yes, agreed in principle=E2=80=94though in practice variables can be set arbitrarily. The problem I have is that (1) I don=E2=80=99t see how we could migrate the existing public fluids to parameters without breaking the API, and (2) it=E2=80=99s unpleasant to my eye to have both fluids and parameters in the= core API. WDYT? Thanks, Ludo=E2=80=99.