From: Francis Southern <francis.southern@gmail.com>
To: bug-guile@gnu.org
Subject: Strange string-append and string-match behaviour
Date: Thu, 17 Feb 2011 22:11:29 -0600 [thread overview]
Message-ID: <AANLkTi=8XpEM5oAWnR+kNz=Jynx73Cim=gQnDKuhxXH8@mail.gmail.com> (raw)
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: #\?
;;; <unknown-location>: warning: possibly unbound variable `.*'
ERROR: In procedure #<procedure 2183020 ()>:
ERROR: In procedure module-lookup: Unbound variable: .*
Entering a new prompt. Type `,bt' for a backtrace or `,q' to continue.
$1 = " "
;;; <unknown-location>: warning: possibly unbound variable `?wobble'
ERROR: In procedure #<procedure 21ac020 ()>:
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
next reply other threads:[~2011-02-18 4:11 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-02-18 4:11 Francis Southern [this message]
2011-02-27 22:27 ` Strange string-append and string-match behaviour Andy Wingo
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/guile/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='AANLkTi=8XpEM5oAWnR+kNz=Jynx73Cim=gQnDKuhxXH8@mail.gmail.com' \
--to=francis.southern@gmail.com \
--cc=bug-guile@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).