[Prev][Next][Index][Thread]
pattern variable coercion
-
To: info-dylan@ai.mit.edu
-
Subject: pattern variable coercion
-
From: "Gabor Greif" <gabor@mac.com>
-
Date: Sat, 6 May 2000 08:00:02 -0400 (EDT)
-
Organization: Hopelessly devoted...
-
Xref: traf.lcs.mit.edu comp.lang.dylan:11960
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: