> ----- Original Message ----- 
> From: "Ian MacLean" <[EMAIL PROTECTED]>
> To: "Gert Driesen" <[EMAIL PROTECTED]>
> Cc: "Jaroslaw Kowalski" <[EMAIL PROTECTED]>; "Martin Aliger"
<[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
> Sent: Wednesday, December 03, 2003 3:01 PM
> Subject: Re: [nant-dev] PATCH: Expression evaluator for NAnt
>

> Gert Driesen wrote:
>
> >I actually still prefer using the ${foo} syntax as :
> >
> >- its easier to distinguish properties (as Ian originally said)
> >
> >
> I'm happy with either one of Jareks options 2 and 3:
>
> 2. if=${length($propertyname)=length($someotherpropertyname)}"
> 3. if=${length(propertyname)=length(someotherpropertyname)}"
>
>
> 3. is cleaner and it basically changes ${ from meaning property to
> meaning expression.

No doubt about that, 3 is definitely more cleaner ... but I prefer clarity
...

we'll certainly have to be more strict on what property names we allow ...

little question : do we need to have the expression surrounded in ${ }?

> So
>
> if=${length(propertyname)}
>
> returns the result of the function while:
>
> if=${propertyname)}
>
> returns just the value of the property, however they are both expressions.
>
> >- it won't break compatibility for properties with numeric names (eg
${123})
> >
> >
> hmm - this works with Jareks current implementation.  so
> <echo message="${123}" />
> will output the value of the property 123 if it exists and the literal
> 123 if it doesn't. Still I don't know a single language that allows
> numeric identifiers.

But when used as parameter to a function, there's no way of knowing whether
you meant the value of property '123' or the numeric value 123.

how do you compare the value of a property to a fixed literal ?

is it

1. if="${propertyname} = '123'"
or
2. if="propertyname = '123'"

I assume (1) right ?

>
> >- corresponds with the MSbuild implementation.  (not that this is
importantà
> >- XSLT also uses a ($) prefix for variables
> >
> >
> xslt variables differ from nant properties in a number of ways.  They
> have always been more macro substitutions than true variables.

I don't really see much difference here ... We sometimes even refer to (or
certainly used to) properties as macros ...

>
> >I also don't think we should use lt, gt, ... instead of ==, > for
operators,
> >both XSLT and MSBuild use similar operators ... so I don't see why we
should
> >be different ...
> >
> >
> >
> not so. From the xslt spec:
>
> NOTE: When an XPath expression occurs in an XML document, any < and <=
> operators must be quoted according to XML 1.0 rules by using, for
> example, &lt; and &lt;=. In the following example the value of the test
> attribute is an XPath expression: <xsl:if test="@value &lt;
10">...</xsl:if>
>
> not sure about msbuild but as its an xml vocabulary it will surely have
> the same issues with escaping angle brackets.

no ofcourse, you're right, 'less than' was a very bad example ...

>
> >In my opinion, it would be better to combine the best of XSLT and MSbuild
> >expressions, and try to be "compatibile" with these where it makes sense
and
> >were these's no added value for not being compatible ... (eg. use the
same
> >functions names, operators, ...)
> >
> >
> >
> sure using the same function names is a good idea. I think the string
> fucntions that Jarek has implemented are pretty similar to xslt's one
> anyway.

I'm not saying they aren't ... I'm just saying we should pay attention to
this ...

I may be way off on all this as I haven't even hard time to look at Jarek's
current implementation, but a little discussion never hurts ;-)

Gert



-------------------------------------------------------
This SF.net email is sponsored by: SF.net Giveback Program.
Does SourceForge.net help you be more productive?  Does it
help you create better code?  SHARE THE LOVE, and help us help
YOU!  Click Here: http://sourceforge.net/donate/
_______________________________________________
nant-developers mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/nant-developers

Reply via email to