unofficial mirror of guile-user@gnu.org 
 help / color / mirror / Atom feed
From: rm@fabula.de
Cc: "guile-user@gnu.org" <guile-user@gnu.org>
Subject: Re: strange behaviour to me
Date: Sat, 30 Mar 2002 18:45:38 +0100	[thread overview]
Message-ID: <20020330174538.GB23086@www> (raw)
In-Reply-To: <3CA4EF72.3A9DCBB6@carme.sect.mce.hw.ac.uk>

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


  reply	other threads:[~2002-03-30 17:45 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-03-29 22:49 strange behaviour to me Mr. Peter Ivanyi
2002-03-30 17:45 ` rm [this message]
2002-03-31 19:23 ` Evan Prodromou

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=20020330174538.GB23086@www \
    --to=rm@fabula.de \
    --cc=guile-user@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).