<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Verdana
}
--></style>
</head>
<body class='hmmessage'>
<div><br></div><div>Yeah that sounded "too good" to be true, as I was pretty sure to have read here that eval cannot have access at all to the enclosing bindings.</div><br>> Date: Tue, 20 Apr 2010 11:16:22 -0500<br>> Subject: Re: [plt-scheme] eval & syntax-rules<br>> From: robby@eecs.northwestern.edu<br>> To: skeptic2000@hotmail.com<br>> CC: plt-scheme@list.cs.brown.edu<br>> <br>> This expression:<br>> <br>> (let ([t 2])<br>> (eval t (make-base-namespace)))<br>> <br>> is equivalent to this one:<br>> <br>> (eval 2 (make-base-namespace))<br>> <br>> I think you probably meant to write this:<br>> <br>> (let ([t 2])<br>> (eval 't (make-base-namespace)))<br>> <br>> Eval is not what you think it is, I'd say. It isn't like ruby's eval,<br>> for example. There are lots of discussions of this in the mail<br>> archives for this list and some of them may even have made it into the<br>> Guide.<br>> <br>> Robby<br>> <br>> On Tue, Apr 20, 2010 at 11:13 AM, Skeptic . <skeptic2000@hotmail.com> wrote:<br>> ><br>> > Hi,<br>> > Why something like this works :<br>> > #lang scheme<br>> > (define t 9)<br>> > (let ([t 2])<br>> > (eval t (make-base-namespace)))<br>> > -> 2<br>> > but not something like this :<br>> > #lang scheme<br>> > (define a 4)<br>> > (define b 5)<br>> > (define c 6)<br>> > (define-syntax test<br>> > (syntax-rules ()<br>> > [(test id ...)<br>> > (eval '(id ...) (make-base-namespace))]))<br>> > (test a b c)<br>> > -> reference to a unidentified identifier : a<br>> > Thanks.<br>> > ________________________________<br>> > Gardez le contact. Obtenez la version mobile de Messenger ici<br>> > _________________________________________________<br>> > For list-related administrative tasks:<br>> > http://list.cs.brown.edu/mailman/listinfo/plt-scheme<br>> ><br>> ><br>                                            <br /><hr />Messenger sur votre téléphone = MI sur la route <a href='http://go.microsoft.com/?linkid=9724469' target='_new'>Essayez-le maintenant.</a></body>
</html>