From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Alan Manuel Gloria Newsgroups: gmane.lisp.guile.devel Subject: Re: Adding to guile curly-infix (SRFI 105), neoteric- & sweet-expressions Date: Tue, 28 Aug 2012 14:56:22 +0800 Message-ID: References: <1346033480.22469.9.camel@Renee-SUSE.suse> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 X-Trace: ger.gmane.org 1346136993 31269 80.91.229.3 (28 Aug 2012 06:56:33 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 28 Aug 2012 06:56:33 +0000 (UTC) Cc: guile-devel@gnu.org To: Noah Lavine Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Tue Aug 28 08:56:34 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 1T6Fiz-0000nO-SA for guile-devel@m.gmane.org; Tue, 28 Aug 2012 08:56:34 +0200 Original-Received: from localhost ([::1]:35164 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T6Fix-0003m0-IU for guile-devel@m.gmane.org; Tue, 28 Aug 2012 02:56:31 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:49230) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T6Fit-0003lr-SI for guile-devel@gnu.org; Tue, 28 Aug 2012 02:56:28 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1T6Fip-0008F6-Rz for guile-devel@gnu.org; Tue, 28 Aug 2012 02:56:27 -0400 Original-Received: from mail-pb0-f41.google.com ([209.85.160.41]:51513) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T6Fip-0008Ey-LM for guile-devel@gnu.org; Tue, 28 Aug 2012 02:56:23 -0400 Original-Received: by pbbro12 with SMTP id ro12so9054020pbb.0 for ; Mon, 27 Aug 2012 23:56:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=1gZL6YldFPWLECUkZm5RHuPgTYtd+9ToTU/Nzj35ne8=; b=HZ9tA8ZoomvQilYCPAcrcUQamTBa4GoTuA89roZrocfAK2R772g7WjPHT1BtxixMoe DSpPpkRuffu1pxsJzw2HgQOmCvNCqMKIocHdw7sboE60jryBxs6dZ9TImT/EZGgaEvRo lfOhuAD/xp12f+2Y6zgClNCs+GOhY/+SvXYAqHTIeZcIaX3nJ9i4lwBXb74GxtjUNfAm R4h+5B7M076/Eg2pnbeG8ZVHAPGKWwjW1CC0ZxZV/HmJsbX0CJEhtRR3e5toEQ27U0kT xYG7wKlRMQDGD3y3SPvrZg00brvjv5D3wPcccG+YaCdw6SxP7ZIaDcqQCnZgdRzo62dL krYA== Original-Received: by 10.68.141.46 with SMTP id rl14mr40226206pbb.2.1346136982246; Mon, 27 Aug 2012 23:56:22 -0700 (PDT) Original-Received: by 10.66.163.2 with HTTP; Mon, 27 Aug 2012 23:56:22 -0700 (PDT) In-Reply-To: X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 209.85.160.41 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:14826 Archived-At: On Tue, Aug 28, 2012 at 10:57 AM, Noah Lavine wrote: > Hello, > > On Mon, Aug 27, 2012 at 12:30 AM, Alan Manuel Gloria wrote: >> However, it leads to an edge case in Guile 2.0 where disabling >> autocompilation leads to the module-loading C code path going through >> a direct C call to the C implementation of primitive-load, a path that >> only triggers if autocompilation disabled (when autocompilation is >> enabled, it goes through a hook in the language support for Scheme, >> which uses the 'read function we've rebound). > > Hmm, interesting. That sounds like a bug, but I'd like one of the > Guile maintainers to clarify that this isn't intended before I look at > it more. Is this triggered when you're trying to load a module full of > infix expressions? Yes, with autocompilation off. > If so, how do you tell Guile that the module is > supposed to use infix expressions instead of s-expressions? By re-binding (via set!) 'read and 'primitive-load. On Guile 1.6 and 1.8, IIRC the C code uses the binding for 'primitive-load to handle loading module loading. On Guile 2.0, the compilation hook for the Scheme language uses the 'read Scheme binding (IIRC). Replacing the 'read and 'primitive-load bindings works for 1.6 and 1.8, and 2.0 with autocompilation enabled. With autocompilation off, Guile ends up calling the primitive-load C implementation directly as a C call, instead of the old behavior of calling 'primitive-load in the Scheme side. Our strategy, basically, was to completely replace the reader, as that had seemed to work in 1.6 and 1.8 at the REPL. I modified it later to replace 'primitive-load too, so that 'primitive-load uses the Scheme binding for 'read, which made it work in 1.6 and 1.8 during module loading. Sincerely, AmkG