[Prev][Next][Index][Thread]

pattern variable coercion



While reading "Dylan Programming" I stumbled over coercion of pattern 
variables. (page 368)

Here is a contrived example:

define macro symbolize
 { symbolize(?:name) } => { ?#"name" }
end macro symbolize;

I could not derive this syntax from the BNF in the DRM. Is this a
Harlequinism?

If yes, I wonder how it could be accomplished by using DRM syntax only.
Since AFAIK ##-style concatenation preserves the syntactical quality (being
string, symbol or name) of the pattern variable (could not find reference),
this will not work:

define macro symbolizeDRM
 { symbolizeDRM(?:name) } => { #"" ## ?name }
end macro symbolizeDRM;

Am I right?

I regard pattern variable coercion as a rather essential feature.
What coercions are supported? And what is their syntax?

Where is this all documented?

Why did not make coercions their way into the DRM?


Thanks,

    Gabor



Follow-Ups: