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: Richard Jones <rich@a...>
Subject: Re: [Caml-list] Two camlp4 questions
On Sat, Apr 26, 2008 at 02:54:12PM +0200, Nicolas Pouillard wrote:
> 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

OK thanks - I was obviously confused.

Rich.

-- 
Richard Jones
Red Hat