unofficial mirror of guile-user@gnu.org 
 help / color / mirror / Atom feed
* specifying module with eval
@ 2004-01-27  0:28 Rouben Rostamian
  2004-01-27  1:25 ` Issac Trotts
  0 siblings, 1 reply; 4+ messages in thread
From: Rouben Rostamian @ 2004-01-27  0:28 UTC (permalink / raw)


The Guile 1.6.4 documentation says:

 - Scheme Procedure: eval exp module
 - C Function: scm_eval (exp, module)
     Evaluate EXP, a list representing a Scheme expression, in the
     top-level environment specified by MODULE.  While EXP is evaluated
     (using `primitive-eval'), MODULE is made the current module.  The
     current module is reset to its previous value when EVAL returns.

It is not clear to me how to specify a module name.
What is the syntax for it?

In other words, what do I put for "module-spec" in the expression

   (eval '(foo 12) module-spec)

to refer to the desired module?


-- 
Rouben Rostamian


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


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

* Re: specifying module with eval
  2004-01-27  0:28 specifying module with eval Rouben Rostamian
@ 2004-01-27  1:25 ` Issac Trotts
  2004-02-10  1:06   ` Rob Browning
  0 siblings, 1 reply; 4+ messages in thread
From: Issac Trotts @ 2004-01-27  1:25 UTC (permalink / raw)


On Mon, Jan 26, 2004 at 07:28:46PM -0500, Rouben Rostamian wrote:
> The Guile 1.6.4 documentation says:
> 
>  - Scheme Procedure: eval exp module
>  - C Function: scm_eval (exp, module)
>      Evaluate EXP, a list representing a Scheme expression, in the
>      top-level environment specified by MODULE.  While EXP is evaluated
>      (using `primitive-eval'), MODULE is made the current module.  The
>      current module is reset to its previous value when EVAL returns.
> 
> It is not clear to me how to specify a module name.
> What is the syntax for it?
> 
> In other words, what do I put for "module-spec" in the expression
> 
>    (eval '(foo 12) module-spec)
> 
> to refer to the desired module?

I was going to say "Have a look at p. 35 of the Scheme specification,"
but their advice doesn't work with the version of guile on my system
(1.6.4):

  guile> (eval '(* 7 3) (scheme-report-environment 5))
  
  Backtrace:
  In current input:
    1: 0* [eval (* 7 3) ...
    1: 1*  (scheme-report-environment 5)
  
  <unnamed port>:1:16: In expression (scheme-report-environment 5):
  <unnamed port>:1:16: Unbound variable: scheme-report-environment
  ABORT: (unbound-variable)
  guile> (eval '(* 7 3) (null-environment 5))
  
  Backtrace:
  In current input:
    2: 0* [eval (* 7 3) ...
    2: 1*  (null-environment 5)
  
  <unnamed port>:2:16: In expression (null-environment 5):
  <unnamed port>:2:16: Unbound variable: null-environment
  ABORT: (unbound-variable)

I wonder why guile doesn't conform to the spec here.

-- 
Issac Trotts
http://redwood.ucdavis.edu/~issac



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


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

* Re: specifying module with eval
  2004-01-27  1:25 ` Issac Trotts
@ 2004-02-10  1:06   ` Rob Browning
  2004-02-18 22:30     ` Marius Vollmer
  0 siblings, 1 reply; 4+ messages in thread
From: Rob Browning @ 2004-02-10  1:06 UTC (permalink / raw)
  Cc: Guile-user

"Issac Trotts" <ijtrotts@ucdavis.edu> writes:

> I wonder why guile doesn't conform to the spec here.

Looks like at least at the moment, you need a (use-modules (ice-9
r5rs)) first.  I'll have to figure out whether the docs or the default
imports of the guile-user module need changing.

-- 
Rob Browning
rlb @defaultvalue.org and @debian.org; previously @cs.utexas.edu
GPG starting 2002-11-03 = 14DD 432F AE39 534D B592  F9A0 25C8 D377 8C7E 73A4


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


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

* Re: specifying module with eval
  2004-02-10  1:06   ` Rob Browning
@ 2004-02-18 22:30     ` Marius Vollmer
  0 siblings, 0 replies; 4+ messages in thread
From: Marius Vollmer @ 2004-02-18 22:30 UTC (permalink / raw)
  Cc: Guile-user

Rob Browning <rlb@defaultvalue.org> writes:

> "Issac Trotts" <ijtrotts@ucdavis.edu> writes:
>
>> I wonder why guile doesn't conform to the spec here.
>
> Looks like at least at the moment, you need a (use-modules (ice-9
> r5rs)) first.  I'll have to figure out whether the docs or the default
> imports of the guile-user module need changing.

[Rob, I changed my mind.]

I think we should make (guile-user) use (ice-9 r5rs) by default.  I
have done so in CVS.

-- 
GPG: D5D4E405 - 2F9B BCCC 8527 692A 04E3  331E FAF8 226A D5D4 E405


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


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

end of thread, other threads:[~2004-02-18 22:30 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-01-27  0:28 specifying module with eval Rouben Rostamian
2004-01-27  1:25 ` Issac Trotts
2004-02-10  1:06   ` Rob Browning
2004-02-18 22:30     ` Marius Vollmer

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