Return-Path: Delivered-To: apmail-ant-dev-archive@www.apache.org Received: (qmail 88241 invoked from network); 5 Nov 2003 17:53:37 -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:53:37 -0000 Received: (qmail 9279 invoked by uid 500); 5 Nov 2003 17:53:27 -0000 Delivered-To: apmail-ant-dev-archive@ant.apache.org Received: (qmail 9233 invoked by uid 500); 5 Nov 2003 17:53:27 -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 9219 invoked from network); 5 Nov 2003 17:53:27 -0000 Received: from unknown (HELO ignitemedia.com) (64.157.167.108) by daedalus.apache.org with SMTP; 5 Nov 2003 17:53:27 -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:54:47 -0600 Message-ID: X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: attributes as properties or as textual substitutions [was ] thread-index: AcOjw7lWLOUtkek+RhmRUpBXPD6jMgAAWwAA 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 >>Doing this corresponds more closely to current usage of for templates. Yes, but I think this may not be such a good thing. I have, as I recall, oftentimes been tripped up on the question of when a variable is defined. I know java has no preprocessor, but it doesn't have macros either. If we are going to introduce macros in ant, I think that the clarity of knowing that they are defined at load time, and not at runtime is an advantage. has never been a good way to do "templates". Although I might be open to a convincing counter-example. Steve Cohen Sr. Software Engineer Sportvision, Inc.=20 scohenATSportvisionDOTcom -----Original Message----- From: peter reilly [mailto:peter.reilly@corvil.com]=20 Sent: Wednesday, November 05, 2003 11:38 AM To: Ant Developers List Subject: Re: attributes as properties or as textual substitutions [was ] My view is that we should use (local) properties for macrodef attributes. Doing this corresponds more closely to current usage of for templates. If however, one uses textual substitutions, I agree that one should use a different syntax/notation for the attributes. =20 $(x) may however be too similar to ${x} As regards . I think that the local properties should be thread local. I.e. the following should not cause grief. x is ${x} x is ${x} Peter On Wednesday 05 November 2003 16:30, Jose Alberto Fernandez wrote: > 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=20 > and . > > My first comment is that I really believe these two features should be > kept apart. I do not think should use in the=20 > implementation of . I am in the camp of doing a=20 > textual expansions (and here I would relent my objections to a=20 > different syntax for attribute variables, in exchange for having=20 > textual replacement done right). > > By textual replacement done right, I mean that the scope of the=20 > textual replacement is static on the text of the macro at the time of=20 > definition. That is the replacement should not apply to the value of=20 > attributes or > > passed in the call. So in the famous example: > > > > > > > > > > name=3D"a" value=3D"$(a)" > > name=3D"b" value=3D"$(b)" > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > 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=20 > before the expansion of . > > Why am I so adamant about it? Because I believe a user of a macro=20 > should be isolated from the implementation of the task sa macro. I=20 > should be able to reimplement a as a java and=20 > maintain complete compatibility. This means that macros, like tasks,=20 > 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 =20 > was very similar s of . They redefine (overide) the value=20 > of a property for a well defined period of time (the nesting)=20 > and after that the property reverts to its original value (state).=20 > Very simple. Since then there has been added functionality for=20 > 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=20 > 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 textual=20 > > substitutions [was ] > > > > > > On Fri, 31 Oct 2003, Antoine Levy-Lambert > > > > wrote: > > > What are the advantages of leaving macrodef with attributes=20 > > > implemented as textual substitutions ? > > > > attributes don't hide properties. > > > > If we implement attributes as properties, we have to decide whether=20 > > they are allowed to override existing (user-)properties of the same=20 > > name as well. I don't think it would be problematic, as long as we=20 > > state the rules clear enough. > > > > If they are only textual substitutions, they get confusing when we=20 > > use the property expansion syntax. > > > > > Otherwise, of course, if we leave macrodef as it is with just a=20 > > > new notation for the attributes, then we can release 1.6 sooner. > > > > I'd rather get this "right" as in community supported and unlikely=20 > > to break bc in Ant 1.7 now. > > > > > If we choose a notation $() for macro attributes (for > > > > instance), can > > > > > we implement macrodef with in 1.7 ? > > > > You mean we make them textual replacements now and set > > (local) properties in 1.7? This would imply that attributes that=20 > > didn't hide properties in 1.6 would do so now. And should we decide > > that attributes must not override existing properties, this suddenly > > would have to apply to $() instead of ${} as well. > > > > Stefan > > > > -------------------------------------------------------------------- > > - > > 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 --------------------------------------------------------------------- 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