~ubuntu-branches/ubuntu/warty/electric/warty

« back to all changes in this revision

Viewing changes to lib/lisp/safe-env.scm

  • Committer: Bazaar Package Importer
  • Author(s): Chris Ruffin
  • Date: 2002-03-23 11:02:56 UTC
  • Revision ID: james.westby@ubuntu.com-20020323110256-mx008emo1nb2k11i
Tags: 6.05-1
* new upstream release
* added menu hints (closes: #128765)
* changed doc-base to go into Technical section per menu-policy

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
;;; -*-Scheme-*-
 
2
;;;
 
3
;;; This macro evaluates its arguments (arbitrary expressions) in a
 
4
;;; lexical environment created as a copy of the global environment
 
5
;;; in which all the predefined primitives are bound.
 
6
;;; Contributed by Carsten Bormann <cabo@informatik.uni-bremen.de>
 
7
 
 
8
(define-macro (with-safe-environment . body)
 
9
  (let* ((built-in-environment
 
10
           (car (last-pair (environment->list (the-environment)))))
 
11
         (binding-copy
 
12
           (map (lambda (p)
 
13
                  (list (car p) (car p)))
 
14
                built-in-environment)) )
 
15
    `(let ,binding-copy ,@body)))