... (fun (a,b) c -> a + b + c) "+" expresses that there can be several parameters, and parameter can be any pattern from: ...
Florent Monnier
fmonnier@...
Jun 1, 2008 8:29 am
9771
... Thank you, very helpful. I see the difference now: fun p1 ... pn -> expr transforms to fun p1 -> ... fun pn -> expr whereas function p1 -> expr1 | ... | pn...
marlenemiller71 a écrit : ... maybe the WP article on currying will interest you: http://en.wikipedia.org/wiki/Currying the french page provides an OCaml...
Florent Monnier
fmonnier@...
Jun 1, 2008 9:30 pm
9773
Hi ! Changing : let good_f x = try g x with Not_found -> h x to let bad_f x = (try g with Not_found -> h) x affects the behaviour of the function : - The...
... I was confused about this example in the book by Cousineau and Mauny: # fun true true -> true | _ _ -> false;; Syntax error Apparently the language has...
... It not really g that raised the exception, but the application of the function g to its argument x. So it's the g x that will raise the exception, and it's...
... alternative patterns with "function" works exactly like the structure "match v with" you cannot match several arguments as in "match v1 v2 with", you need...
Florent Monnier
fmonnier@...
Jun 2, 2008 2:32 pm
9778
... Strange ... The problem seems to be that the file should be called pGOCaml.cmi (first 'c' is capitalized). I don't understand who this can be installed....
... Oh yes that's right, I forgot this "feature" on os x! A friend suggested, thinking I was on linux, to do a symlink like: ...
Philippe Strauss
philou@...
Jun 2, 2008 10:29 pm
9781
Hello, I want to write a library that can be accessed like any other system library on a unix/linux system, but I don't want to code it in C. I want to write...
Oliver Bandel
oliver@...
Jun 3, 2008 10:45 am
9782
... It's a bit tricky. I've never really pinned it down, but here are some general comments: - Look at the source to mod_caml. It builds a .so containing the...
Helo Richard, ... Well, should I better wait until release of 3.11 for such kinds of projects?! ... [...] So I have C-code, and from there calling my...
Oliver Bandel
oliver@...
Jun 3, 2008 12:06 pm
9784
... The idea is to generate one C-object file from your Caml code. The -output-obj command line option allows this. You will alse need to register the entry...
... Mmmm. It's a long time since I should have done this... ... If your library is small and could be a good example, I can help turning it into a .so. I have...
Hi ! Here is a counter functor : *) module Counters ( X : Map.OrderedType ) : sig module XMap : sig type 'a t = 'a Map.Make(X).t val empty : 'a t val add : X.t...
Are there some built-in like it in Haskell to generate and manipulate list like this in OCaml? Mant Thanks Generators Main> [1..10] [1,2,3,4,5,6,7,8,9,10] ...
... There are some provided you use camlp4: $ ocaml camlp4oof.cma Objective Caml version 3.10.0 Camlp4 Parsing version 3.10.0 # [x + 2*x + x/2 | x <- [1; 2; 3;...
... Hash: SHA1 You should look at the list comprehension extension: http://martin.jambon.free.fr/p4ck.list.html#pa_compr Peng ... Version: GnuPG v2.0.7...
Peng Zang
peng.zang@...
Jun 3, 2008 6:09 pm
9790
... If I might reiterate this: lots of people want to be able to build DLLs from OCaml but nobody has ever written a guide explaining how it can be done even ...
... Are you sure this will even be in 3.11? ... This kind of thing is vastly easier and more productive with a common language run-time (assuming your users...
... no, there's no such built-in functions you have to make your own list builders: let mk_list a b = let next, p = if a<b then pred,(<) else succ,(>) in let...
Florent Monnier
fmonnier@...
Jun 3, 2008 6:29 pm
9793
ExtLib's List.init function is also useful. ... [Non-text portions of this message have been removed]...
... DLLs from ... done even ... Hum. All I'm doing is following the explanations of chapter 18 of the manual! Anyway, here is a stupid example. ******* Here is...
... [...] Well, just a few minutes ago I also looked again into the refman. Chapter 18 seems to be a good starting point. I will examine your examples (and...
Oliver Bandel
oliver@...
Jun 3, 2008 10:09 pm
9796
Hello How to pattern match 2 parameters? For instance func p1 p2 = function true true -> true ... ........... but it don't work in OCaml. Many Thanks...
... First of all, you're confused on the meaning of function. Basically, let f = function ... is the same as: let f x = match x with ... except that the...
... In my view it's not too bad to require that the user call some initialization function -- that's how most C libs work. But in fact you can do it...
Hi, I'm newbie for OCaml. I'm wondering whether there are some built-in function can convert a string to a boolean exprssion, and convert a boolean expression...