[
Home
]
[ Index:
by date
|
by threads
]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
| Date: | -- (:) |
| From: | Nathaniel Gray <n8gray@g...> |
| Subject: | Re: [Caml-list] Patterns that evaluate |
On 2/13/07, Jacques Carette <carette@mcmaster.ca> wrote:
> 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.
I guess I'm not seeing it. How did you expect it to work? Is this
what you mean:
... | ({st = Some v}, _) when v = e -> e2
Is there some functionality that you're looking for that when clauses
don't provide?
Cheers,
-n8
--
>>>-- Nathaniel Gray -- Caltech Computer Science ------>
>>>-- Mojave Project -- http://mojave.cs.caltech.edu -->