links icon indicating copy to clipboard operation
links copied to clipboard

New syntax for handlers

Open dhil opened this issue 3 years ago • 1 comments

(this is a history clean version of @Orbion-J's PR #1150).

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 avatar Jul 01 '22 13:07 dhil

@Orbion-J in the future when you branch, make sure that you branch from an up-to-date master. It seems you have been either branching from your latest feature branch or a stale master in the past, and then pulling in all changes as part of your merge with links-lang/links.git. It adds a lot of noise that better be avoided.

dhil avatar Jul 01 '22 13:07 dhil