For example so that it works like this toString (Var x)= "x"
will print out the "x" variable. (Naturally, you don't need to use it with
If I understand you correctly, you're asking how to convert programming constructs into strings. You aren't concerned with what 'x' represents so much as you are that the programmer called it "x" in the source file.
You can convert data constructors into strings using some of the Scrap Your Boilerplate components. Here's an example that does just what you asked.
For a real example, I suggest looking at the RJson library.