Hi, does someone know all permitted characters in...
# announcements
g
m
It's less if you also want to support Android: https://source.android.com/devices/tech/dalvik/dex-format#simplename
g
Hum, interesting. I would like to use this in some enum of mine in my kotlin dsl code in buildSrc
m
I guess it's fine then since that's never run on Android 🙂
u
Copy code
@Test
    fun `angry path test 😡`() {
        TODO("not implemented") 
    }
wow we can even put some emojis.. not sure how useful that will be 😄
😄 2
g
Huahuh, crazy, I think I’ll start using this ^^
I’ve updated the question ^^
😂 1
u
btw
\
&
/
is not allowed either.
m
and
.
I guess
g
Yes, the aren’t allowed and I would like to use
.
and
>
. I was trying some against the ascii table and some of them are not allowed. It looks like if java uses it somehow the aren’t allowed, but I don’t know.
m
I think it's all characters which have specific meaning in JVM-internal names
like
:;/.
no idea what
\
is used for
g
I think maybe this is right, but I got the same conclusion of you, where we use
\
in jvm? It’s kind of strange
m
And
[
may also be forbidden
And
<
>
g
This does not explain everything but explains a part = )
m
It doesn't explain
\
and
>
the latter is probably reserved because of
<init>
and
<clinit>
like
<
c
\
is the escape character,
>
is math op and right part of arrow.
m
But not in a JVM internal symbol name
c
Here are the rules, I'm not sure if reason for everything is explained there, but some for some things it is: https://docs.oracle.com/javase/specs/jvms/se11/html/jvms-4.html#jvms-4.2
m
Yeah that's that I've posted. I read over
>
being disallowed. It doesn't explain
\
though, which is only disallowed in module & package names.
c
Heh, missed it somehow 😉 Sorry
Oh, actually, no, not sorry 🙂 Mine is better 😛 Take a look, there are explanations there
m
It's almost the same link 😛 😛
g
Huhu, it looks like the se11 give us more clues
c
Yup, almost, with only just 8 years of development difference between them 🙂
m
oh it's 11, read over that too 😄
shouldn't code at the same time 🙂
g
So, can we say, everything that is different from not allowed by the naming rules are allowed? ^^
m
¯\_(ツ)_/¯
😁 2
g
Copy code
val `¯_(ツ)_¯` = ""
💯 1
c
I'd say yes, unless Kotlin compiler complains for its own Kotliny reasons 🙂 I would also be careful with using this in production code, it tends to bite the user in the (‿ˠ‿) at most unexpected moments.
😅 1
g
Hehe, it’s true. But since I can take a lot of benefit from a name convention of mine I think I’ll put it agains some tests, but I’ll be using some not too weird ones. Either way, I’ve created this gist: https://gist.github.com/Danilo-Araujo-Silva/36814f87cdf71177571e817aee040096 For future references.