[racket-dev] question on scribble/eval's do-plain-eval on bytes and strings

From: Danny Yoo (dyoo at cs.wpi.edu)
Date: Mon Apr 2 17:40:24 EDT 2012

>> Would it be equivalent behavior to turn the datum into a syntax object
>> instead?  That is:
>>
>>              ;; within do-plain-eval:
>>              (cond [(syntax? s)
>>                     (syntax-case s (module)
>>                       [(module . _rest) (syntax->datum s)]
>>                       [_else s])]
>>                    [(bytes? s) (datum->syntax #f s)]
>>                    [(string? s) (datum->syntax #f s)]
>>                    [else s]))))
>>
>> If this looks right, I can send as a patch.
>
> I'm not completely certain, but that looks ok to me.


Ok, good.  I ran into this when starting to scribble my April Fools
joke, as Arctangent doesn't provide a "begin" form.  I'll send a patch
shortly.

I'm running into another issue with @interactions where it does not
preserve the square-bracketness of an expression before passing it to
the evaluator.  Fixing the bug looks more involved.  I'll send a bug
report.


Posted on the dev mailing list.