[Top][All Lists]

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

Re: Namespaces for HB-Guile modules? Help. :(

From: Rob Browning
Subject: Re: Namespaces for HB-Guile modules? Help. :(
Date: Thu, 15 Nov 2001 21:12:54 -0600
User-agent: Gnus/5.090004 (Oort Gnus v0.04) Emacs/21.1

Alejandro Forero Cuervo <address@hidden> writes:

> However, it seems that (1) modules need to be on specific locations
> designated from them (rather than wherever the users can place them,
> usually in the public HTML tree) and (2) the programmer has to fill
> their Guile file for a module with lots of special calls to the effect
> of defining a new module.

What you may want is guile's new "safe modules".  From the unstable
1.5 NEWS file:

  ** It's now possible to create modules with controlled environments


  (use-modules (ice-9 safe))
  (define m (make-safe-module))
  ;;; m will now be a module containing only a safe subset of R5RS
  (eval '(+ 1 2) m) --> 3
  (eval 'load m) --> ERROR: Unbound variable: load

You could then pull in whatever other system modules you wanted a user
to have access to:

  (eval '(use-modules (foo bar)) m)
  (eval '(load "some-code") m)

etc.  Note that I haven't tried this, so you may not be able to do
exactly what I've shown, and off the top of my head, I don't know
whether or not there's a sanctioned scheme level command to push
bindings into the new module -- i.e. something like:

  (module-define! m 'foo foo)

Rob Browning
rlb,, and
GPG=1C58 8B2C FB5E 3F64 EA5C  64AE 78FE E5FE F0CB A0AD

reply via email to

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