guile-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: specifying module with eval


From: Issac Trotts
Subject: Re: specifying module with eval
Date: Mon, 26 Jan 2004 17:25:23 -0800
User-agent: Mutt/1.5.4i

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





reply via email to

[Prev in Thread] Current Thread [Next in Thread]