Version française
Home     About     Download     Resources     Contact us    
Browse thread
Two camlp4 questions
[ 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: [Caml-list] Two camlp4 questions
Excerpts from Richard Jones's message of Fri Apr 25 15:18:12 +0200 2008:
> (1) How do I match on the pattern which is literally '_' in the
> original code?
> 
>     match mypatt with
>     | <:patt< _ >> -> ...
> 
> seems like it matches any pattern.

I don't think so, it's supposed to match only the wildcard pattern.

Proof:
  $ camlp4oof -str 'match x with <:patt< _ >> -> y'
  match x with | Ast.PaAny _ -> y

-- 
Nicolas Pouillard aka Ertai