From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Ian Price Newsgroups: gmane.lisp.guile.bugs Subject: Re: Guile v. 2.0.1 does not handle escaped open parentheses correctly. Date: Sat, 11 Jun 2011 18:23:35 +0100 Message-ID: References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: dough.gmane.org 1307812925 17446 80.91.229.12 (11 Jun 2011 17:22:05 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sat, 11 Jun 2011 17:22:05 +0000 (UTC) Cc: bug-guile To: Torstein Winterseth Original-X-From: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Sat Jun 11 19:22:00 2011 Return-path: Envelope-to: guile-bugs@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 1QVRsm-0003UT-HG for guile-bugs@m.gmane.org; Sat, 11 Jun 2011 19:22:00 +0200 Original-Received: from localhost ([::1]:43845 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QVRsl-0000XR-3v for guile-bugs@m.gmane.org; Sat, 11 Jun 2011 13:21:59 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]:43209) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QVRsU-0000XM-5i for bug-guile@gnu.org; Sat, 11 Jun 2011 13:21:43 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QVRsT-0008DE-0w for bug-guile@gnu.org; Sat, 11 Jun 2011 13:21:42 -0400 Original-Received: from mail-ww0-f49.google.com ([74.125.82.49]:39799) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QVRsS-0008D7-SF for bug-guile@gnu.org; Sat, 11 Jun 2011 13:21:40 -0400 Original-Received: by wwb39 with SMTP id 39so3067938wwb.30 for ; Sat, 11 Jun 2011 10:21:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=domainkey-signature:from:to:subject:in-reply-to:date:lines :references:user-agent:x-from-line:cc:message-id:mime-version :content-type; bh=73sDIg+r1vGByfV9uaAevZhxcNy1/kXneLXgAxCmMlU=; b=kvKxKH32BHCoIQiNLM4FGRRvGpa0nrE1oruNDAuaRcGxfbfwpV4XQFAF9hTxBqSilh AdM5N13OFc6UbuX0HAvuB8AA2ouBjNLkcDBBcnGADaNwubK/JNRfG+yZZUoxv83wZG7b qTSYUf8rWImqA8km97I1QXNi7AksIFRiiQDK8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=googlemail.com; s=gamma; h=from:to:subject:in-reply-to:date:lines:references:user-agent :x-from-line:cc:message-id:mime-version:content-type; b=ZYQJqOdn8tz0IE1ifhfvXgmG6xvnVfLClfpSX5JAi+luxJJdXXzv3YSkznNl0Ua9ZH VGVa6yIcnVEB9JSYPBx4LWo+Wts+zxzkOn+dv2h8Xt6iXcR1thayLNEkA9vQgX7Y1MoZ /W00mU/QPS3SBsqkJvP57yoDfUiw+AFGjRVKM= Original-Received: by 10.227.196.193 with SMTP id eh1mr3449962wbb.12.1307812899442; Sat, 11 Jun 2011 10:21:39 -0700 (PDT) Original-Received: from Kagami (host109-153-23-149.range109-153.btcentralplus.com [109.153.23.149]) by mx.google.com with ESMTPS id gb6sm2911923wbb.17.2011.06.11.10.21.37 (version=TLSv1/SSLv3 cipher=OTHER); Sat, 11 Jun 2011 10:21:38 -0700 (PDT) In-Reply-To: (Torstein Winterseth's message of "Wed, 11 May 2011 16:22:28 +0200") Original-Lines: 48 User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (gnu/linux) X-From-Line: nobody Sat Jun 11 18:23:43 2011 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 74.125.82.49 X-BeenThere: bug-guile@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Bug reports for GUILE, GNU's Ubiquitous Extension Language" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Original-Sender: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.bugs:5637 Archived-At: Torstein Winterseth writes: > Hello, > > I have found a bug where Guile does not handle escaped open > parentheses correctly. This was found in a real program which works in > Dr. Racket in R5RS mode. You are not the only interpreter on Fedora 15 > which fails this, but anyhow. > > Testcase: > > (define bug > '(\()) > > Expected results: > No errors. bug variable should now be bound to the list ((). > > Actual result: > [torstein@Desktor Skrivebord]$ guile -l testcase.scm --no-auto-compile > ERROR: In procedure primitive-load: > ERROR: In procedure scm_i_lreadparen: > /home/torstein/Skrivebord/testcase.scm:3:12: end of file > > In the actual program the list was larger, '(\{ \[ \(), and then the error was: > ERROR: In procedure primitive-load: > ERROR: In procedure scm_read_expression: > /home/torstein/Skrivebord/testcase.scm:2:27: unexpected ")" Whether or not this is a bug, I cannot say, but I would like to point out that neither the R5RS nor the R6RS consider '\( to be a valid symbol. I shan't quote the grammars here, but you can confirm this for yourself. http://www.schemers.org/Documents/Standards/R5RS/HTML/r5rs-Z-H-10.html#%_sec_7.1.2 http://www.r6rs.org/final/html/r6rs/r6rs-Z-H-7.html#node_sec_4.3.1 Specifically, in the R5RS, \ is not an initial (a letter or a special initial), nor a peculiar identifier. In the R6RS, it is not an initial (a constituent, a special initial, or an inline hex escape) nor a peculiar identifier. Handling additional identifiers is done in different ways in different Scheme implementations. '|(| is pretty common, but in guile you would use '#{(}#. If you want portable R5RS though, you should use (string->symbol "(")). If you choose R6RS, you can also use hex escapes, in this case '\x28; Also, apologies for the double send, but I forgot to include the mailing list. Hope that helps, Ian