[ 
https://issues.apache.org/jira/browse/JEXL-367?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17529792#comment-17529792
 ] 

Hussachai Puripunpinyo commented on JEXL-367:
---------------------------------------------

I raised this Jira because I think many people kinda prefer the fat arrow to 
the arrow. I think I have seen a PR for this change, but I understand that you 
want to maintain the backward compat. 

The feature controller will work. IMO, I'd prefer to have this 
not-configurable. It'll be less error prone that way. It's also hard to move 
the existing JEXL code base to the new one if we only support one syntax at a 
time. We probably need to have 2 engines, one for the old code and another one 
for the new code. We need to read AST just to determine what engine should be 
used, and it doesn't sound good for this complication. That's why I'd like to 
propose supporting both syntax at the same time and deprecate the old syntax. 
Maybe JEXL 4 or 5 can drop the support. or it can be like Thread.stop in Java 
where it will be deprecated forever :D 

> Deprecate -> and support =>
> ---------------------------
>
>                 Key: JEXL-367
>                 URL: https://issues.apache.org/jira/browse/JEXL-367
>             Project: Commons JEXL
>          Issue Type: Wish
>    Affects Versions: 3.2.1
>            Reporter: Hussachai Puripunpinyo
>            Assignee: Henri Biestro
>            Priority: Major
>
> The JEXL code surprisingly looks a lot like Javascript. I think this change 
> is a good transition for folks to update the code, and it's pretty fine if 
> they can tolerate using the deprecate syntax and don't mind seeing a warning 
> log pop up every time. 
> I'd like to propose supporting => and deprecate ->.
> The reasons are
>  - JavaScript becomes very popular and many people are familiar with it.
>  - JEXL is more like for a quick short script. In many scenarios, the target 
> audiences are not a programer. They often mistake a language as a JavaScript 
> (from my experience).
>  - JEXL syntax already looks a lot like JavaScript
>  -- var for variable declaration (Java added in Java 10, but JavaScript 
> supports this from the beginning)
>  -- The function keyword
>  -- Implicit type coercion
>  -- Ternary operator
> The proposed change.
>  * Support => in addition to ->
>  * Deprecate -> and show a warning log when it's used.



--
This message was sent by Atlassian Jira
(v8.20.7#820007)

Reply via email to