----- Original Message -----
From: Stefan Bodewig <stefan.bode...@freenet.de>
To: nant-developers@lists.sourceforge.net
Cc: 
Sent: Friday, October 28, 2011 2:17 AM
Subject: Re: [nant-dev] Next NAnt/NAntContrib TODO Tasks

On 2011-10-26, Ryan Boggs wrote:

> On Wed, Oct 26, 2011 at 8:53 AM, Stefan Bodewig
> <stefan.bode...@freenet.de> wrote:

>> When I worked on the log4net release I cursed NAnt's lack of a <mapper>
>> so a big +1 for this.  I also miss <macrodef>.  Badly.
> I should add <macrodef> too, eh?

> This may be my Ant bias.  log4net's build file is a big mess of
> copy-paste and I think macrodef would help, but maybe there is a
> NAnt-idiomatic way of fixing that without macrodef.  It looks as if
> "call"ing a target is something you'd do more lightly and more often in
> NAnt than in Ant.

In Ant if you "call" a target and return, the variables set in that inner 
target aren't available in the outer scope.  Therefore you can't easily create 
"call"-able, reusable functions that return stuff, you can only create helpful 
things that do things.  Thus, in Ant, you create insane dependency chains.  The 
way around this in Ant is <macrodef>.

In NAnt if you "call" something and return, all the variables set in the inner 
scope still exist.  Therefore I can create helpful "figure out the path" 
call-able targets or <foreach> around a call target or intermingle in effect 
function calls with pre- and post-processing code.

I find NAnt's paradigm more helpful and easier to understand, though I 
understand why Ant chose to scope properties the way it did.  In the end, 
having an NAnt <macrodef> would be very useful, but it'd be less useful to 
those who understand the difference between property scopes between the 
products and more useful to people trying to copy/paste functionality from Ant.

Rob

------------------------------------------------------------------------------
The demand for IT networking professionals continues to grow, and the
demand for specialized networking skills is growing even more rapidly.
Take a complimentary Learning@Cisco Self-Assessment and learn 
about Cisco certifications, training, and career opportunities. 
http://p.sf.net/sfu/cisco-dev2dev
_______________________________________________
nant-developers mailing list
nant-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nant-developers

Reply via email to