links-lang / links

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

New syntax for handlers #1151

Closed dhil closed 1 year ago

dhil commented 2 years ago

(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 commented 2 years ago

@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.