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: Fluids vs parameters: which API is better? Date: Mon, 25 Jul 2011 11:24:31 +0200 Message-ID: <87vcuq67cg.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> <87tyb65eze.fsf@gnu.org> <87pqlu6prt.fsf@pobox.com> <87livvxnej.fsf_-_@yeeloong.netris.org> <87ipqyk7hq.fsf@pobox.com> <87ei1frasr.fsf@olor.terpri.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: dough.gmane.org 1311585894 28491 80.91.229.12 (25 Jul 2011 09:24:54 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Mon, 25 Jul 2011 09:24:54 +0000 (UTC) To: guile-devel@gnu.org Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Mon Jul 25 11:24:51 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 1QlHP7-0002li-BW for guile-devel@m.gmane.org; Mon, 25 Jul 2011 11:24:49 +0200 Original-Received: from localhost ([::1]:45620 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QlHP6-0000wQ-Up for guile-devel@m.gmane.org; Mon, 25 Jul 2011 05:24:48 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]:60278) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QlHP3-0000wA-KZ for guile-devel@gnu.org; Mon, 25 Jul 2011 05:24:46 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QlHP2-0008UX-EF for guile-devel@gnu.org; Mon, 25 Jul 2011 05:24:45 -0400 Original-Received: from lo.gmane.org ([80.91.229.12]:48734) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QlHP2-0008UQ-3g for guile-devel@gnu.org; Mon, 25 Jul 2011 05:24:44 -0400 Original-Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1QlHP1-0002kr-28 for guile-devel@gnu.org; Mon, 25 Jul 2011 11:24:43 +0200 Original-Received: from 193.50.110.167 ([193.50.110.167]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 25 Jul 2011 11:24:43 +0200 Original-Received: from ludo by 193.50.110.167 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 25 Jul 2011 11:24:43 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 37 Original-X-Complaints-To: usenet@dough.gmane.org X-Gmane-NNTP-Posting-Host: 193.50.110.167 X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: 7 Thermidor 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 User-Agent: Gnus/5.110018 (No Gnus v0.18) Emacs/24.0.50 (gnu/linux) Cancel-Lock: sha1:xULlYjw6oyZg1kdZlSBNhyji8+s= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 80.91.229.12 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:12678 Archived-At: Hi BT, BT Templeton skribis: > Andy Wingo writes: [...] >> Here I disagree. From the perspective of semantics and security, it's >> important to be able to make assertions as to the type of value returned >> by a procedure -- that (current-input-port) returns a port. The same >> goes for (current-language) and all the other dynamic parameters. >> Parameters allow us to make guarantees like that. > > Why is it uniquely useful to be able to make these guarantees for > dynamically-bound values? Static/soft typing would be more generally > useful than parameters. I agree it’s not specific to dynamically-bound values. Andy mentioned that exporting, say, the fluid that underlies ‘current-output-port’ would be a problem because you could ‘fluid-set!’ it to anything, which would lead to an obscure wrong-type-arg error sometime. OTOH it could be argued that this is no different with mutable global variables. > Also, I'd prefer it if parameters used a type predicate or a type > specifier object instead of a conversion procedure. ISTM that the > current interface conflates type checking and coercion. Well, Andy’s proposal is similar to SRFI-39 and I find it convenient this way. Thanks, Ludo’.