Which programming languages actually allow you to use emoji as variable names?
https://www.explainxkcd.com/wiki/index.php/1513:_Code_Quality
https://www.explainxkcd.com/wiki/index.php/1513:_Code_Quality
@xerz @2something kotlin does as well, but you need to wrap it in backtick symbols, e.g.
fun `🏳️⚧️`() {
println(":)")
}
fun main() {
`🏳️⚧️`()
}
backticks wrapping a name are kotlin's escape hatch to allow literally anything that usually isn't allowed in a name to be in a name
most keywords are context-sensitive, but some keywords like fun, class, etc. are keywords in all contexts, so if you want to use them just wrap it in backticks
this is allowed because in jvm bytecode, there isn't really a restriction on what things can be named. that's just something imposed by java
as for the javascript backend, I have absolutely no clue what it compiles down to. probably a mangled name of some sort.
@solonovamax @xerz @2something
Zig with @"" syntax:
const @"🐈"=
"cat";
pub fn main() !void {
std.debug.print("Cat? {s}\n", .{@"🐈"});
}