* string-match error
@ 2014-01-15 20:33 Ariel Rios
2014-01-15 21:28 ` Mark H Weaver
0 siblings, 1 reply; 2+ messages in thread
From: Ariel Rios @ 2014-01-15 20:33 UTC (permalink / raw)
To: guile-user
[-- Attachment #1: Type: text/plain, Size: 1920 bytes --]
Hello y'all,
I am having problems using string-match. I have created a small script
that calls string-match and I get:
/home/ariel/console/mce/tests/./panda.scm:4:9: In procedure module-lookup:
Unbound variable: string-match
If I start guile and then use string-match there is no problem:
scheme@(guile-user)> (string-match "a" "a")
$1 = #("a" (0 . 1))
It also works if I start guile and then load the file:
[ariel@oc6281107537 tests]$ guile
GNU Guile 2.0.9
Copyright (C) 1995-2013 Free Software Foundation, Inc.
Guile comes with ABSOLUTELY NO WARRANTY; for details type `,show w'.
This program is free software, and you are welcome to redistribute it
under certain conditions; type `,show c' for details.
Enter `,help' for help.
scheme@(guile-user)> (load "panda.scm")
#(a (0 . 1))
The file contains:
#!/usr/local/bin/guile \
-e main -s
!#
(display (string-match "a" "a"))
Is there something that I am missing?
thanks,
ariel
Full Error for reference:
[ariel@oc6281107537 tests]$ guile -l panda.scm
Backtrace:
In ice-9/boot-9.scm:
157: 7 [catch #t #<catch-closure 1b2dae0> ...]
In unknown file:
?: 6 [apply-smob/1 #<catch-closure 1b2dae0>]
In ice-9/boot-9.scm:
63: 5 [call-with-prompt prompt0 ...]
In ice-9/eval.scm:
432: 4 [eval # #]
In ice-9/boot-9.scm:
2320: 3 [save-module-excursion #<procedure 1dcb940 at
ice-9/boot-9.scm:3961:3 ()>]
3968: 2 [#<procedure 1dcb940 at ice-9/boot-9.scm:3961:3 ()>]
In unknown file:
?: 1 [load-compiled/vm
"/home/ariel/.cache/guile/ccache/2.0-LE-8-2.0/home/ariel/console/mce/tests/panda.scm.go"]
In /home/ariel/console/mce/tests/./panda.scm:
4: 0 [#<procedure 1c8ab00 at
/home/ariel/console/mce/tests/./panda.scm:4:0 ()>]
/home/ariel/console/mce/tests/./panda.scm:4:9: In procedure #<procedure
1c8ab00 at /home/ariel/console/mce/tests/./panda.scm:4:0 ()>:
/home/ariel/console/mce/tests/./panda.scm:4:9: In procedure module-lookup:
Unbound variable: string-match
[-- Attachment #2: Type: text/html, Size: 2948 bytes --]
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: string-match error
2014-01-15 20:33 string-match error Ariel Rios
@ 2014-01-15 21:28 ` Mark H Weaver
0 siblings, 0 replies; 2+ messages in thread
From: Mark H Weaver @ 2014-01-15 21:28 UTC (permalink / raw)
To: Ariel Rios; +Cc: guile-user
Ariel Rios <ariel@gnu.org> writes:
> Hello y'all,
>
> I am having problems using string-match. I have created a small script
> that calls string-match and I get:
>
> /home/ariel/console/mce/tests/./panda.scm:4:9: In procedure
> module-lookup: Unbound variable: string-match
As it says in the "Regular Expressions" section of the manual:
"Before using the described functions, you should load this
module by executing `(use-modules (ice-9 regex))'."
> If I start guile and then use string-match there is no problem:
> scheme@(guile-user)> (string-match "a" "a")
> $1 = #("a" (0 . 1))
It seems that the REPL starts with (ice-9 regex) loaded by default.
Regards,
Mark
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2014-01-15 21:28 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-01-15 20:33 string-match error Ariel Rios
2014-01-15 21:28 ` Mark H Weaver
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).