On this page:
win?
win-mbr
win-write
win-exit
win-test
env-read1
env-read
win-boot
win-env-replace
win-env-read
win-env-read1

3 WIN: kernel with processes and shared registry

 (require dos/win) package: dos

dos/win takes dos/os2 and fixes the state as a environment, or registry, or hash that maps symbols to sets of values (represented as lists.)

procedure

(win? x)  boolean?

  x : any/c
Identifies dos/win kernel states.

procedure

(win-mbr p ...)  win?

  p : (-> env? env?)
Constructs a kernel state where each of the p are initial processes.

procedure

(win-write [#:threads ts] key val ... ...)  env?

  ts : (treeof (-> env? env?)) = null
  key : symbol?
  val : any/c
Spawns new threads ts and adds mappings from each key to each val to the registry. Returns the next registry.

procedure

(win-exit key val ... ...)  void?

  key : symbol?
  val : any/c
Like win-write but does not return.

procedure

(win-test cur p)  env?

  cur : env?
  p : (-> env? env?)
Returns the environment that p writes when given cur.

procedure

(env-read1 e k default)  any/c

  e : env?
  k : symbol?
  default : any/c
Returns a value that e holds for k or default if it holds none.

procedure

(env-read e k)  (listof any/c)

  e : env?
  k : symbol?
Returns the values that e holds for k.

procedure

(win-boot cur)  win?

  cur : win?
Simulates one cycle of the kernel cur’s operation and returns a new kernel state.

These functions cannot be called from inside processes, because they cannot capture win? values.

procedure

(win-env-replace w k vs)  win?

  w : win?
  k : symbol?
  vs : (listof any/c)
Returns a new kernel state where the registry maps k to vs.

procedure

(win-env-read w k)  (listof any/c)

  w : win?
  k : symbol?
Like env-read, but on the environment of w.

procedure

(win-env-read1 w k default)  any/c

  w : win?
  k : symbol?
  default : any/c
Like env-read1, but on the environment of w.