Browse Source

Minor corrections and tweaks

fruit
Tony Garnock-Jones 4 years ago
parent
commit
db563fc309
  1. 10
      syndicate/HOWITWORKS.md

10
syndicate/HOWITWORKS.md

@ -288,13 +288,13 @@ cases where handlers are dynamically installed. @@ -288,13 +288,13 @@ cases where handlers are dynamically installed.
if selector not in edges then
edges[selector] := {}
let table = edges[selector]
if class not in edges[selector] then
if class not in table then
let (outercache, constmap) = cont
let innercache =
{ v | v ∈ outercache,
classof (project v h) = class }
edges[selector][class] := ((innercache, {}), {})
let node' = edges[selector][class]
table[class] := ((innercache, {}), {})
let node' = table[class]
walk-edge (h ++ [0]) node' 0 0 [s_0, ..., s_i]
**Definition.** The `addHandler` procedure installs into an index an
@ -303,7 +303,7 @@ cases where handlers are dynamically installed. @@ -303,7 +303,7 @@ cases where handlers are dynamically installed.
sequence of captured values matching existing assertions in the
index.[^function-pointer-equality]
addHandler :: Index -> (S × [H×V] × [H]) -> ([V] -> V) -> 1
addHandler :: Index -> (S × [H×V] × [H]) -> (EventType -> [V] -> V) -> 1
addHandler index k f =
let (s, constantMap, captureMap) = k
let (_, root) = index
@ -337,7 +337,7 @@ cases where handlers are dynamically installed. @@ -337,7 +337,7 @@ cases where handlers are dynamically installed.
**Definition.** The `removeHandler` procedure removes an event handler
from an index.
removeHandler :: Index -> (S × [H×V] × [H]) -> ([V] -> V) -> 1
removeHandler :: Index -> (S × [H×V] × [H]) -> (EventType -> [V] -> V) -> 1
removeHandler index k f =
let (s, constantMap, captureMap) = k
let (_, root) = index

Loading…
Cancel
Save