Version française
Home     About     Download     Resources     Contact us    
Browse thread
Upgrading sexplib-2.7.0 to camlp4 3.10
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Nicolas Pouillard <nicolas.pouillard@g...>
Subject: Re: Upgrading sexplib-2.7.0 to camlp4 3.10
On 5/1/07, Joel Reymont <joelr1@gmail.com> wrote:
>
> On May 1, 2007, at 3:16 PM, Nicolas Pouillard wrote:
>
> > The second one is about match cases, the old type was (patt * expr
> > option * expr) list, now it's match_case
> >
> > match_case, mc ::= (* empty *)
> >                                 | mc1 | mc2
> >                                 | p -> e
> >                                 | p when e1 -> e2
>
> Then
>
>      let matching =
>        (
>          <:patt< ( $tup:Ast.paCom_of_list patts$ ) >>,
>          None,
>          expr
>        )
>
> becomes
>
> let patt = <:patt< ( $tup:Ast.paCom_of_list patts$ ) >> in
> <:match_case< $patt$ -> $expr$ >>
>
> Right?

Or even shorter:

<:match_case< ( $tup:Ast.paCom_of_list patts$ ) -> $expr$ >>


-- 
Nicolas Pouillard