unofficial mirror of guile-user@gnu.org 
 help / color / mirror / Atom feed
* strange behaviour to me
@ 2002-03-29 22:49 Mr. Peter Ivanyi
  2002-03-30 17:45 ` rm
  2002-03-31 19:23 ` Evan Prodromou
  0 siblings, 2 replies; 3+ messages in thread
From: Mr. Peter Ivanyi @ 2002-03-29 22:49 UTC (permalink / raw)


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:

peteri@mercury $ 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:

peteri@mercury $ cat cc.scm
(display %load-path)(newline)
match:string
peteri@mercury $ 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
peteri@mercury $ 


I do not understand it. How can I have "match:string" in my script ???

Thanx for your help in advance.

				Peter Ivanyi

_______________________________________________
Guile-user mailing list
Guile-user@gnu.org
http://mail.gnu.org/mailman/listinfo/guile-user


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: strange behaviour to me
  2002-03-29 22:49 strange behaviour to me Mr. Peter Ivanyi
@ 2002-03-30 17:45 ` rm
  2002-03-31 19:23 ` Evan Prodromou
  1 sibling, 0 replies; 3+ messages in thread
From: rm @ 2002-03-30 17:45 UTC (permalink / raw)
  Cc: guile-user@gnu.org

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:
> 
> peteri@mercury $ 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:
> 
> peteri@mercury $ cat cc.scm
> (display %load-path)(newline)
> match:string
> peteri@mercury $ 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
> peteri@mercury $ 
> 
> 
> 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
> Guile-user@gnu.org
> http://mail.gnu.org/mailman/listinfo/guile-user

_______________________________________________
Guile-user mailing list
Guile-user@gnu.org
http://mail.gnu.org/mailman/listinfo/guile-user


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: strange behaviour to me
  2002-03-29 22:49 strange behaviour to me Mr. Peter Ivanyi
  2002-03-30 17:45 ` rm
@ 2002-03-31 19:23 ` Evan Prodromou
  1 sibling, 0 replies; 3+ messages in thread
From: Evan Prodromou @ 2002-03-31 19:23 UTC (permalink / raw)


>>>>> "PI" == Peter Ivanyi <peteri@carme.sect.mce.hw.ac.uk> writes:

    PI> but from a script "match:string" is not bounded:

Try :

    (use-modules (ice-9 regex))

~ESP

-- 
Evan Prodromou
evan@prodromou.san-francisco.ca.us


_______________________________________________
Guile-user mailing list
Guile-user@gnu.org
http://mail.gnu.org/mailman/listinfo/guile-user


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2002-03-31 19:23 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-03-29 22:49 strange behaviour to me Mr. Peter Ivanyi
2002-03-30 17:45 ` rm
2002-03-31 19:23 ` Evan Prodromou

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).