From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Andy Wingo Newsgroups: gmane.lisp.guile.bugs Subject: Re: Strange string-append and string-match behaviour Date: Sun, 27 Feb 2011 23:27:39 +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 1298845363 4133 80.91.229.12 (27 Feb 2011 22:22:43 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sun, 27 Feb 2011 22:22:43 +0000 (UTC) Cc: bug-guile@gnu.org To: Francis Southern Original-X-From: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Sun Feb 27 23:22:39 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 1Ptp0h-0005UN-AW for guile-bugs@m.gmane.org; Sun, 27 Feb 2011 23:22:39 +0100 Original-Received: from localhost ([127.0.0.1]:40372 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Ptp0g-0005Hr-RN for guile-bugs@m.gmane.org; Sun, 27 Feb 2011 17:22:38 -0500 Original-Received: from [140.186.70.92] (port=51289 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Ptp0X-0005Fb-EC for bug-guile@gnu.org; Sun, 27 Feb 2011 17:22:34 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Ptp0S-0008TC-Ev for bug-guile@gnu.org; Sun, 27 Feb 2011 17:22:29 -0500 Original-Received: from a-pb-sasl-sd.pobox.com ([64.74.157.62]:36207 helo=sasl.smtp.pobox.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ptp0S-0008Ss-Ak for bug-guile@gnu.org; Sun, 27 Feb 2011 17:22:24 -0500 Original-Received: from sasl.smtp.pobox.com (unknown [127.0.0.1]) by a-pb-sasl-sd.pobox.com (Postfix) with ESMTP id 4D1C83E88; Sun, 27 Feb 2011 17:23:40 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=pobox.com; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type; s=sasl; bh=zXJms1buyvKpnrcFEFMhg3QNGLQ=; b=CD0994 feFgZA3sBTXSa3anjux82eIMMzG3uNdwgZMWAQAajAk/4N+Cog5w+YKpiHhNK7SE uRadfcFfsuMKT0imej9yd2golTH3++BGhD/v/tdqvOXKCTArDyYFo+vNtlXnaIMm o042Jq9H/lrztmOaSKhnvJelOg+TvuGrJG2R8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=pobox.com; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type; q=dns; s=sasl; b=MwOjD4pveIiTD3sTNqvkHLDp5hpLz/jB /XzV4I3r9r9xncJzKlhsKzXLqZzwduHAIsRveMECAYIaUrkrRIAToUSDVmIV7Ws0 5Uwwo7aYrD8Tk834ljtBaFgid4Bz0mZzwPcvcZa5e+yX+qYPPXov4mhktc0dcWLT 6PST6dERc6k= Original-Received: from a-pb-sasl-sd.pobox.com (unknown [127.0.0.1]) by a-pb-sasl-sd.pobox.com (Postfix) with ESMTP id 3A35B3E87; Sun, 27 Feb 2011 17:23:39 -0500 (EST) Original-Received: from unquote.localdomain (unknown [90.164.198.39]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by a-pb-sasl-sd.pobox.com (Postfix) with ESMTPSA id 5596B3E86; Sun, 27 Feb 2011 17:23:37 -0500 (EST) In-Reply-To: (Francis Southern's message of "Thu, 17 Feb 2011 22:11:29 -0600") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (gnu/linux) X-Pobox-Relay-ID: 39CC962E-42C0-11E0-95F1-AF401E47CF6F-02397024!a-pb-sasl-sd.pobox.com X-detected-operating-system: by eggs.gnu.org: Solaris 10 (beta) X-Received-From: 64.74.157.62 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:5243 Archived-At: Hi Francis, The (most unfortunately indicated!) error is actually a read error due to malformed input and not related to any of these procedures. On Fri 18 Feb 2011 05:11, Francis Southern writes: > scheme@(guile-user)> (string-match "?.*" "?wobble") > ERROR: In procedure make-regexp: > ERROR: In procedure make-regexp: Error while printing exception. Heh. Fixed this error message to at least not print an exception: ERROR: In procedure make-regexp: ERROR: In procedure make-regexp: Invalid preceding regular expression Still not very good, but it's what libc gives us. > scheme@(guile-user)> (string-match "\?.*" "?wobble") > While reading expression: > ERROR: In procedure scm_lreadr: standard input:3:18: illegal character > in escape sequence: #\? OK! At this point "\? was read. It was determined that ? was an invalid escape char, so the read was aborted. Unfortunately we were inside a string. What's left is .*" "?wobble", and thus the following errors: > ;;; : warning: possibly unbound variable `.*' > ERROR: In procedure #: > ERROR: In procedure module-lookup: Unbound variable: .* Because we read the symbol `.*'. > $1 = " " Because we read the string " ". > ;;; : warning: possibly unbound variable `?wobble' > ERROR: In procedure #: > ERROR: In procedure module-lookup: Unbound variable: ?wobble Because we read ?wobble. > And then it just hung and I needed to C-c C-c my way out. Because we're inside a string, waiting for the ending ". Ironically you could have ended it with a \? ;-) I think the right thing to do here at the REPL is to flush all pending input when a read error occurs. I have pushed a patch to do that, I believe. Thanks for the report :) Andy -- http://wingolog.org/