[racket] okay to assemble datum->syntax #f … in stages?

From: Ryan Culpepper (ryan at cs.utah.edu)
Date: Wed Mar 14 20:20:43 EDT 2012

On 03/14/2012 06:07 PM, John Clements wrote:
> Forgot to send this earlier, question still stands:
>
> Based on my reading of the docs, the two expressions
>
> (datum->syntax
>   #f
>   (cons a b))
>
> (datum->syntax
>   #f
>   (cons (datum->syntax #f a)
>         (datum->syntax #f b)))
>
> …compute equivalent values.  They're not "equal?", but I conjecture
> that they're interchangeable.

Technically they are distinguishable. But practically they are 
interchangeable.

Search for "syntax pair" in the docs for a hint about the difference. 
The two expressions above are as equivalent as the results of reading (a 
b c) and (a . (b c)).

> I'm asking this because I want to wrap the 'require's inserted by
> run-teaching-program.rkt with stepper hints (Eli, don't read this!),
> and I can't do that until they're syntax objects.

Sounds like it should be fine.

Ryan

Posted on the users mailing list.