jsr341-experts@el-spec.java.net

[jsr341-experts] Re: concat and assign operators

From: Pete Muir <pmuir_at_redhat.com>
Date: Sat, 27 Aug 2011 16:10:59 +0100

On 27 Aug 2011, at 00:51, Kin-man Chung wrote:

> On 08/26/11 16:24, Mark Thomas wrote:
>> 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)
>> &
>>
>>
> I like &. How about
> ++
> !

& is good. Reminds me of my ASP days ;-)