[plt-scheme] Checking that an expression only contains calls to 'valid' functions.

From: Eli Barzilay (eli at barzilay.org)
Date: Fri Jun 29 21:03:04 EDT 2007

On Jun 30, Jean-Pierre Lozi wrote:
> Hi all,
> I would like to check that a given scheme expression only contains
> calls to "valid" functions (their names are stored in a list). How
> would you do this? Do any of you have a better idea than just
> parsing the expression, knowing all the scheme stuctures (let,
> lambda, etc), and acting differently depending on each structure?
> Maybe by catching some errors?
> Actually, I would like the user to be able to use the basic
> functions from mzscheme and a few others.
> Any ideas would be greatly appreciated.

Do you want to control evaluation in a safe way?  That is, do you want
to check that the Scheme code will not read your password file, delete
your home directory, run forever, grab every bit of RAM your machine
has?  If so, you should read about the sandbox library.

          ((lambda (x) (x x)) (lambda (x) (x x)))          Eli Barzilay:
                  http://www.barzilay.org/                 Maze is Life!

Posted on the users mailing list.