guile-user
[Top][All Lists]
Advanced

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

Re: [guile-user] Sandboxing?


From: Kyle Cronan
Subject: Re: [guile-user] Sandboxing?
Date: Tue, 20 Mar 2001 20:44:51 +0000 (/etc/localtime)

On Tue, 20 Mar 2001, Keisuke Nishida wrote:

> Hmm, you could import your procedures into the safe environment:
> 
>   (define custom-environment (safe-environment 5))
> 
>   (module-define! custom-environment 'hello (lambda () "Hello"))
> 
>   (eval '(hello) custom-environment)  => "Hello"
> 

Alright, that solved my problem.  Also, I've encountered two variables
in my existing scheme code that are no longer bound in the safe
environment: list and nil.  These don't seem particularly hazardous;
could they be added to the export list in safe-r5rs.scm?

Kyle
<address@hidden>

> Or you could define your custom module:
> 
>   ---- custom-environment.scm ----------
>   (define-module (custom-environment)
>     :pure
>     :use-module (ice-9 safe-r5rs))
> 
>   (define (hello) "Hello")
>   --------------------------------------
> 
> Then
> 
>   (eval '(hello) (resolve-module '(custom-environment))) => "Hello"
> 
> I don't know how to do this using the GH interface, sorry.
> 
> Kei
> 




reply via email to

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