This is the mail archive of the
guile@sourceware.cygnus.com
mailing list for the Guile project.
Re: simple question
- To: Paul dot Emsley at chem dot gla dot ac dot uk
- Subject: Re: simple question
- From: Mikael Djurfeldt <mdj at mdj dot nada dot kth dot se>
- Date: 04 Jul 2000 19:14:11 +0200
- Cc: bug-guile at red-bean dot com
- Cc: <guile at sourceware dot cygnus dot com>
- Cc: djurfeldt at nada dot kth dot se
- References: <200007041049.LAA12861@eriskay.chem.gla.ac.uk>
Paul.Emsley@chem.gla.ac.uk writes:
> #!/usr/local/bin/guile \
> -s
> !#
> (use-modules (ice-9 slib))
> (require 'format)
> (format #t "Hello ~a~%" "bill")
>
> I mean that the format expansion only works in "interactive"
> mode. Can I have it working in script mode (or whatever it's
> called) too?
The problem occurs because, currently, scripts are evaluated in the
core module (guile) which provides a simple form of `format'.
Normally when you tell Guile to use a module, bindings from that
module will shadow bindings imported from (guile). But bindings
imported from another module can't shadow bindings within the module
your code resides in.
There are two Guile bugs here:
1. That scripts are evaluated in the (guile) module is a bug. The
question is in which module scripts should be evaluated. I propose
`(guile-script)'. `(guile-user)' is a dedicated interactive
environment containing bindings for interactive use.
2. The simple format provided by (guile) should be case independent.
(format #t "Hello ~A~%" "bill")
currently works also for simple format.