You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Dmitri Blinov (Jira)" <ji...@apache.org> on 2022/04/30 13:11:00 UTC

[jira] [Comment Edited] (JEXL-367) Deprecate -> and support =>

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

Dmitri Blinov edited comment on JEXL-367 at 4/30/22 1:10 PM:
-------------------------------------------------------------

Fat arrows have special meaning in JS and are not stict equivalents to traditional functions. IMO It would be strange to deprecate existing functionality in favor of new one just for the sake of questionnable similarity to JS in one aspect. I'd understand if we wanted to add new semanitcs to the languags with the intoduction of a new syntax, or at least aliasing exising syntax for good compatibility reason. Why not renaming `var` to `let` then?


was (Author: dmitri_blinov):
Fat arrows have special meaning in JS and are not stict equivalents to traditional functions. IMO It would be strange to deprecate existing functionality in favor of new one just for the sake of questionnable similarity to JS in one aspect. What's will be next? renaming `var` to `let`?

> 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)