caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* Patterns that evaluate
@ 2007-02-13 22:04 Jacques Carette
  2007-02-13 22:07 ` [Caml-list] " Jon Harrop
  2007-02-14 20:29 ` Nathaniel Gray
  0 siblings, 2 replies; 22+ messages in thread
From: Jacques Carette @ 2007-02-13 22:04 UTC (permalink / raw)
  To: OCaml

I recently wrote some ocaml code which "worked", but not as I 
intended...  The test cases I tried worked, but I should have tested 
harder.  Apparently I was under the mistaken impression that OCaml's 
pattern-matching was more "first class"!  So I wrote (in part):

let buildsimp cast e f1 f2 = fun e1 -> fun e2 -> match (e1,e2) with
                                                 | ({st = Some e}, _) -> e2

and I expected it to work.  Only a code review by a colleague 'found' 
this bug in my code.

Question: would it be a difficult extension?  This seemed so "natural", 
I just "used" the feature before it was quite there yet ;-).

Jacques

PS: I guess I had first-class patterns on the brain; Maple has them 
[under the misleadingly-named function "typematch"] (but that's 
cheating, I know) and W. Kahl's Pattern Matching Calculus allows it, and 
I wrote a joint paper with Wolfram describing a categorical semantics 
for the PMC.


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

end of thread, other threads:[~2007-03-07 11:15 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-02-13 22:04 Patterns that evaluate Jacques Carette
2007-02-13 22:07 ` [Caml-list] " Jon Harrop
2007-02-14  0:10   ` Jacques Carette
2007-02-14 18:20   ` Edgar Friendly
2007-02-14 18:55     ` Gerd Stolpmann
2007-02-14 19:10       ` Denis Bueno
2007-02-14 19:11       ` Jacques Carette
2007-02-14 19:25         ` Gerd Stolpmann
2007-02-14 20:30           ` Edgar Friendly
2007-02-14 21:05       ` Jon Harrop
2007-02-14 21:33         ` Jacques Carette
2007-02-14 22:34   ` Martin Jambon
2007-02-15  0:26     ` Jacques Garrigue
2007-02-15  3:57       ` Jon Harrop
2007-02-15 22:43         ` Don Syme
2007-02-14 20:29 ` Nathaniel Gray
2007-02-14 21:10   ` Jacques Carette
2007-02-15  3:53     ` skaller
2007-02-15 13:41       ` Jacques Carette
2007-02-15 14:10         ` skaller
2007-02-15 20:43     ` Nathaniel Gray
2007-03-07 11:15       ` Oliver Bandel

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).