caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* parameterized pattern
@ 2006-11-06 21:15 Serge Aleynikov
  2006-11-06 23:58 ` [Caml-list] " Jon Harrop
                   ` (2 more replies)
  0 siblings, 3 replies; 15+ messages in thread
From: Serge Aleynikov @ 2006-11-06 21:15 UTC (permalink / raw)
  To: caml-list

Hi,

The section 6.6 of OCaml's manual introduces a notion of "Parenthesized 
patterns".

I couldn't find any examples on how to use this feature, and brute-force 
approach doesn't work:

# match 1.0 with
  (y : float)  -> print_float y
| (s : string) -> print_string s;;
This pattern matches values of type string
but is here used to match values of type float
# 

Could anyone point at a suitable resource?

Thanks.

Serge

-- 
Serge Aleynikov
Routing R&D, IDT Telecom
Tel: +1 (973) 438-3436
Fax: +1 (973) 438-1464


^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2006-11-15  1:36 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-11-06 21:15 parameterized pattern Serge Aleynikov
2006-11-06 23:58 ` [Caml-list] " Jon Harrop
2006-11-07  0:12   ` Serge Aleynikov
2006-11-06 23:59 ` Martin Jambon
2006-11-08 23:55 ` Lukasz Stafiniak
2006-11-09  1:45   ` brogoff
2006-11-09  5:19     ` Jon Harrop
2006-11-09  8:51       ` skaller
2006-11-09 16:22         ` brogoff
2006-11-09 17:55           ` skaller
2006-11-14 23:12           ` Don Syme
2006-11-15  1:00             ` brogoff
2006-11-15  1:36               ` Don Syme
2006-11-09  5:18   ` Jon Harrop
2006-11-09 16:42     ` micha

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).