Browse thread
Estimating the size of the ocaml community
-
Yaron Minsky
-
Christopher A. Watford
-
Frédéric_Gava
-
skaller
-
Erik de Castro Lopo
- Olivier_Pérès
-
Thomas Fischbacher
-
Frédéric_Gava
-
Thomas Fischbacher
- Paul Snively
- josh
- Richard Jones
-
Jon Harrop
-
Michael Walter
-
Jon Harrop
- Damien Doligez
- Thomas Fischbacher
- Michael Walter
-
Radu Grigore
- Gerd Stolpmann
- Jon
-
Jon Harrop
- Thomas Fischbacher
-
Richard Jones
- Thomas Fischbacher
-
Oliver Bandel
- sejourne_kevin
- skaller
-
Michael Walter
- Ville-Pertti Keinonen
- Oliver Bandel
- Basile STARYNKEVITCH
-
Thomas Fischbacher
- ronniec95@l...
- skaller
- chris.danx
-
Frédéric_Gava
-
Erik de Castro Lopo
- sejourne_kevin
- Stefano Zacchiroli
-
skaller
-
Frédéric_Gava
- Kenneth Knowles
- Michael Jeffrey Tucker
- Richard Jones
- Nicolas Cannasse
- Evan Martin
- Eric Stokes
- chris.danx
- Sylvain LE GALL
- sejourne_kevin
- Sven Luther
- Johann Spies
-
Christopher A. Watford
[
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: | sejourne_kevin <sejourne_kevin@y...> |
| Subject: | Re: [Caml-list] Estimating the size of the ocaml community |
Oliver Bandel a écrit :
> 9.: Pattern matching, that *really* is functional (seems to be necessary that it works
> like it is done in logical programming languages like Prolog or similar?
Something like this could be fun (just like Prolog):
(*caml way*)
let test = function
[(1,a);b;(3,c);(4,d)] ->Printf.printf "%d %d %d \n" a c d; b
| _ -> failwith "Unification Impossible"
;;
(*half-prolog way*)
let test [(1,a);b;(3,c);(4,d)] = Printf.printf "%d %d %d \n" a c d; b
and test _ = failwith "Unification Impossible"
;;
The second isn't allow, but it isn't a partial match.
With a logic match, Ocaml could be functionnal, imperative, object and
logic. Just need a dynamic syntax to have the power of Prolog with the
power of OCaml... cool. The problem with the logic
match (* | "prefix"^str -> *) is that ^ isn't a constructor but a
function. I think, the logic match can't be determinist. IHMO, Prolog
can do it just because all data are term(s) as all 'function'.
Regards,
Kévin