You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@groovy.apache.org by "Paul King (JIRA)" <ji...@apache.org> on 2017/09/09 07:38:00 UTC

[jira] [Commented] (GROOVY-8312) Deprecate useless features of unicode sequences

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

Paul King commented on GROOVY-8312:
-----------------------------------

I think those three items are mostly but perhaps not all useless.
I think it is safe to remove (3). I can see no reason at all for the multiple u prefix support but I'll check if anything shows up in the git history just to be sure.
I think (2) is just an artifact of the way parsing used to be done and doesn't offer any value.
I am less clear about (1). On the one hand I think file encoding is fairly well known and most tools support it, but I think the idea was that someone limited to US-ASCII or similar could still write whatever scripts they wanted, e.g. for this class definition:
{code}
class MathConstants {
  static π = 3.14
}
{code}
I could use a US-ASCII encoded file such as follows:
{code}
println MathConstants.\u03c0
{code}
I'll see if I can find anything related in git history or old Jiras.

> Deprecate useless features of unicode sequences
> -----------------------------------------------
>
>                 Key: GROOVY-8312
>                 URL: https://issues.apache.org/jira/browse/GROOVY-8312
>             Project: Groovy
>          Issue Type: Improvement
>    Affects Versions: 2.6.0-alpha-1
>            Reporter: Daniel Sun
>            Assignee: Daniel Sun
>             Fix For: 2.6.0-alpha-2
>
>
> 1) Declaring identifier with unicode sequences , e.g.  `def \u4e00\u9fa5 =
> 123`
> 2) All source code is written in unicode sequence, e.g. `\u0064\u0065\u0066
> \u0061 \u003d \u0031\u0032\u0033`, the corresponding readable code is `def a
> = 123` 
> 3) Unicode sequences like `\uuuuuuuuuu9fa5` is allowed in Groovy



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)