[wg-camlp4] My uses of syntax extension

David Waern david.waern at gmail.com
Mon Jan 28 17:13:34 GMT 2013


2013/1/28 Lukasz Stafiniak <lukstafi at gmail.com>:
> On Mon, Jan 28, 2013 at 4:32 PM, David Waern <david.waern at gmail.com> wrote:
>> Lukasz Stafiniak wrote:
>>
>>> My uses of camlp4:
>>> - "let try n = expr in expr with handlers"
>>
>> Could you explain what this means? Is the handler installed around the
>> first expression here only?
>
> Yes.
>
> http://sourceforge.net/p/toss/code-0/1821/tree/trunk/Toss/caml_extensions/pa_let_try.ml
> http://research.microsoft.com/en-us/um/people/akenn/sml/ExceptionalSyntax.pdf

OK. I've also wanted similar syntax, but I've noticed that if Alain's
"static exceptions" [1] proposal is accepted then encoding such things
using existing OCaml syntax becomes a bit lighter:

try raise (`Cont expr) with
| `Cont n -> expr
| handlers

[1]: http://www.lexifi.com/blog/static-exceptions

David


More information about the wg-camlp4 mailing list