Preserves: floats merged into doubles
This commit is contained in:
parent
f3d6e578cb
commit
a2849b18c9
|
@ -171,7 +171,6 @@ proc match(bindings: var Bindings; p: Pattern; v: Value): bool =
|
||||||
of PatternKind.Patom:
|
of PatternKind.Patom:
|
||||||
result = case p.patom
|
result = case p.patom
|
||||||
of PAtom.Boolean: v.isBoolean
|
of PAtom.Boolean: v.isBoolean
|
||||||
of PAtom.Float: v.isFloat
|
|
||||||
of PAtom.Double: v.isDouble
|
of PAtom.Double: v.isDouble
|
||||||
of PAtom.Signedinteger: v.isInteger
|
of PAtom.Signedinteger: v.isInteger
|
||||||
of PAtom.String: v.isString
|
of PAtom.String: v.isString
|
||||||
|
|
|
@ -70,7 +70,7 @@ proc grab*(pr: Value): Pattern =
|
||||||
of pkBoolean:
|
of pkBoolean:
|
||||||
AnyAtom(orKind: AnyAtomKind.`bool`, bool: pr.bool).toPattern
|
AnyAtom(orKind: AnyAtomKind.`bool`, bool: pr.bool).toPattern
|
||||||
of pkFloat:
|
of pkFloat:
|
||||||
AnyAtom(orKind: AnyAtomKind.`float`, float: pr.float).toPattern
|
AnyAtom(orKind: AnyAtomKind.`double`, double: pr.float).toPattern
|
||||||
of pkRegister:
|
of pkRegister:
|
||||||
AnyAtom(orKind: AnyAtomKind.`int`, int: pr.register).toPattern
|
AnyAtom(orKind: AnyAtomKind.`int`, int: pr.register).toPattern
|
||||||
of pkString:
|
of pkString:
|
||||||
|
|
|
@ -4,17 +4,14 @@ import
|
||||||
|
|
||||||
type
|
type
|
||||||
AnyAtomKind* {.pure.} = enum
|
AnyAtomKind* {.pure.} = enum
|
||||||
`bool`, `float`, `double`, `int`, `string`, `bytes`, `symbol`, `embedded`
|
`bool`, `double`, `int`, `string`, `bytes`, `symbol`, `embedded`
|
||||||
`AnyAtom`* {.preservesOr.} = object
|
`AnyAtom`* {.preservesOr.} = object
|
||||||
case orKind*: AnyAtomKind
|
case orKind*: AnyAtomKind
|
||||||
of AnyAtomKind.`bool`:
|
of AnyAtomKind.`bool`:
|
||||||
`bool`*: bool
|
`bool`*: bool
|
||||||
|
|
||||||
of AnyAtomKind.`float`:
|
|
||||||
`float`*: BiggestFloat
|
|
||||||
|
|
||||||
of AnyAtomKind.`double`:
|
of AnyAtomKind.`double`:
|
||||||
`double`*: BiggestFloat
|
`double`*: float
|
||||||
|
|
||||||
of AnyAtomKind.`int`:
|
of AnyAtomKind.`int`:
|
||||||
`int`*: BiggestInt
|
`int`*: BiggestInt
|
||||||
|
|
|
@ -107,8 +107,7 @@ type
|
||||||
|
|
||||||
SturdyPathStepDetail* = Parameters
|
SturdyPathStepDetail* = Parameters
|
||||||
`PAtom`* {.preservesOr, pure.} = enum
|
`PAtom`* {.preservesOr, pure.} = enum
|
||||||
`Boolean`, `Float`, `Double`, `SignedInteger`, `String`, `ByteString`,
|
`Boolean`, `Double`, `SignedInteger`, `String`, `ByteString`, `Symbol`
|
||||||
`Symbol`
|
|
||||||
PDiscard* {.preservesRecord: "_".} = object
|
PDiscard* {.preservesRecord: "_".} = object
|
||||||
|
|
||||||
TemplateKind* {.pure.} = enum
|
TemplateKind* {.pure.} = enum
|
||||||
|
|
|
@ -5,17 +5,17 @@ import
|
||||||
type
|
type
|
||||||
TimerExpired* {.preservesRecord: "timer-expired".} = object
|
TimerExpired* {.preservesRecord: "timer-expired".} = object
|
||||||
`label`*: Value
|
`label`*: Value
|
||||||
`seconds`*: BiggestFloat
|
`seconds`*: float
|
||||||
|
|
||||||
SetTimer* {.preservesRecord: "set-timer".} = object
|
SetTimer* {.preservesRecord: "set-timer".} = object
|
||||||
`label`*: Value
|
`label`*: Value
|
||||||
`seconds`*: BiggestFloat
|
`seconds`*: float
|
||||||
`kind`*: TimerKind
|
`kind`*: TimerKind
|
||||||
|
|
||||||
`TimerKind`* {.preservesOr, pure.} = enum
|
`TimerKind`* {.preservesOr, pure.} = enum
|
||||||
`relative`, `absolute`, `clear`
|
`relative`, `absolute`, `clear`
|
||||||
LaterThan* {.preservesRecord: "later-than".} = object
|
LaterThan* {.preservesRecord: "later-than".} = object
|
||||||
`seconds`*: BiggestFloat
|
`seconds`*: float
|
||||||
|
|
||||||
proc `$`*(x: TimerExpired | SetTimer | LaterThan): string =
|
proc `$`*(x: TimerExpired | SetTimer | LaterThan): string =
|
||||||
`$`(toPreserves(x))
|
`$`(toPreserves(x))
|
||||||
|
|
|
@ -86,11 +86,11 @@ type
|
||||||
`reason`*: LinkedTaskReleaseReason
|
`reason`*: LinkedTaskReleaseReason
|
||||||
|
|
||||||
TurnCausePeriodicActivation* {.preservesRecord: "periodic-activation".} = object
|
TurnCausePeriodicActivation* {.preservesRecord: "periodic-activation".} = object
|
||||||
`period`*: BiggestFloat
|
`period`*: float
|
||||||
|
|
||||||
TurnCauseDelay* {.preservesRecord: "delay".} = object
|
TurnCauseDelay* {.preservesRecord: "delay".} = object
|
||||||
`causingTurn`*: TurnId
|
`causingTurn`*: TurnId
|
||||||
`amount`*: BiggestFloat
|
`amount`*: float
|
||||||
|
|
||||||
TurnCauseExternal* {.preservesRecord: "external".} = object
|
TurnCauseExternal* {.preservesRecord: "external".} = object
|
||||||
`description`*: Value
|
`description`*: Value
|
||||||
|
@ -170,7 +170,7 @@ type
|
||||||
|
|
||||||
|
|
||||||
TraceEntry* {.preservesRecord: "trace".} = object
|
TraceEntry* {.preservesRecord: "trace".} = object
|
||||||
`timestamp`*: BiggestFloat
|
`timestamp`*: float
|
||||||
`actor`*: ActorId
|
`actor`*: ActorId
|
||||||
`item`*: ActorActivation
|
`item`*: ActorActivation
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
# Package
|
# Package
|
||||||
|
|
||||||
version = "20240206"
|
version = "20240208"
|
||||||
author = "Emery Hemingway"
|
author = "Emery Hemingway"
|
||||||
description = "Syndicated actors for conversational concurrency"
|
description = "Syndicated actors for conversational concurrency"
|
||||||
license = "Unlicense"
|
license = "Unlicense"
|
||||||
|
@ -9,4 +9,4 @@ srcDir = "src"
|
||||||
|
|
||||||
# Dependencies
|
# Dependencies
|
||||||
|
|
||||||
requires "https://github.com/ehmry/hashlib.git#f9455d4be988e14e3dc7933eb7cc7d7c4820b7ac", "nim >= 2.0.0", "https://git.syndicate-lang.org/ehmry/preserves-nim.git >= 20240206"
|
requires "https://github.com/ehmry/hashlib.git#f9455d4be988e14e3dc7933eb7cc7d7c4820b7ac", "nim >= 2.0.0", "https://git.syndicate-lang.org/ehmry/preserves-nim.git >= 20240208"
|
||||||
|
|
Loading…
Reference in New Issue