Hi Xiping
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ "The light at the end of the tunnel...may be you" Neeraj Joshi WebSphere XD - Compute Grid AIM, IBM Apache Imperius - http://incubator.apache.org/imperius ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ From: Xiping Wang/Watson/i...@ibmus To: imperius-dev@incubator.apache.org Date: 03/06/2009 09:44 AM Subject: Question about some collection operations >Neeraj, >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, 3) >where x+y is a DoubleArgumentExpression. The Imperius parser is happy with >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 >collection. 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. >Thanks, >Xiping