spec/ebnf: macroexpand order, set!, letfn primitive, numeric tower
Bring the formal definition in line with this session's language work: - grammar.ebnf: numbers are a real tower (exact integer / Ratio / double); the M suffix reads a real BigDecimal, N an exact integer (drop the stale Janet note). - 02-reader S5: M is a real java.math.BigDecimal with scale-insensitive equality. - 03-special-forms: document the read -> macroexpand -> analyze order (macros expand before special-form dispatch); special-form heads are not shadowable but macros are and value-position locals may be named like a special; set! on a var sets the innermost binding (else root); letfn is a primitive with letrec* semantics.
This commit is contained in:
parent
212cd0399a
commit
b9ab750983
3 changed files with 25 additions and 10 deletions
|
|
@ -43,7 +43,10 @@ exponent := [eE] ['+'|'-'] digits
|
|||
- S5. Trailing `N` (BigInt) and `M` (BigDecimal) suffixes are part of the
|
||||
grammar; their value semantics are the §4 numeric-tower question.
|
||||
Implementations without those towers SHOULD read them as the nearest
|
||||
numeric type and MUST document the choice.
|
||||
numeric type and MUST document the choice. The Chez host carries the full
|
||||
tower: `N` reads as an exact integer (arbitrary precision) and `M` as a real
|
||||
BigDecimal — `1.5M`, `0.0M`, `3M` — with value equality ignoring scale
|
||||
(`1.0M = 1.00M`), `(class 1.5M)` ⇒ `java.math.BigDecimal`, and `decimal?` true.
|
||||
|
||||
### Symbols and keywords
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue