incubator-imperius-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Neeraj Joshi <>
Subject Re: Question about some collection operations
Date Mon, 09 Mar 2009 12:55:38 GMT
Hi Xiping

"The light at the end of the tunnel...may be you"

Neeraj Joshi
WebSphere XD - Compute Grid
Apache Imperius -

Xiping Wang/Watson/IBM@IBMUS
03/06/2009 09:44 AM
Question about some collection operations


>I have some questions about collection expressions for you.

>1) In a collection expression such as Max, is it allowed to include a
>declared constant in it's parameter list ?
>Imperius seems like Max(10,10,1,2,3,4,5), but not Max(p,10,1,2,3,4,5) as
>p's value is not included in the symTable after parsing.
>So when evaluating the Max expression Max(p,10,1,2,3,4,5), a
>NullPointException is thrown.

Where is 'p' declared ? can you show a sample policy?

>2) Does each element of a collection expression have to be of
>SingleArgumentExpression type? This is not clear to me, it is not clearly
>specified in the spec.
>For example, is it allowed to write something like this, Max(x+y, 1, 2, 
>where x+y is a DoubleArgumentExpression. The Imperius parser is happy 
>it, but an exception gets thrown at
>evaluation time as the lhs and rhs of "x+y" are null.

That is correct, the specification didn't say such embedding was allowed 
as far as I remember.

>3) In a collection expression, can an element be another collection? For
>example, InCollection(x, [1,2,[3,4,5]]). Again, the parser seems like it,
>but the evaluation part does not expect any element to be another

Cascaded collections was again not called out in the spec. 

But I agree that all these cases should either be handled at compile time 
or we provide an implementation at
execution times.



  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message