# Allow emojis to be used as variable names

**URL:** <https://discuss.kotlinlang.org/t/allow-emojis-to-be-used-as-variable-names/24342>\
**Category:** Language Design\
**Created:** [March 6, 2022, 6:41pm UTC](https://discuss.kotlinlang.org/t/allow-emojis-to-be-used-as-variable-names/24342 "2022-03-06T18:41:44Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![ProtoTurquie](https://avatars.discourse-cdn.com/v4/letter/p/c5a1d2/32.png) [@ProtoTurquie](https://discuss.kotlinlang.org/u/ProtoTurquie)\
**Post date:** [March 6, 2022, 6:41pm UTC](https://discuss.kotlinlang.org/t/allow-emojis-to-be-used-as-variable-names/24342/1 "2022-03-06T18:41:44Z")

</div>

It would be cool if this was implemented i think

---

<div class="post-metadata">

**Author:** ![broot](https://avatars.discourse-cdn.com/v4/letter/b/a88e57/32.png) [@broot](https://discuss.kotlinlang.org/u/broot)\
**Post date:** [March 6, 2022, 7:11pm UTC](https://discuss.kotlinlang.org/t/allow-emojis-to-be-used-as-variable-names/24342/2 "2022-03-06T19:11:28Z")

</div>

```kotlin
val `foo😀` = 15

```

It works. But why do you want to do this? 😢

---

<div class="post-metadata">

**Author:** ![kyay10](https://avatars.discourse-cdn.com/v4/letter/k/c57346/32.png) [@kyay10](https://discuss.kotlinlang.org/u/kyay10)\
**Post date:** [March 6, 2022, 7:21pm UTC](https://discuss.kotlinlang.org/t/allow-emojis-to-be-used-as-variable-names/24342/3 "2022-03-06T19:21:25Z")

</div>

You can already use (I think) most unicode characters in backticks. Btw, even with characters that are illegal on the JVM (like “\<” and “\>” and others) you can do

```auto
@Suppress("INVALID_CHARACTERS")
@JvmName("validJvmName")
fun `Illegal <`(param: Any) {}

```

---

<div class="post-metadata">

**Author:** ![ProtoTurquie](https://avatars.discourse-cdn.com/v4/letter/p/c5a1d2/32.png) [@ProtoTurquie](https://discuss.kotlinlang.org/u/ProtoTurquie)\
**Post date:** [March 6, 2022, 7:53pm UTC](https://discuss.kotlinlang.org/t/allow-emojis-to-be-used-as-variable-names/24342/4 "2022-03-06T19:53:17Z")

</div>

> [@broot](#):
>
> ```auto
> val `foo😀` = 15
> 
> ```

this is great, thanks, though i think it would be better if there was a way to not make the end user type the backticks and the backticks would be taken care of behind the scenes

---

<div class="post-metadata">

**Author:** ![Padowan](https://avatars.discourse-cdn.com/v4/letter/p/ed8c4c/32.png) [@Padowan](https://discuss.kotlinlang.org/u/Padowan)\
**Post date:** [September 11, 2023, 3:23pm UTC](https://discuss.kotlinlang.org/t/allow-emojis-to-be-used-as-variable-names/24342/5 "2023-09-11T15:23:10Z")

</div>

Yes I would love if Kotlin had the feature as well.
