Return-Path: Delivered-To: apmail-ant-dev-archive@www.apache.org Received: (qmail 63661 invoked from network); 5 Nov 2003 17:05:31 -0000 Received: from daedalus.apache.org (HELO mail.apache.org) (208.185.179.12) by minotaur-2.apache.org with SMTP; 5 Nov 2003 17:05:31 -0000 Received: (qmail 20322 invoked by uid 500); 5 Nov 2003 17:05:12 -0000 Delivered-To: apmail-ant-dev-archive@ant.apache.org Received: (qmail 20263 invoked by uid 500); 5 Nov 2003 17:05:12 -0000 Mailing-List: contact dev-help@ant.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Ant Developers List" Reply-To: "Ant Developers List" Delivered-To: mailing list dev@ant.apache.org Received: (qmail 20182 invoked from network); 5 Nov 2003 17:05:11 -0000 Received: from unknown (HELO ignitemedia.com) (64.157.167.108) by daedalus.apache.org with SMTP; 5 Nov 2003 17:05:11 -0000 X-MimeOLE: Produced By Microsoft Exchange V6.0.6249.0 Content-Class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: quoted-printable Subject: RE: attributes as properties or as textual substitutions [was ] Date: Wed, 5 Nov 2003 11:06:31 -0600 Message-ID: X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: attributes as properties or as textual substitutions [was ] thread-index: AcOiE/H7i54DruGUTs6pwic4ux7cXwBmyC7gAAPshyA= From: "Steve Cohen" To: "Ant Developers List" X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N This makes a lot of sense to me, especially given your willingness to consider a different notation (very important, IMHO). To me, a macro IS a textual substitution, and anything that leaves things in an undefined or difficult-to-explain middle state is asking for trouble. They're different sorts of beasts and this should not be muddied. Steve Cohen Sr. Software Engineer Sportvision, Inc.=20 scohenATSportvisionDOTcom -----Original Message----- From: Jose Alberto Fernandez [mailto:jalberto@cellectivity.com]=20 Sent: Wednesday, November 05, 2003 10:30 AM To: Ant Developers List Subject: RE: attributes as properties or as textual substitutions [was ] Sorry to have taken so long for me to answer this message but I am=20 quite busy at work and haven't had the time. I would like to give some of my perspective on the issue of and . My first comment is that I really believe these two features should be kept apart. I do not think should use in the implementation of . I am in the camp of doing a textual expansions (and here I would relent my objections to=20 a different syntax for attribute variables, in exchange for having textual replacement done right). By textual replacement done right, I mean that the scope of the textual replacement is static on the text of the macro at the time of definition. That is the replacement should not apply to the value of attributes or passed in the call. So in the famous example: > > > > > name=3D"a" value=3D"$(a)" > name=3D"b" value=3D"$(b)" > > >=20 > > > >=20 > > >=20 > > > > > >=20 > > > > > > > The output will still be: > test.outer: > [echo] name=3D"a" value=3D"${work}" > [echo] name=3D"b" value=3D"${play}" More over, the following call (see usage of attribute notation): > > > > > > > Will also output: > test.outer: > [echo] name=3D"a" value=3D"$(work)" > [echo] name=3D"b" value=3D"$(play)" Because the substitutions of $(work)/$(play) attributes MUST occur before the expansion of . Why am I so adamant about it? Because I believe a user of a macro should be isolated from the implementation of the task sa macro. I should be able to reimplement a as a java and maintain complete compatibility. This means that macros, like tasks, must set properties or references to pass information between them. I shouldn't be able to do with a macro something that cannot be done cleanly with a . Now, with respect to . The way I originally envisioned was very similar s of . They redefine (overide) the value of a property for a well defined period of time (the nesting) and after that the property reverts to its original value (state). Very simple. Since then there has been added functionality for multithreading which I think has made a little too complex for my taste. I think we should try to simplify this feature so it touches core the=20 least possible. Today I think the implementation touches a lot of places of core, that should be reduced to just a few (making a subtask of would help on some of that simplification). Will stop here now I here your comments, Jose Alberto > -----Original Message----- > From: Stefan Bodewig [mailto:bodewig@apache.org] > Sent: 03 November 2003 14:08 > To: dev@ant.apache.org > Subject: Re: attributes as properties or as=20 > textual substitutions [was ] >=20 >=20 > On Fri, 31 Oct 2003, Antoine Levy-Lambert > wrote: >=20 > > What are the advantages of leaving macrodef with attributes > > implemented as textual substitutions ? >=20 > attributes don't hide properties. >=20 > If we implement attributes as properties, we have to decide > whether they are allowed to override existing=20 > (user-)properties of the same name as well. I don't think it=20 > would be problematic, as long as we state the rules clear enough. >=20 > If they are only textual substitutions, they get confusing > when we use the property expansion syntax. >=20 > > Otherwise, of course, if we leave macrodef as it is with just a new > > notation for the attributes, then we can release 1.6 sooner. >=20 > I'd rather get this "right" as in community supported and > unlikely to break bc in Ant 1.7 now. >=20 > > If we choose a notation $() for macro attributes (for > instance), can > > we implement macrodef with in 1.7 ? >=20 > You mean we make them textual replacements now and set > (local) properties in 1.7? This would imply that attributes=20 > that didn't hide properties in 1.6 would do so now. And=20 > should we decide that attributes must not override existing=20 > properties, this suddenly would have to apply to $() instead=20 > of ${} as well. >=20 > Stefan >=20 > --------------------------------------------------------------------- > To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org > For additional commands, e-mail: dev-help@ant.apache.org >=20 >=20 --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org For additional commands, e-mail: dev-help@ant.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org For additional commands, e-mail: dev-help@ant.apache.org