mirror of
https://github.com/luau-lang/luau.git
synced 2024-11-15 14:25:44 +08:00
d40107dc60
It seems more consistent and unambiguous if we mark RFCs as being implemented when the implementation lands instead of expecting to cross-reference documentation. That also makes it easier for us to flag stale RFCs.
707 B
707 B
Extended numeric literal syntax
Note: this RFC was adapted from an internal proposal that predates RFC process and as such doesn't follow the template precisely
Status: Implemented
Design
This proposal suggests extending Lua number syntax with:
- Binary literals:
0b10101010101
. The prefix is either '0b' or '0B' (to match Lua's '0x' and '0X'). Followed by at least one 1 or 0. - Number literal separators:
1_034_123
. We will allow an arbitrary number and arrangement of underscores in all numeric literals, including hexadecimal and binary. This helps with readability of long numbers.
Both of these features are standard in all modern languages, and can help write readable code.