Browse thread
Re: [Caml-list] Matching when
[
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: | Luc Maranget <luc.maranget@i...> |
| Subject: | Re: [Caml-list] Matching when |
>
> #include <std.flx>
>
> match (2,1) with
> | ( (?x when x>=1), (?y when y >=1)) when x >=2 => { print "YES"; endl; }
> | _ => { print "NO"; endl; }
> endmatch;
>
> wherein 'when' expressions are part of patterns, and as you can see,
> can be nested within a pattern -- making the grammar for patterns
> and expressions mutually recursive.
>
> I'm curious as to what problems you perceive with
> the mutual recursion.
>
> --
> John Max Skaller, mailto:skaller@ozemail.com.au
> snail:10/1 Toxteth Rd, Glebe, NSW 2037, Australia.
> voice:61-2-9660-0850
>
>
>
>
Nothing special, it is just an important change for a questionable
benefit....
Changing that would change many things in the front end, in
particular, the type-checker.
May be easy, may not be...
--Luc
-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners