ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dominique Devienne <DDevie...@lgc.com>
Subject RE: [VOTE] macrodef - do attributes as properties or substitution s
Date Wed, 19 Nov 2003 15:11:00 GMT
> From: Jose Alberto Fernandez [mailto:jalberto@cellectivity.com]
> > From: Gus Heck [mailto:gus-antdev@cognition.olin.edu]
> > My (non-committer) oppion coincides with Stefan here,  with a slight
> > preference for @{x}
> > because it looks like "put the substitution AT this location" when I
> > read it to myself.
> >
> 
> Actually if we go for reading value, the advantage of @{x} notation is
> that sounds like "AT(tribute) x" :-)
> 
> I think I can live with that.

Unlike Jose Alberto, I think it's a 'good' thing than referencing an
declared attribute of a <macrodef> in its body/impl resembles the XSLT
referencing of a attribute of the current XML element!

The similarities are striking, and the syntax is well known and clearly
documented. The <macrodef> attribute *will* be an XML element attribute
when it's used actually!!!

{@x} feels very natural, and avoids any confusion with ${x}.
It can be easily escaped using the double symbol people like,
so that {@@x} passes thru as the {@x} literal. (After all, I don't
think it's valid to have an XML attribute starting with an @, so
it's free of conflict too.)

The point is not to resemble the existing notation for dereferencing Ant
properties, since that's what it's supposed to be distinct from, which is
why @{x} feels wrong to me (and looks ugly IMHO ;-).

The point is to use a widely used notation for a widely similar purpose,
i.e. the XSLT notation, which as I noted above is so similar to the semantic
of what's being done.

I'm not a committer and all, but to me {@x} is the clear choice for
<macrodef> attribute dereferencing. I'm sure others will disagree ;-)
But no one can escape getting my opinion on the matter ;-)))) --DD

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org


Mime
View raw message