[racket] Limiting net-repl provided functions

From: Jukka Tuominen (jukka.tuominen at finndesign.fi)
Date: Tue Jun 28 05:11:34 EDT 2011

FYI,

this works nicely in Linux (where intented), but when tested inside Win XP/
Racket 5.1., it gives the following error:

file-exists?: `exists' access denied for C:\Program
Files\Racket\lib\libeay32.dll

br, jukka

>
>   ---- limited.rkt ---
>   #lang racket/base
>   (provide
>    ;; special things
>    #%app #%module-begin #%datum #%top #%top-interaction
>    ;; visible primitives
>    + - quote length
>    ;; additional functions
>    f1)
>   ;; definitions for the additional functions
>   (define (f1 l) (length l))
>
> and then:
>
>   > (require racket/sandbox)
>   > (define e (make-evaluator "limited.rkt"))
>   > (e '(+ 1 2))
>   3
>   > (e '(- (f1 '(x y z)) 1))
>   2
>                     http://barzilay.org/                   Maze is Life!



Posted on the users mailing list.