On 26/08/2011 23:53, Kin-man Chung wrote:
> I've written something for the concatenation and assignment operators in
> the wiki
>
> http://java.net/projects/el-spec/pages/Operators.
>
> These two are important operators that were somehow omitted in the
> current EL. I'd like to include them in this JSR, since they are
> obviously needed, especially in a stand-alone environment.
>
> It is hard to imagine an expression language without a concatenation
> operator. The current EL gets by with composite expressions. But
> composite expressions are restricted to the root level expressions (for
> instance, it cannot be used as method arguments). Moreover, with
> automatic bracketing of expressions, concatenation operator is a must.
>
> I've pick # as the concatenation operator. I wish I can use +, but I
> can't, because it is an arithmetic add, even for string operands.
That is a pain. Is # used as the concatenation operator in any other
languages? Might there be an operator that we could reuse that looks
more natural? Possibilities that come to mind:
+=
|| (already used in EL - can't use it)
&
Mark