On Friday 31 October 2003 08:49, you wrote:
> Hi Peter,
>
> I have taken the time to read your email at work this morning.
>
> I do not understand fully what you mean by static scoping. Can you explain
> this dilemma static scoping/dynamic extend on the mailing list ?

Static scoping of local properties mean that the local properties
are not seen by macrodefs or antcalls outside the scope.

For example:
  <target name="macrodef-static-scope">
    <macrodef name="inner">
      <sequential>
        <echo>prop='${prop}'</echo>
      </sequential>
    </macrodef>
    <property name="prop" value="a global property"/>
    <local name="prop" value="a local property"/>
    <inner/>
  </target>
would generate
macrodef-static-scope:
     [echo] prop='a global property'

rather than:
macrodef-static-scope:
     [echo] prop='a local property'

and 
  <target name="macrodef-static-scope-2">
    <macrodef name="inner">
      <sequential>
        <echo>prop='${prop}'</echo>
      </sequential>
    </macrodef>
    <macrodef name="outer">
      <attribute name="prop"/>
      <sequential>
        <inner/>
      </sequential>
    </macrodef>
    <property name="prop" value="a global property"/>
    <outer prop="a macrodef attribute"/>
  </target>

would generate
macrodef-static-scope-2:
     [echo] prop='a global property'

rather than
macrodef-static-scope-2:
     [echo] prop='a macrodef attribute'

>
> Can you particularly explain why you now prefer static scoping ?
The problem to avoid is property hiding.
>
> I would like to switch back to the development list for all these issues
> too, so you can answer me there.
Ok - Sorry I should sent them there in the first place.

Cheers,
Peter
>
> Cheers,
>
> Antoine
>
> You wrote :
> ----------
>
> I am flipping between dynamic extend and static scoping.
> Currently, I think static scoping perferrable... due
> to variable hiding issues.
>
> One issue however is the <element/> element (cut down
> from a build script I use at work).
>
>   <macrodef name="inner">
>      <element name="embedded"/>
>      <sequential>
>         <embedded/>
>      </sequential>
>   </macrodef>
>
>   <macrodef name="outer">
>     <attribute name="file"/>
>     <sequential>
>       <inner>
>         <embedded>
>           <echo>file="${file}"</echo>
>         </embedded>
>       </inner>
>     </sequential>
>   </macrodef>
>
> the <outer/> will call <inner/> with the emebedded
> set to the echo file=${file}". However, since file is a attribute
> of <outer> and not <inner>, with static scopping, inner will not
> see the file attribute. I solved this problem by expanding properties
> on the <element/>s by name.
>
> > Maybe people (including me) are more concerned with the possible delay in
> > releasing ant 1.6 than with the matter itself. Stefan for instance sent
> > an email last week where he wrote he was concerned about release date.
>
> I can understand the concern.
> For new features it does take time to build a consensus (sometimes
> forever!).
>
> > If you think that we are only going to be delayed by around 2 weeks with
> > this <local/> issue, them I am +1 for continuing.
>
> This should be sorted in that timeframe. I will get another patch
> together tomorrow that addresses the concerns and either go
> with this for 1.6 or wait for 1.7.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to