Single-precision floats are no more in Preserves

This commit is contained in:
Tony Garnock-Jones 2024-02-08 21:06:34 +01:00
parent 76a699bdf7
commit 3cf2cafdb4
5 changed files with 16 additions and 17 deletions

View File

@ -45,12 +45,12 @@ Preserves values come in various *types*: a few basic atomic types, plus sequenc
dictionary, and record compound types. From the specification:
Value = Atom Atom = Boolean
| Compound | Float
| Embedded | Double
| SignedInteger
Compound = Record | String
| Sequence | ByteString
| Set | Symbol
| Compound | Double
| Embedded | SignedInteger
| String
Compound = Record | ByteString
| Sequence | Symbol
| Set
| Dictionary
### Concrete syntax
@ -68,7 +68,6 @@ specification](https://preserves.dev/preserves-text.html) for the
grammar):
Boolean : #t #f
Float : 1.0f 10.4e3f -100.6f
Double : 1.0 10.4e3 -100.6
Integer : 1 0 -100
String : "Hello, world!\n"

View File

@ -224,7 +224,7 @@ When executed, the value in variable *var* is matched against the result of eval
## Value Expressions
*ValueExpr* =
    `#t` | `#f` | *float* | *double* | *int* | *string* | *bytes* |
    `#t` | `#f` | *double* | *int* | *string* | *bytes* |
    `$`*var* | `=`*symbol* | *bare-symbol* |
    *AttenuationExpr* |
    `<`*ValueExpr*` `*ValueExpr*...`>` |
@ -293,7 +293,7 @@ A *Rewrite* can be one of two possibilities:
## Pattern Expressions
*PatternExpr* =
    `#t` | `#f` | *float* | *double* | *int* | *string* | *bytes* |
    `#t` | `#f` | *double* | *int* | *string* | *bytes* |
    `$`*var* | `?`*var* | `_` | `=`*symbol* | *bare-symbol* |
    *AttenuationExpr* |
    `<?`*var*` `*PatternExpr*`>` |
@ -317,7 +317,7 @@ always succeeds, matching any value.
## Template Expressions
*TemplateExpr* =
    `#t` | `#f` | *float* | *double* | *int* | *string* | *bytes* |
    `#t` | `#f` | *double* | *int* | *string* | *bytes* |
    `$`*var* | `=`*symbol* | *bare-symbol* |
    *AttenuationExpr* |
    `<`*TemplateExpr*` `*TemplateExpr*...`>` |

View File

@ -222,11 +222,11 @@ Pattern = PDiscard / PAtom / PEmbedded / PBind / PAnd / PNot / Lit / PCompound .
PDiscard = <_>.
```
**Atomic type.** `PAtom` requires that a matched value be a boolean, a single- or double-precision float, an
**Atomic type.** `PAtom` requires that a matched value be a boolean, a double-precision float, an
integer, a string, a binary blob, or a symbol, respectively:
```preserves-schema
PAtom = =Boolean / =Float / =Double / =SignedInteger / =String / =ByteString / =Symbol .
PAtom = =Boolean / =Double / =SignedInteger / =String / =ByteString / =Symbol .
```
**Embedded value.** `PEmbedded` requires that a matched value be an embedded capability:
@ -794,7 +794,7 @@ Lit = <lit @value any>.
Pattern = PDiscard / PAtom / PEmbedded / PBind / PAnd / PNot / Lit / PCompound .
PDiscard = <_>.
PAtom = =Boolean / =Float / =Double / =SignedInteger / =String / =ByteString / =Symbol .
PAtom = =Boolean / =Double / =SignedInteger / =String / =ByteString / =Symbol .
PEmbedded = =Embedded .
PBind = <bind @pattern Pattern>.
PAnd = <and @patterns [Pattern ...]>.

View File

@ -60,8 +60,8 @@ Filter =
/ <compare @op Comparison @literal any> # Emit iff the comparison holds
/ <regex @regex string> # Emit iff input is String and regex matches
/ <test @pred Predicate> # Apply complex predicate
/ <real> # Emit iff input is Float, Double, or Integer
/ <int> # TRUNCATE and emit iff Float, Double or Integer
/ <real> # Emit iff input is Double, or Integer
/ <int> # TRUNCATE and emit iff Double or Integer
/ <kind @kind ValueKind> # Emit iff input kind matches
.
```
@ -101,7 +101,7 @@ Each `kind` filter selects only values from one of the kinds of Preserves value:
```preserves-schema
ValueKind =
/ =Boolean / =Float / =Double / =SignedInteger / =String / =ByteString / =Symbol
/ =Boolean / =Double / =SignedInteger / =String / =ByteString / =Symbol
/ =Record / =Sequence / =Set / =Dictionary
/ =Embedded
.

View File

@ -77,7 +77,7 @@ Lit = <lit @value any>.
Pattern = PDiscard / PAtom / PEmbedded / PBind / PAnd / PNot / Lit / PCompound .
PDiscard = <_>.
PAtom = =Boolean / =Float / =Double / =SignedInteger / =String / =ByteString / =Symbol .
PAtom = =Boolean / =Double / =SignedInteger / =String / =ByteString / =Symbol .
PEmbedded = =Embedded .
PBind = <bind @pattern Pattern>.
PAnd = <and @patterns [Pattern ...]>.