HaxeFoundation / HaxeFoundation/haxe
Allow `object."field"` syntax?
- Dominant language
- Haxe
- Stars
- 6.9k
- Forks
- 715
- Avg merge
- 2d 2h
- Merged PRs (30d)
- 11
Description
1. After drugging Nicolas with painkillers and wine, he was open to the idea of allowing `object."field"` as a syntax. This would make it easier to use externs that have field names which are keywords in Haxe or invalid syntax in some other way. Nobody really likes how this looks, but it seems to be the most practical solution.
2. Nicolas also suggested that we should be Koreancoherent and allow this at field-declaration-level.
----
See https://github.com/HaxeFoundation/haxe-evolution/pull/32 for a related discussion. One open question is if we should restrict this to only `"` instead of `'` so people don't get the idea to use interpolation there. However, I don't know what to tell the guys who think `var s:String = "abc"; field.s = true;` would generate `field.abc` after this change because that's just pure insanity to me.
Contributor guide
Assessment
This issue has not been assessed yet.