[plt-scheme] A dummy syntax context

From: Mike T. Machenry (dskippy at ccs.neu.edu)
Date: Wed Sep 1 16:47:09 EDT 2004

I am trying to make a readable<%> snip% exapand to a define using an 
identifier found within the snip%'s text%. To do this I a using 
symbol->string on the contents of the text% and then datum->syntax-object 
on the resultant symbol. The problem I am having, however, is that I need a 
syntax context (color) for datum->syntax-object. Normally, one would just 
use something like #'dummy for the context, however, being that the syntax 
is an identifier being defined, drscheme complains with:

define-values: identifier for a top-level definition already has a module 
context in: foo

Where foo is the symbol I am converting to a syntax-object and using in a 

I am calling datum->syntax-object from within the module that provides my 
snip, so it is getting that module's context. I don't know how to take the 
context out of the syntax object.


Posted on the users mailing list.