links-lang / links

Links: Linking Theory to Practice for the Web
http://www.links-lang.org
Other
332 stars 42 forks source link

New syntax for handlers #1150

Closed Orbion-J closed 2 years ago

Orbion-J commented 2 years ago

This PR changes the syntax for handlers. Instead of

handle (...) {
  case Op(params, resumption) -> ...
  case Return(x) -> x
}

we write

handle (...) {
  case <Op(params) => resumption> -> ...
  case x -> x
}

We can also write case <Op(params) -> resumption> -> .... For now, the semantics for -> and => are the same. This is in prevision for a future step : we will not have shallowhandler anymore and we will indicate if a resumption is shallow with -> and deep with =>.

dhil commented 2 years ago

Thanks. I will merge this after we have fixed #1132 and shipped the next release.