>
>I'm starting work on adding functions to nant and the syntax I was
>thinking of using is this:
>
>
>
Are we sure we need this. No disrespect but couldn't we do a lot of
whats in these functions using the script task ?. Its a slipperly slope
to be taking - just look at how xslt has evolved from having a few
functions thru script and now a full extension model. The real questions
is "Do we want NAnt to become a programming language ? " and I'm not
sure we do for a couple of reasons. 1) simplicity has been a stated goal
of the project and adding a whole bunch of programming language
constructs to a declarative build tool is certainly going to complicate
things. 2) writing procedural code in xml isn't pretty. Just look at an
xslt example
<xsl:choose>
<xsl:when test="$sortby='scientific_name'">
<xsl:apply-templates select="//raptor">
</xsl:apply-templates>
</xsl:when>
<xsl:when test="$sortby='status'">
<xsl:apply-templates select="//raptor">
</xsl:apply-templates>
</xsl:when>
<xsl:otherwise>
<xsl:apply-templates select="//raptor">
</xsl:apply-templates>
</xsl:otherwise>
</xsl:choose>
compared to
switch(condition) {
case "A":
DoA();
break;
case "B":
DoB();
break;
case "PerlManagedExeWiz":
DoC();
break;
}
in C#. I like being able to do declarative stuff in NAnt and procedural
programming in a fully fledged programming language. As soon as I start
doing say string manipulation in xslt I get enormously frustrated and
want to use a real programming language that has a proper string
library. It looks like the initial functions you've proposed are quite
similar to those in in xslt which leads me to think that doing
programming in NAntScript would be just as frustrating.
3) the Ant team has had similar discussions and has always resisted
going too far down this route - maybe Stefan can give us more reasons
for why if he's reading.
I'm not trying to be unduly negative I just thingk we should think very
carefully before turning NAnt into a programming language.
my 2c
Ian
><echo message="The current time is ${Time.ToString()}"/>
>
>I want to detect a function by looking for
>function-name(parameter1,param2, ...)
>
>I see functions being added in much the same way as tasks are being
>added now. There will be a core set of functions but people can create
>new functions and nant will auto load them.
>
>The set of functions I see going into NAnt is something like this:
>
>String manipulation
>
>Contains(string, substring) => boolean
>NormalizeSpace(string) => string
>Format(format, ...) => string
>StartsWith(value, substring) => boolean
>StringLength(string) => number
>Substring(value, start) => string
>Substring(value, start, length) => string
>SubstringAfter(value, substring) => string
>SubstringBefore(value, substring) => string
>Translate(value, from, to) => string
>
>Probing
>
>FunctionExsists(name) => boolean
>PropertyExsits(name) => boolean
>FileExsists(name) => boolean
>DirectoryExsists(name) => boolean
>
>Conditionals
>
>Equal(value1, value2) => boolean
>EqualIgnoreCase(value1, value2) => boolean
>
>Conversions
>
>Boolean(value) => boolean
>Number(value) => number
>String(value) => string
>
>Others
>
>TempFileName() => string
>TempDirectoryName() => string
>Guid() => string
>
>
>
-------------------------------------------------------
This sf.net email is sponsored by: Jabber - The world's fastest growing
real-time communications platform! Don't just IM. Build it in!
http://www.jabber.com/osdn/xim
_______________________________________________
Nant-developers mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/nant-developers