From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Andy Wingo Newsgroups: gmane.lisp.guile.devel Subject: Re: [Guile-commits] GNU Guile branch, string_abstraction2, updated. 823e444052817ee120d87a3575acb4f767f17475 Date: Fri, 29 May 2009 11:35:33 +0200 Message-ID: References: <87tz38u8jr.fsf@gnu.org> <799701.86503.qm@web37908.mail.mud.yahoo.com> <972327.22408.qm@web37904.mail.mud.yahoo.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: ger.gmane.org 1243591701 19624 80.91.229.12 (29 May 2009 10:08:21 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 29 May 2009 10:08:21 +0000 (UTC) Cc: Ludovic =?utf-8?Q?Court=C3=A8s?= , guile-devel@gnu.org To: Mike Gran Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Fri May 29 12:08:16 2009 Return-path: Envelope-to: guile-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1M9z0Z-0000wh-IN for guile-devel@m.gmane.org; Fri, 29 May 2009 12:08:16 +0200 Original-Received: from localhost ([127.0.0.1]:38826 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1M9z0Y-0006JU-UM for guile-devel@m.gmane.org; Fri, 29 May 2009 06:08:15 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1M9yog-0003Q3-EV for guile-devel@gnu.org; Fri, 29 May 2009 05:55:59 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1M9yob-0003Eh-Py for guile-devel@gnu.org; Fri, 29 May 2009 05:55:56 -0400 Original-Received: from [199.232.76.173] (port=49505 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1M9yoa-0003EA-1g for guile-devel@gnu.org; Fri, 29 May 2009 05:55:52 -0400 Original-Received: from a-sasl-quonix.sasl.smtp.pobox.com ([208.72.237.25]:38918 helo=sasl.smtp.pobox.com) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1M9yoW-0004ov-QZ; Fri, 29 May 2009 05:55:48 -0400 Original-Received: from localhost.localdomain (unknown [127.0.0.1]) by a-sasl-quonix.sasl.smtp.pobox.com (Postfix) with ESMTP id 7BC611BB31; Fri, 29 May 2009 05:55:48 -0400 (EDT) Original-Received: from unquote (unknown [82.123.47.119]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by a-sasl-quonix.sasl.smtp.pobox.com (Postfix) with ESMTPSA id C681F1BB30; Fri, 29 May 2009 05:55:45 -0400 (EDT) In-Reply-To: <972327.22408.qm@web37904.mail.mud.yahoo.com> (Mike Gran's message of "Thu, 28 May 2009 12:57:37 -0700 (PDT)") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.92 (gnu/linux) X-Pobox-Relay-ID: E2D08F3C-4C36-11DE-9CB9-B4FDD46C8AFF-02397024!a-sasl-quonix.pobox.com X-detected-operating-system: by monty-python.gnu.org: Solaris 10 (beta) X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Developers list for Guile, the GNU extensibility library" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Errors-To: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.devel:8561 Archived-At: Hey Mike, On Thu 28 May 2009 21:57, Mike Gran writes: > Also, just for the record, it seems obvious that this character=20 > encoding pragma should only work on files, which is fine.=C2=A0 I think > that is the way it would work.=C2=A0 Once could imagine a use=C2=A0where > someone loaded code into a string and then passed it to scm_read() > for interpretation.=C2=A0 In this case, I think "coding: XXXX" or > whatever should not be interpreted. Hmm, dunno. I feel like many of Guile's users might be doing this. OTOH they don't have `coding' support. I guess I can see your point here. > scm_read() can't handle this on its own because it has no "state". > It is called once per expression. If scm_read() looks for the coding as a property of a port, I can imagine it mutating that value too. > The procedure scm_read is firm API and takes a port, which means=20 > that the s-expression it reads will be interpreted in the context of > the port's encoding.=C2=A0 It is the default reader. > > But, if the reader is modified to take its character encoding from > the top of the file, then the reader can't use scm_read directly=20 > as it would use the port's encoding. Why not allow scm_read() to detect this, and modify the port's encoding? Apologies if I missed the explanation :) Andy --=20 http://wingolog.org/