Skip to content

Commit

Permalink
Remove null? annotations (#86)
Browse files Browse the repository at this point in the history
* Revert "Allow cont ref to be non-null in switch (#85)"

This reverts commit 92cbcc5.

* Remove other unnecessary `null?` in instruction typing
  • Loading branch information
tlively authored Sep 9, 2024
1 parent 92cbcc5 commit 386269e
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions proposals/stack-switching/Explainer.md
Original file line number Diff line number Diff line change
Expand Up @@ -767,27 +767,27 @@ This abbreviation will be formalised with an auxiliary function or other means i

- `cont.new <typeidx>`
- Create a new continuation from a given typed funcref.
- `cont.new $ct : [(ref null? $ft)] -> [(ref $ct)]`
- `cont.new $ct : [(ref null $ft)] -> [(ref $ct)]`
- iff `C.types[$ct] ~~ cont [t1*] -> [t2*]`

- `cont.bind <typeidx> <typeidx>`
- Partially apply a continuation.
- `cont.bind $ct $ct' : [t3* (ref null? $ct)] -> [(ref $ct')]`
- `cont.bind $ct $ct' : [t3* (ref null $ct)] -> [(ref $ct')]`
- iff `C.types[$ct] ~~ cont [t3* t1*] -> [t2*]`
- and `C.types[$ct'] ~~ cont [t1'*] -> [t2'*]`
- and `[t1*] -> [t2*] <: [t1'*] -> [t2'*]`

- `resume <typeidx> hdl*`
- Execute a given continuation.
- If the executed continuation suspends with a control tag `$t`, the corresponding handler `(on $t H)` is executed.
- `resume $ct hdl* : [t1* (ref null? $ct)] -> [t2*]`
- `resume $ct hdl* : [t1* (ref null $ct)] -> [t2*]`
- iff `C.types[$ct] ~~ cont [t1*] -> [t2*]`
- and `(hdl : t2*)*`

- `resume_throw <typeidx> <exnidx> hdl*`
- Execute a given continuation, but force it to immediately throw the annotated exception.
- Used to abort a continuation.
- `resume_throw $ct $e hdl* : [te* (ref null? $ct)] -> [t2*]`
- `resume_throw $ct $e hdl* : [te* (ref null $ct)] -> [t2*]`
- iff `C.types[$ct] ~~ cont [t1*] -> [t2*]`
- and `C.tags[$e] : tag $ft`
- and `C.types[$ft] ~~ func [te*] -> []`
Expand Down Expand Up @@ -815,7 +815,7 @@ This abbreviation will be formalised with an auxiliary function or other means i
- `switch <typeidx> <tagidx>`
- Switch to executing a given continuation directly, suspending the current execution.
- The suspension and switch are performed from the perspective of a parent `(on $e switch)` handler, determined by the annotated control tag.
- `switch $ct1 $e : [t1* (ref null? $ct1)] -> [t2*]`
- `switch $ct1 $e : [t1* (ref null $ct1)] -> [t2*]`
- iff `C.tags[$e] = tag $ft`
- and `C.types[$ft] ~~ func [] -> [t*]`
- and `C.types[$ct1] ~~ cont [t1* (ref null? $ct2)] -> [te1*]`
Expand Down

0 comments on commit 386269e

Please sign in to comment.