liquidsoap icon indicating copy to clipboard operation
liquidsoap copied to clipboard

Support non-local returns via `try .. catch`

Open toots opened this issue 1 year ago • 1 comments

toots avatar Oct 13 '22 14:10 toots

The idea would be:

let return_value = exception.register()

try
  ...
  raise return_value(payload=...)
catch exn: [return_value] do
  returned_value = exn.payload
  ...
end

Looks like the challenge would be to support dependent types so that payload can be of any type.

toots avatar Oct 13 '22 14:10 toots