[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: strange behaviour to me
From: |
rm |
Subject: |
Re: strange behaviour to me |
Date: |
Sat, 30 Mar 2002 18:45:38 +0100 |
User-agent: |
Mutt/1.3.24i |
On Fri, Mar 29, 2002 at 10:49:22PM +0000, Mr. Peter Ivanyi wrote:
> Hi,
>
> I have a strange situation (at least to me). "match:string"
> becomes unbound in a script. For example if I start guile from a shell prompt:
>
> address@hidden $ guile
> guile> %load-path
> ("/home/peteri/temp/guile/install-1.5.4/share/guile/site"
> "/home/peteri/temp/guile/install-1.5.4/share/guile/1.5.4"
> "/home/peteri/temp/guile/install-1.5.4/share/guile" ".")
> guile> match:string
> #<procedure match:string (match)>
> guile>
>
> but from a script "match:string" is not bounded:
>
> address@hidden $ cat cc.scm
> (display %load-path)(newline)
> match:string
> address@hidden $ guile -s cc.scm
> (/home/peteri/temp/guile/install-1.5.4/share/guile/site
> /home/peteri/temp/guile/install-1.5.4/share/guile/1.5.4
> /home/peteri/temp/guile/install-1.5.4/share/guile .)
> ERROR: Unbound variable: match:string
> address@hidden $
>
>
> I do not understand it. How can I have "match:string" in my script ???
The cause: if run interactively guiles default module is 'guile-user', if
run from a script it is 'guile' (humpf!). Try the following:
| bash-2.05$ guile
| guile> match:string
| #<procedure match:string (match)>
| guile> (define-module (guile)) ; what is active when run as a
script
| #<module (guile) 8081620>
| guile> match:string
| ERROR: Unbound variable: match:string
| ABORT: (unbound-variable)
| guile> (define-module (guile-user)) ; back to interactive guile-user
| #<directory (guile-user) 80835c0>
| guile> match:string
| #<procedure match:string (match)>
| guile>
|
You need to import match:string from (ice-9 regex) if you want to use it from
within a script.
Hmm, thinking of it -- why is (ice-9 regex) loaded in (guile-user) ?
Ralf Mattes
> Thanx for your help in advance.
>
> Peter Ivanyi
>
> _______________________________________________
> Guile-user mailing list
> address@hidden
> http://mail.gnu.org/mailman/listinfo/guile-user