Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!swrinde!elroy.jpl.nasa.gov!ames!haven.umd.edu!uflorida!reef.cis.ufl.edu!afz From: afz@cis.ufl.edu (Aric Zion) Newsgroups: comp.lang.scheme.c Subject: LISP to SCHEME Message-ID: <28934@uflorida.cis.ufl.EDU> Date: 4 Jun 91 15:23:13 GMT Sender: news@uflorida.cis.ufl.EDU Organization: UF CIS Dept. Lines: 60 Originator: afz@reef.cis.ufl.edu I am working on a program that will translate Common Lisp to Scheme, so that DEC's Scheme->C translator can then convert the Scheme to C. I have come up against a couple of problems, and I would appreciate some help. PROBLEM 1 --------- In SCHEME, (define ab-list '(a b)) performs the side effect and also evaluates to => ab-list In LISP, (setf ab-list '(a b)) also performs the side effect but evaluates to => (a b) PROBLEM 2 --------- SETF is global if the argument does not exist locally DEFINE is local even if the argument does not exist locally for example, In SCHEME, (define x 4) (define (somefunction) (define x 3) ) (somefunction) x => 4 But in LISP, (setf x 4) (defun somefunction () (setf x 3) ) (somefunction) x => 3 What can I do in these cases to make SCHEME emulate LISP. Please respond to: afz@reef.cis.ufl.edu Thanks, Aric Zion