DSL: rename "asserting" to "publish"

This should be more legible if there is less confusion with the
Nim "assert" builtin.
This commit is contained in:
Emery Hemingway 2021-09-22 14:39:30 +02:00
parent 2636fa8f0a
commit 6cd5887b4c
4 changed files with 5 additions and 5 deletions

View File

@ -150,7 +150,7 @@ template onStop*(body: untyped): untyped =
proc getCurrentFacet(): Facet {.inject, used.} = facet
body
template asserting*(a: Preserve): untyped =
template publish*(a: Preserve): untyped =
mixin getCurrentFacet
getCurrentFacet().addEndpoint do (_: Facet) -> EndpointSpec:
result.assertion = a

View File

@ -29,8 +29,8 @@ syndicate timerDriver:
if period > 0:
getCurrentFacet().beginExternalTask()
addTimer(period.int, oneshot = true) do (fd: AsyncFD) -> bool:
react: asserting: prsTimeLaterThan(deadline)
react: publish: prsTimeLaterThan(deadline)
getCurrentFacet().endExternalTask()
true
else:
react: asserting: prsTimeLaterThan(deadline)
react: publish: prsTimeLaterThan(deadline)

View File

@ -28,7 +28,7 @@ syndicate chat:
echo who, " says ", what
spawn "chat":
asserting present(me)
publish present(me)
during (present(me)):
let
inputFacet = getCurrentFacet()

View File

@ -11,7 +11,7 @@ syndicate testDsl:
spawn "box":
field(currentValue, BiggestInt, 0)
asserting prsBoxState(currentValue.get)
publish prsBoxState(currentValue.get)
stopIf currentValue.get == 10:
echo "box: terminating"
onMessage(prsSetBox(?newValue)) do (newValue: int):