From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Neil Jerram Newsgroups: gmane.lisp.guile.devel Subject: Re: [PATCH] Per-module reader, take #3 Date: Sat, 03 Dec 2005 20:02:32 +0000 Message-ID: <8764q6kkyv.fsf@ossau.uklinux.net> References: <87u0gp9lm3.fsf@laas.fr> <877jd3lkdq.fsf@ossau.uklinux.net> <87hdc62a6c.fsf@laas.fr> <87irw49twc.fsf@laas.fr> <87irw3prgp.fsf@ossau.uklinux.net> <8764rw7b9q.fsf_-_@laas.fr> <871x2j98qb.fsf@ossau.uklinux.net> <87u0ffnudk.fsf@laas.fr> <87sluxb0xt.fsf@ossau.uklinux.net> <87r7agvdb1.fsf@laas.fr> <87wtk796xk.fsf@ossau.uklinux.net> <87br1jiacq.fsf@laas.fr> <87d5lp9vv4.fsf@ossau.uklinux.net> <871x258dxd.fsf@zip.com.au> <87zmos8zt4.fsf@ossau.uklinux.net> <87ll0a3hlk.fsf@ossau.uklinux.net> <87pspch28a.fsf_-_@laas.fr> <87zmo4jny6.fsf@ossau.uklinux.net> <87acg0maxs.fsf@zagadka.de> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1133640269 26488 80.91.229.2 (3 Dec 2005 20:04:29 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sat, 3 Dec 2005 20:04:29 +0000 (UTC) Cc: guile-devel@gnu.org Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Sat Dec 03 21:04:25 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1Eidbm-00081f-Du for guile-devel@m.gmane.org; Sat, 03 Dec 2005 21:03:46 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Eidbp-0000SI-Dz for guile-devel@m.gmane.org; Sat, 03 Dec 2005 15:03:49 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Eidbl-0000RC-1X for guile-devel@gnu.org; Sat, 03 Dec 2005 15:03:45 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Eidbk-0000QX-Hg for guile-devel@gnu.org; Sat, 03 Dec 2005 15:03:44 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Eidbk-0000QP-CW for guile-devel@gnu.org; Sat, 03 Dec 2005 15:03:44 -0500 Original-Received: from [80.84.72.33] (helo=mail3.uklinux.net) by monty-python.gnu.org with esmtp (Exim 4.34) id 1Eidbw-0003AX-N2 for guile-devel@gnu.org; Sat, 03 Dec 2005 15:03:56 -0500 Original-Received: from laruns (host86-129-132-201.range86-129.btcentralplus.com [86.129.132.201]) by mail3.uklinux.net (Postfix) with ESMTP id C4589409FA7; Sat, 3 Dec 2005 20:03:40 +0000 (UTC) Original-Received: from laruns (laruns [127.0.0.1]) by laruns (Postfix) with ESMTP id 562CE6F716; Sat, 3 Dec 2005 20:02:32 +0000 (GMT) Original-To: Marius Vollmer In-Reply-To: <87acg0maxs.fsf@zagadka.de> (Marius Vollmer's message of "20 Nov 2005 02:15:27 +0200") User-Agent: Gnus/5.1007 (Gnus v5.10.7) Emacs/21.4 (gnu/linux) 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:5449 Archived-At: Marius Vollmer writes: > Neil Jerram writes: > >> To be completely concrete about what I mean, here is a version of >> your patch which I prefer (untested except by make check). > > Hmm. Your approach make 'load' configurable so that it can use > different 'read' procedures. Wouldn't it be more natural to make > 'read' configurable to parse different syntaxes? > > 'load' is only a thin wrapper around 'read' and 'eval' (basically, a > repl without the 'p'). The real meat is in 'read' (syntax) and 'eval' > (semantics). So, if we want to customize the syntax, I'd say 'read' > is the place to do it. Then all users of 'read' would automatically > use the new syntax, not only when reading code in 'load'. (That's one > big point of Lisp, that the data and code syntax are the same.) That was my one of my first thoughts also (see towards the end of http://lists.gnu.org/archive/html/guile-devel/2005-09/msg00035.html). But now I'm not sure that it makes sense. If you are reading expressions by hand, and you want to use an alternative reader to do so, you can just call (alternative-read port) - there's no need to make the normal `read' configurable. On the other hand, the reason for allowing `load' to be configurable (with an alternative reader) is pretty much exactly the same as the reason why we think it's useful to provide `load' at all: that is, just that it's too boring to ask developers to write the same read eval loop over and over again, even though they could. Finally, although we might in theory be able to accommodate all possible reading variants as configurable options to the default read, in practice (i) this would be a pain for anyone wanting a variant that hasn't yet been incorporated into Guile's official reader, because they'd have to argue for it and then wait until it filtered through to a release, and (ii) we'd still need to implement something to make it easy to confine the effect/scope of read options to particular files, because the common case is that particular files require particular read variants. Taking (i) and (ii), it seems a lot simpler just to allow the Guile developer to specify an alternative read procedure for a particular load operation. > However, making the read procedure used by 'load' configurable can't > hurt, I think. OK, thanks. I'll just wait a few days in case you or anyone else have further comments. If not I'll commit the patch as proposed. Regards, Neil _______________________________________________ Guile-devel mailing list Guile-devel@gnu.org http://lists.gnu.org/mailman/listinfo/guile-devel