Skip to content

Semantics for duplicated resume table entries #78

@dhil

Description

@dhil

The instructions resume and resume_throw are annotated with dispatch tables, which consist of a collection of (on $tag $label) or (on $tag switch) associations. There is no restriction on how many times a particular $tag is allowed to appear the dispatch table, e.g. the following is currently valid:

(resume $ct (on $tag $label1) (on $tag $label2))

The question is what is supposed to happen when the child computation performs (suspend $tag)? I imagine the answer might be "whatever exception handlers do" (the first entry shadows the second entry). However, with the recent extension of switch we have an additional case to consider as the following is currently valid (syntax) too:

(resume $ct (on $tag $label) (on $tag switch))

But what does it mean? In principle we can view $tag as naming two separate control effects, which we differentiate at runtime by how $tag is invoked, i.e. either using suspend or switch. So an argument can be made for allowing $tag to be both "suspendable" and "switchable". Though, if we choose this semantics, then it imposes an odd restriction on the type of "suspendable" $tag as for it to be switchable it must have type $tag : [] -> [t*].

Metadata

Metadata

Assignees

Labels

questionFurther information is requested

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions