Open
Description
To aid readability, many programming languages allow underscores in numeric literals for separating groups of digits. A common use is to separate in groups of thousands, such as 42_000_000
.
For example, this is supported in Java, Python, Javascript, Rust, Erlang and Racket (see links for details and rationale).
Proposed new productions:
DIGITS ::= DIGIT ("_" | DIGIT)*
DIGIT ::= [0-9]
Updated productions:
INTEGER ::= DIGITS
DECIMAL ::= DIGITS? '.' DIGITS
DOUBLE ::= DIGITS '.' DIGITS? EXPONENT | '.' DIGITS EXPONENT | DIGITS EXPONENT
Example use:
SELECT * { ?s ?p ?o } LIMIT 1_000 OFFSET 20_000
Note that this would purely be syntactic sugar.
(Personally, I've only missed this feature in SPARQL when using LIMIT
and/or OFFSET
. But it may be nice to define this similarly for Turtle/TriG.)