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: Needed: per-port reader options Date: Tue, 16 Oct 2012 17:52:08 +0200 Message-ID: <87ehkyza6v.fsf@gnu.org> References: <87sj9ixl1j.fsf@tines.lan> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: ger.gmane.org 1350402755 8056 80.91.229.3 (16 Oct 2012 15:52:35 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 16 Oct 2012 15:52:35 +0000 (UTC) To: guile-devel@gnu.org Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Tue Oct 16 17:52:42 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 1TO9Ri-0003vF-4K for guile-devel@m.gmane.org; Tue, 16 Oct 2012 17:52:42 +0200 Original-Received: from localhost ([::1]:53531 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TO9Rb-0006Yj-B5 for guile-devel@m.gmane.org; Tue, 16 Oct 2012 11:52:35 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:55128) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TO9RS-0006Eh-NV for guile-devel@gnu.org; Tue, 16 Oct 2012 11:52:32 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TO9RR-0007dN-DF for guile-devel@gnu.org; Tue, 16 Oct 2012 11:52:26 -0400 Original-Received: from plane.gmane.org ([80.91.229.3]:52692) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TO9RR-0007d6-6O for guile-devel@gnu.org; Tue, 16 Oct 2012 11:52:25 -0400 Original-Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1TO9RU-0003g0-7A for guile-devel@gnu.org; Tue, 16 Oct 2012 17:52:28 +0200 Original-Received: from 193.50.110.168 ([193.50.110.168]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 16 Oct 2012 17:52:28 +0200 Original-Received: from ludo by 193.50.110.168 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 16 Oct 2012 17:52:28 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 34 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: 193.50.110.168 X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: 25 =?iso-8859-1?Q?Vend=E9miaire?= an 221 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.130005 (Ma Gnus v0.5) Emacs/24.2 (gnu/linux) Cancel-Lock: sha1:DDK6Wh6b69+eFo7ekg4ltmuK5RU= X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 80.91.229.3 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:14987 Archived-At: Hi, Mark H Weaver skribis: > I recently tried to implement reader directives, e.g.: > > #!fold-case (from R7RS) > #!no-fold-case (from R7RS) > #!curly-infix (from SRFI-105) > > However, I ran into a rather serious problem. Guile's reader options > are global to the entire process, but clearly these reader directives > should affect only the port they are read from. So we need to support > per-port reader options. I think we should instead be able to instantiate new readers–i.e., have a higher-order ‘make-reader’ procedure (that’s how Guile-Reader started, actually.) That, combined with the ‘current-reader’ fluid, should provide good flexibility. As an example, http://git.savannah.gnu.org/cgit/guile-reader.git/tree/modules/system/reader/confinement.scm provides reader settings that are confined for each module. Also, I think ports should remain reader-oblivious. ‘read’ is fundamentally at a higher level of abstraction, so I’d personally prefer not to have ports fiddle with it. WDYT? Thanks, Ludo’.