[plt-scheme] current-eval proc should receive syntax object, but doesn't

From: Paulo J. Matos (pocm at soton.ac.uk)
Date: Sun Mar 4 07:04:57 EST 2007

On 3/4/07, Ryan Culpepper <ryan_sml at yahoo.com> wrote:
> >
> > Since docs say:
> > (current-eval [proc]) gets or sets a procedure that takes an
> > expression -- in the form of syntax object, S-expression, compiled
> > expression, or compiled expression wrapped in a syntax object --
> > and returns the expression's value (or values; see section 2.2).
> >
> > I guess that applying syntax-object->datum to x would always work.
>
> No. You can only apply 'syntax-object->datum' to a syntax object, not
> to an S-expression, nor to a compiled code object. You're violating
> the (unchecked) contract of 'current-eval' by passing it a function
> that can only handle syntax objects.
>

Hummm, you're right. I read the docs but I missed the part where they
can say proc is supposed to receive besides a syntax object, a
S-expression... etc.. I think that since things got wierder as I tried
in mzscheme and worked I just supposed it was a bug and forgot to
recheck the docs.

> On the other hand, DrScheme isn't completely blameless. The reason
> you're getting that particular error is that DrScheme calls the
> current evaluator to do the module-language magic after the
> evaluation of your module. Arguably, DrScheme should use the original
> evaluator (and namespace) for that purpose to avoid interference with
> the user program.
>

I'm wrong in the fact that my example program is not supposed to
always work but I'm right in that it should at least evaluate the
expression and return the prompt. :-(

> Ryan
>
> >
> > --
> > Paulo Jorge Matos - pocm at soton.ac.uk
> > http://www.personal.soton.ac.uk/pocm
> > PhD Student @ ECS
> > University of Southampton, UK
> > _________________________________________________
> >   For list-related administrative tasks:
> >   http://list.cs.brown.edu/mailman/listinfo/plt-scheme
> >
>
>
>
>
> ____________________________________________________________________________________
> Sucker-punch spam with award-winning protection.
> Try the free Yahoo! Mail Beta.
> http://advision.webevents.yahoo.com/mailbeta/features_spam.html
>
>
>


-- 
Paulo Jorge Matos - pocm at soton.ac.uk
http://www.personal.soton.ac.uk/pocm
PhD Student @ ECS
University of Southampton, UK


Posted on the users mailing list.