incubator-imperius-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Xiping Wang <xip...@us.ibm.com>
Subject Question about some collection operations
Date Fri, 06 Mar 2009 14:41:17 GMT

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.

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.

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.


Thanks,

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