From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Francis Southern Newsgroups: gmane.lisp.guile.bugs Subject: Strange string-append and string-match behaviour Date: Thu, 17 Feb 2011 22:11:29 -0600 Message-ID: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 X-Trace: dough.gmane.org 1298002302 27209 80.91.229.12 (18 Feb 2011 04:11:42 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Fri, 18 Feb 2011 04:11:42 +0000 (UTC) To: bug-guile@gnu.org Original-X-From: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Fri Feb 18 05:11:38 2011 Return-path: Envelope-to: guile-bugs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1PqHgw-0007pk-Hr for guile-bugs@m.gmane.org; Fri, 18 Feb 2011 05:11:38 +0100 Original-Received: from localhost ([127.0.0.1]:46445 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PqHgv-0005p5-DE for guile-bugs@m.gmane.org; Thu, 17 Feb 2011 23:11:37 -0500 Original-Received: from [140.186.70.92] (port=60043 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PqHgp-0005ox-Qo for bug-guile@gnu.org; Thu, 17 Feb 2011 23:11:32 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PqHgo-0007vx-Sf for bug-guile@gnu.org; Thu, 17 Feb 2011 23:11:31 -0500 Original-Received: from mail-iw0-f169.google.com ([209.85.214.169]:52967) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PqHgo-0007vk-Pd for bug-guile@gnu.org; Thu, 17 Feb 2011 23:11:30 -0500 Original-Received: by iwc10 with SMTP id 10so3333964iwc.0 for ; Thu, 17 Feb 2011 20:11:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:date:x-google-sender-auth :message-id:subject:from:to:content-type; bh=CXhj/4bhJx+mVNIVR2pz0h2+3cEJ2noIsmJTgiYZMfA=; b=aqhDJvvwz7/GMqzPVqqbQdizTCcY+B/BewL99IMjw5CUlGCMajbBNyD8Xw59XJd2dO basPt7qoIXyKyrew0xxgHDCHCd+gWaWB9lL25G3GTOw9QU4I3MWlgMLzKuQNaWrdwVuL BeRmxP+WFKrE5CuCfqw/DQFUBzWJ13q2C6TAE= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:date:x-google-sender-auth:message-id:subject :from:to:content-type; b=vq0em6KLC+9jVoX10Z/yIYrFARSEK3evXqq6M16UmntqSDRv73OF+VIW3GymX15ebS XwCW+LRqxGJt+BZ5kneqMHvZju65R+t5f3BMfva9bjETbMBVJbCtVwmIZxLCmq/KyIZt cvD+LIeHtTxPn6tQy+3RYCCbA3EBnZkrc3gU4= Original-Received: by 10.231.160.80 with SMTP id m16mr181272ibx.106.1298002289889; Thu, 17 Feb 2011 20:11:29 -0800 (PST) Original-Received: by 10.231.14.12 with HTTP; Thu, 17 Feb 2011 20:11:29 -0800 (PST) X-Google-Sender-Auth: LxPOdEihN-PiloI7O09ARavaxL0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 209.85.214.169 X-BeenThere: bug-guile@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Bug reports for GUILE, GNU's Ubiquitous Extension Language" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Errors-To: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.bugs:5179 Archived-At: Hello Guilers, I'm not 100% sure whether this is a bug or not, and it might not even be legal Scheme code! But it seemed a bit odd to me so I'm reporting it here. (I'm currently using 1.9.15, but I believe this to be reproducible on 2.0.) I was trying to match strings that started with a question mark, what I wanted was actually `(string-match "\\?.*" "?wibble")', but the problem is that when I was trying out a few different regexes I got some odd results. scheme@(guile-user)> (string-match "?.*" "?wobble") ERROR: In procedure make-regexp: ERROR: In procedure make-regexp: Error while printing exception. Entering a new prompt. Type `,bt' for a backtrace or `,q' to continue. This may not be a problem at all, but the error message seemed strange. But worse is yet to come! scheme@(guile-user)> (string-match "\?.*" "?wobble") While reading expression: ERROR: In procedure scm_lreadr: standard input:3:18: illegal character in escape sequence: #\? ;;; : warning: possibly unbound variable `.*' ERROR: In procedure #: ERROR: In procedure module-lookup: Unbound variable: .* Entering a new prompt. Type `,bt' for a backtrace or `,q' to continue. $1 = " " ;;; : warning: possibly unbound variable `?wobble' ERROR: In procedure #: ERROR: In procedure module-lookup: Unbound variable: ?wobble Entering a new prompt. Type `,bt' for a backtrace or `,q' to continue. And then it just hung and I needed to C-c C-c my way out. While talking to cky in #guile, he pointed out that the problem is actually with string-append and gave me two examples: (string-append "\?") which shows the basic error message, and (string-append "\?" "foo") which shows that after the error Guile tries to read "foo" as a symbol rather than a string. I am willing to admit the possibility that these examples are `malformed' and maybe it's too much to ask to have something graceful happen here, but I thought I should bring it to your attention and see what you thought. Thanks for your time and thanks for Guile! Francis