[Caml-list] [ANN] Atdgen/Biniou with support for cyclic values

2010-12-20 Thread Martin Jambon
.txt Home of each project: http://martin.jambon.free.fr/biniou.html http://martin.jambon.free.fr/yojson.html http://oss.wink.com/atd/ http://oss.wink.com/atdgen/ Non-interactive installation with Godi: $ godi_console update $ godi_console perform -build godi-atdgen Each of these four projects are

Re: [Caml-list] Re: help with regular expression

2010-12-06 Thread Martin Jambon
On 12/06/10 05:11, Sylvain Le Gall wrote: > On 06-12-2010, David Allsopp wrote: >> zaid Khalid wrote: >>> >> >>> Hint I am using (Str.regexp) >> >> There are other libraries (e.g. pcre-ocaml) which provide different (I >> would say more powerful, rather than strictly better!) >> implementations. >

Re: [Caml-list] zero-arity constructor

2010-11-27 Thread Martin Jambon
On 11/27/10 04:23, Julia Lawall wrote: > In my case, I originally thought that the constructor should take an > argument, then changed my mind. I would have hoped that OCaml would have > found the inconsistency. That's what static typing is for. Thus, I > find the change quite disappointing.

Re: [Caml-list] Option functions (or lack thereof) + operator for composition

2010-11-16 Thread Martin Jambon
On 11/16/10 03:51, Gabriel Kerneis wrote: > On Tue, Nov 16, 2010 at 12:43:30PM +0100, Thomas Gazagnaire wrote: >> You are not forced to use match expression, you can just define : >> let is_none x = match x with None -> true | Some _ -> false >> and is_some x = not (is_none x) >> and then use these

Re: [Caml-list] web server interface for Ocaml ( like rack, wsgi, ...)?

2010-09-21 Thread Martin Jambon
Richard Jones wrote: > On Tue, Sep 21, 2010 at 09:50:36AM +0200, ben kuin wrote: >>> what's wrong with simply proxying the HTTP connections through your >>> favorite webserver to the backend ocsigen/ocamlnet server? >> Nothing per se. I've tried so set something up with ocsigen, but I had >> to gi

code duplication (was Re: [Caml-list] How can I set a type parameter of Map.Make(X) ?)

2010-09-20 Thread Martin Jambon
ific kind of map. Of course, I could leave Map.Make > polymorphic, but that is a different module type than the one I want to > use to represent my theory. > > Yours, > Jacky > > > On 20/09/2010 19:58, Martin Jambon wrote: >> Dumitru Potop-Butucaru wrote: >>&

Re: [Caml-list] How can I set a type parameter of Map.Make(X) ?

2010-09-20 Thread Martin Jambon
Dumitru Potop-Butucaru wrote: > > Actually, I was looking for a way to specialize a whole module, > not just the associated type (**this** I knew how to do). > I would like to write something like: > > include module type of Set.Make(String) with 'a= int > > Is this possible? I don't know a

[Caml-list] [ANN] atdgen

2010-09-13 Thread Martin Jambon
the source distribution and is accessible at: http://oss.wink.com/atdgen/atdgen-1.0.1/example/ Package details: Atdgen Author: Martin Jambon Homepage: http://oss.wink.com/atdgen/ Version: 1.0.1 Kind: code generator Godi package: yes Description: Atdgen is a co

Re: [Caml-list] Create a constraint between variant type and data list

2010-09-03 Thread Martin Jambon
Sylvain Le Gall wrote: > Hello all, > > I would like to somehow enforce that a variant type is associated with > an entry in a data list. > > For example, > > I would like to define: > > type license = GPL | LGPL > > and > > let data = [ GPL, "GNU Public license"; > LGPL, "G

Re: [Caml-list] extending records with Obj.magic

2010-08-30 Thread Martin Jambon
Nicolas Ojeda Bar wrote: > Hello, > > I need extensible records, and the code below seems to > work. Are there any pitfall that I should be aware of? > Could this mess up the GC? > > # type t0 = { a : int }; > # type t1 = { a2 : int; b : int }; > # value x1 = { a2 = 3; b = 5 }; > # value x0 : t0

Re: [Caml-list] OCaml 3.12.0+beta1

2010-06-24 Thread Martin Jambon
Florent Ouchet wrote: > Hello, > > No problem so far with 3.12.0b1 but... > > Damien Doligez a écrit : >> - Record patterns of the form { lbl = pat; _ } to mark that not all >> labels are listed, purposefully. (See new warning below.) >> > This modification heavily breaks backward compatibi

Re: [Caml-list] OCaml 3.12.0+beta1

2010-06-16 Thread Martin Jambon
Yoann Padioleau wrote: > On Jun 16, 2010, at 6:07 AM, Damien Doligez wrote: > >> Dear OCaml users, > > [...] > >> - Record patterns of the form { lbl = pat; _ } to mark that not all >> labels are listed, purposefully. (See new warning below.) > > This is cool. Thank you! Does it have to be '_

Re: [Caml-list] Annotated trees

2010-06-06 Thread Martin Jambon
Martin Jambon wrote: > Daniel Bünzli wrote: >> Hello, >> >> Does anybody have any real world experience in choosing between the >> following two representations for a tree augmented with annotations ? >> >> type 'a t = 'a * [ `Leaf of string |

Re: [Caml-list] Annotated trees

2010-06-06 Thread Martin Jambon
Daniel Bünzli wrote: > Hello, > > Does anybody have any real world experience in choosing between the > following two representations for a tree augmented with annotations ? > > type 'a t = 'a * [ `Leaf of string | `Node of 'a t list ] > type 'a t = [ `Leaf of 'a * string | `Node of 'a * 'a t lis

Re: [Caml-list] polymorphic (<)

2010-04-21 Thread Martin Jambon
Jacques Le Normand wrote: > Hello caml-list, > Why doesn't (<) check for physical equality before traversing the > structures? If I remember correctly it used to be the case in older versions of OCaml, but it changed because of the standard behavior expected from NaN float values. The comparison o

Re: [Caml-list] Inspect and dump values on the OCaml heap

2010-04-14 Thread Martin Jambon
Kaustuv Chaudhuri wrote: > On Wed, Apr 14, 2010 at 5:02 PM, Kaspar Rohrer > wrote: >> [...] > > Implementing dumpers seems like a teething procedure for > OCaml hackers. Here's my own attempt from a couple of years ago. > It handles cycles, renders SVGs (via Graphviz), and can accept > data stru

Re: [Caml-list] Inspect and dump values on the OCaml heap

2010-04-14 Thread Martin Jambon
Kaspar Rohrer wrote: > On Apr 15, 2010, at 12:45 AM, Richard Jones wrote: >> Graphviz output is interesting, but I would add that such a thing >> exists as the 'Std.dump' function in extlib. > > The last time I've checked, Std.dump had several shortcomings. It did not > handle cycles in the objec

Re: [Caml-list] Format: Fortran (&c.) style continuation lines?

2010-04-08 Thread Martin Jambon
Thorsten Ohl (TP2) wrote: > Hi, > > for ages, I've been using the following (somewhat hackish) approach to > pretty printing source code that requires special lexical markers to > allow statements that continue over more than one line. (e.g. in > Fortran > > foo = 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1

Re: [Caml-list] camlp4 infix let

2010-04-07 Thread Martin Jambon
Jérémie Dimino wrote: > Hi, > > Le mercredi 07 avril 2010 à 15:05 -0400, Jacques Le Normand a écrit : >> Dear List, >> I'm writing a camlp4 syntax extension and I'd like to write >> >> <:expr< let ( >>= ) = Bar.( >>= ) in 5 >> >> but camlp4 complains: >> >> While expanding quotation "ex

Re: [Caml-list] Building multiple configurations?

2010-03-22 Thread Martin Jambon
Grant Olson wrote: > I'm doing something weird here and I'm thinking there has to be a better > way. > > I've got a configuration file that's a .ml file. And I do want it to be > an .ml file that gets included at compile time, not some .txt config > file that gets read in at runtime. I'm buildin

Re: [Caml-list] Buffer.add_channel hangs

2010-03-17 Thread Martin Jambon
Stas Miasnikou wrote: > Hi, > > OCaml 3.11.1, OpenBSD 4.6, i386. > > I am trying to read whole file by doing: > > let read_file_bin name = > let ic = open_in_bin name in > let b = Buffer.create 1024 in > (try Buffer.add_channel b ic max_int with _ -> ()); (* <-- HERE *) > close_in ic; >

[Caml-list] OCaml jobs at MyLife

2010-01-05 Thread Martin Jambon
Dear fellow OCaml programmers, Our company, MyLife, is continuing to seek OCaml programmers to expand our team in the Silicon Valley. We develop back-end people search technologies and the vast majority of our code is written in Objective Caml and runs on Linux. We love that as it provides us wi

Re: [***SPAM*** Score/Req: 10.1/8.0] Re: [Caml-list] Re: OCaml is broken

2009-12-20 Thread Martin Jambon
Erik Rigtorp wrote: > It's too bad that INRIA is not interested in fixing this bug. Ask Santa Claus, you'll get it by Friday. Free shipping. ;-) Martin ___ Caml-list mailing list. Subscription management: http://yquem.inria.fr/cgi-bin/mailman/listi

Re: [Caml-list] New: cppo, C preprocessor for OCaml

2009-11-18 Thread Martin Jambon
Goswin von Brederlow wrote: > Martin Jambon writes: > >> Dear list, >> >> It is my pleasure to announce the first release of cppo, an OCaml-friendly >> equivalent of the C preprocessor (cpp). >> >> Cppo provides the classic #include, #define a

[Caml-list] New: cppo, C preprocessor for OCaml

2009-11-17 Thread Martin Jambon
Dear list, It is my pleasure to announce the first release of cppo, an OCaml-friendly equivalent of the C preprocessor (cpp). Cppo provides the classic #include, #define and conditionals (#ifdef, ...) which are occasionally useful. Cppo can be used on OCaml files and variants of OCaml that use t

Re: [Caml-list] Re: The lexer hack

2009-11-11 Thread Martin Jambon
Dario Teixeira wrote: > Hi, > >> Interesting. Have you confirmed that this works? I am slightly >> worried by the fact that an LR parser reads one token ahead, >> i.e. one token past BEGIN_VERB might already have been read >> before the enter_verb semantic action is executed. If that is >> so, the

Re: [Caml-list] Unboxed float tuples

2009-11-08 Thread Martin Jambon
Daniel Bünzli wrote: > Tuples and records are represented the same way. However when it comes > to records with only floats fields we get a special unboxed > representation. > > Why don't we get that for tuples of floats only ? Because polymorphic functions like fst would break (or would require

Re: [Caml-list] Generation of Java code from OCaml

2009-09-24 Thread Martin Jambon
blue storm wrote: > On Thu, Sep 24, 2009 at 1:18 PM, Martin Jambon > wrote: >> Yes, patching the original code of json-static would work but it's not ideal. > >>From the example given, it seems that the original poster already uses > json-static. In that case, I thin

Re: [Caml-list] Generation of Java code from OCaml

2009-09-24 Thread Martin Jambon
blue storm wrote: > In case it helps, below is a basic patch against json-static (SVN > trunk, 3.10 version). On your example it produces the following code : [...] Yes, patching the original code of json-static would work but it's not ideal. Maybe Deriving is a better choice (http://code.google.

Re: [Caml-list] Cache algorithms: implementation or library available?

2009-09-22 Thread Martin Jambon
Hugo Ferreira wrote: > Hello, > > I would like to know if anyone has or knows of an Ocaml > library or open-source code implementation of some cache > algorithms (example: least recently used). > > Basically I need to cache a function that maps a list > of ordered integers into a value (float, in

Re: [Caml-list] A (Silly?) Question About Universal Type Quantification

2009-09-10 Thread Martin Jambon
Will M Farr wrote: > Hello, > > I recently encountered a situation where I had (effectively) the > following polymorphic type: > > type 'a record = { id : int; data : 'a } You could do this: type record = { id : int; data : 'a . 'a } The only minor problem is that you can't create values of su

Re: [Caml-list] lazy vs fun

2009-08-24 Thread Martin Jambon
Martin Jambon wrote: > Stéphane Glondu wrote: >> Warren Harris a écrit : >>> Is there any advantage to using lazy evaluation in ocaml rather than >>> just using thunks to defer evaluation? [...] >> Two things I can think of right now: they are evaluated only onc

Re: [Caml-list] lazy vs fun

2009-08-24 Thread Martin Jambon
Stéphane Glondu wrote: > Warren Harris a écrit : >> Is there any advantage to using lazy evaluation in ocaml rather than >> just using thunks to defer evaluation? [...] > > Two things I can think of right now: they are evaluated only once (even > if you call Lazy.force several times), and you can

Re: [Caml-list] Re: ocaml sefault in bytecode: unanswered questions

2009-08-10 Thread Martin Jambon
Elnatan Reisner wrote: > On Sun, 2009-08-09 at 21:09 +0200, Alain Frisch wrote: >> On 8/9/2009 8:56 PM, Elnatan Reisner wrote: >>> My other issue is that the description of (==) for mutable structures >>> doesn't specify that it is symmetric; reading the documentation >>> literally only implies tha

Re: [Caml-list] Re: ocamllex and python-style indentation

2009-07-01 Thread Martin Jambon
Sylvain Le Gall wrote: > Hello, > > On 01-07-2009, Andreas Rossberg wrote: >> Mike Lin wrote: >>> OK, now I'm curious :) how does your lexer match balanced parentheses, >>> or in this case comments? >>> >> Easily, with a bit of side effects (I think that's roughly how all ML >> compilers do i

Re: [Caml-list] default arguments in classes

2009-06-16 Thread Martin Jambon
Jacques Le Normand wrote: > Hello list, > I'm trying to define a method with a default argument, but I keep > getting an error. Here's the code: > > class foo = > object (self) > method bar ?(baz="moo") () = > (new foo)#bar ~baz () > end > > and the error: > > The expression "new fo

Re: [Caml-list] ocamllex and python-style indentation

2009-06-12 Thread Martin Jambon
Andrej Bauer wrote: > Thanks to Andreas, I'll have a look at the "old" code. > > I think I understand the general idea of inserting "virtual" tokens, > but the details confuse me still. So starting with > >> if True: >> x = 3 >> y = (2 + >> 4 + 5) >> else: >> x = 5 >> if Fal

Re: [Caml-list] ocamllex and python-style indentation

2009-06-12 Thread Martin Jambon
Andrej Bauer wrote: > Thanks to Andreas, I'll have a look at the "old" code. > > I think I understand the general idea of inserting "virtual" tokens, > but the details confuse me still. So starting with > >> if True: >> x = 3 >> y = (2 + >> 4 + 5) >> else: >> x = 5 >> if Fal

Re: [Caml-list] ocamllex and python-style indentation

2009-06-11 Thread Martin Jambon
Andrej Bauer wrote: > My parsing powers are not sufficient to easily come up with > lexer/parser for a simple language that uses python-style indentation > and newline rules. Does anyone have such a thing lying around, written > in ocamllex/yacc or menhir? I would appreciate a peek to see how > you

Re: [Caml-list] Which types for representing HTML documents ?

2009-06-08 Thread Martin Jambon
Sébastien Hinderer wrote: > Dear all, > > According to you, how could an HTML document best be represented in > OCaml ? Ocamlnet's Nethtml works fine for parsing: type document = Element of (string * (string * string) list * Nethtml.document list) | Data of string If your go

Re: [Caml-list] Strange, occasional build failure with ocamlmklib / ranlib

2009-06-02 Thread Martin Jambon
Richard Jones wrote: > I just want to post this here in case it rings a bell with anyone: > > ocamlfind ocamlc -c guestfs.mli > ocamlfind ocamlc -c guestfs.ml > ocamlfind ocamlopt -c guestfs.ml > ocamlmklib -o mlguestfs guestfs_c.o guestfs_c_actions.o guestfs.cmo > -L../src/.libs -lguestfs > ocaml

Re: [Caml-list] let x = ... in object ...

2009-05-26 Thread Martin Jambon
Guillaume Hennequin wrote: > > > > # class a = let () = print_endline "hello" in object end;; > hello > class a : object end > > > Maybe you mean the following: > > > ? I was just pointing out that "class a = let x = ... in object ... end" creates x once and for all when th

Re: [Caml-list] let x = ... in object ...

2009-05-26 Thread Martin Jambon
Guillaume Hennequin wrote: > Dear list, > > I was just wondering whether in > > class a = > let x = Array.make 1 0. in > object > val y = Array.copy x > ... > end # class a = let () = print_endline "hello" in object end;; hello class a : object end Maybe you mean the following: cla

Re: [Caml-list] Extending modules and signatures

2009-04-20 Thread Martin Jambon
Goswin von Brederlow wrote: > Which would also need > > module A1 = new module A > module A2 = new module A > A1.incr_x () > A1.get_x;; > - : int = 124 > A2.get_x ();; > - : int = 123 > > So you see A does not have global variables but only instance > variables. What you describe are ocaml object

Re: [Caml-list] Extending modules and signatures

2009-04-19 Thread Martin Jambon
Ashish Agarwal wrote: >> The module type exists, it's just that it doesn't have a name. > > Right, thanks for the clarification. > > >> let x = (123, "abc") >> does not define "type x = int * string" either. > > True, but I think the expectations are different for module types. A > file a.ml

Re: [Caml-list] Extending modules and signatures

2009-04-18 Thread Martin Jambon
Ashish Agarwal wrote: > This is a commonly requested feature. Ah. > One issue is that a file a.ml > creates a module A. However, a file a.mli does not create > a module type A. I'm not sure why this is the case. Does anyone know if > there is a specific reason? The module type exis

Re: [Caml-list] pattern matching and records vs tuples

2009-04-15 Thread Martin Jambon
Yaron Minsky wrote: > > > On Wed, Apr 15, 2009 at 5:30 AM, Martin Jambon > mailto:martin.jam...@ens-lyon.org>> wrote: > > blue storm wrote: > > On Wed, Apr 15, 2009 at 2:44 AM, Yaron Minsky <mailto:ymin...@gmail.com>> wrote: > &g

Re: [Caml-list] pattern matching and records vs tuples

2009-04-15 Thread Martin Jambon
blue storm wrote: > On Wed, Apr 15, 2009 at 2:44 AM, Yaron Minsky wrote: >> Another thought I've had for making record matches lighter is to do the same >> kind of trick that's done with labeled arguments, i.e., have >> >>let { foo; bar } = x >> >> bind the variable foo to the x.foo, and bind

Re: [Caml-list] Strings

2009-04-03 Thread Martin Jambon
Daniel Bünzli wrote: > > Le 3 avr. 09 à 16:46, Jon Harrop a écrit : > >> Just because my OCaml programs were mutating strings and translating >> that into >> F# is non-trivial if the string is shared or big. In essence, I've always >> used OCaml's strings as a more efficient byte array. In fact,

[Caml-list] OCaml job at MyLife

2009-04-01 Thread Martin Jambon
d includes contributors that are active in the OCaml community. If you're interested in applying for this position, please contact the hiring manager at ocaml-...@mylife.com. Martin Jambon ___ Caml-list mailing list. Subscription management: http:/

Re: [Caml-list] Bug? Constraints get ignored in methods

2009-04-01 Thread Martin Jambon
Goswin von Brederlow wrote: > Martin Jambon writes: > >> Would the following work for you: > > No. Not just like this. > >> type 'a linked = { >> data : 'a; >> mutable next : < > linked option >> } >> (* constraint '

Re: [Caml-list] Bug? Constraints get ignored in methods

2009-04-01 Thread Martin Jambon
Goswin von Brederlow wrote: > Hi, > > small add on to my last mail. > > Think of it as having a set of work queues: clean, dirty, reading, > writing, write_prepare. The objects need to be able to quickly jump > from one queue to the back of another when the objects internal state > changes. And i

Re: [Caml-list] Bug? Constraints get ignored in methods

2009-03-31 Thread Martin Jambon
Martin Jambon wrote: > Use a classic list: > > > class base = ... > class derived = ... (* inherits base *) > > type obj = Base of base | Derived of derived > > let obj_list = [ Base (new base); Derived (new derived); ... ] > > let iter_base f l = >

Re: [Caml-list] Bug? Constraints get ignored in methods

2009-03-31 Thread Martin Jambon
Goswin von Brederlow wrote: > Hi, > > I want to keep a linked list of structures that have a common subset > of functionality. I thought this would be a good use of ocaml objects. It is not a good use of objects. You'll notice this pretty soon as you'll run into a variety of problems: - polymorp

Re: [Caml-list] questions

2009-03-31 Thread Martin Jambon
Kuba Ober wrote: > There must be some reason why the manual and other materials on the > official site are of such poor quality. I've thought a bit about it, and > the only reason I see is that the authors do not have a feel for what it > takes to learn/understand/use that language. They obviously

Re: [Caml-list] when OO is wrong

2009-03-30 Thread Martin Jambon
Alexy Khrabrov wrote: > What is it about FP which makes modeling simpler than OO, conceptually > and technically? How can folks summarize their "enlightenment" > experiences in this regard? OO is not dirty. Wait until you feel it's the right time and do it safely ;-) Objects and classes tend to

Re: [Caml-list] integer regular expressions

2009-03-30 Thread Martin Jambon
florent.ouc...@imag.fr wrote: > Hello, > > I'm looking for a way to match integer numbers (immediate values), whose > types may be either int, int32, int64 or big_int. A conversion to string > in order to use string (perl compatible) regular expressions is likely > not the solution I'm looking for

Re: [Caml-list] First release of focalize, a development environment for high integrity programs.

2009-03-24 Thread Martin Jambon
David MENTRE wrote: > For those interested in such details, FoCaLize seems to be under a > BSD-like license (I have not made a detailed review of the code). I > would be interested to know if knowledged people (e.g. Debian > developers ;-) consider this code Free Software or not. Let me take the b

Re: [Caml-list] native compilation: no implementation provided for dynlink?

2009-03-17 Thread Martin Jambon
ed it in the latest release of ocamlfind. I'll let you check all of that. Martin > I compiled with 3.12. > > On Mar 17, 2009, at 6:36 PM, Martin Jambon wrote: > >> Joel Reymont wrote: >>> How do I fix this? >> >> Upgrade ocamlfind/findlib

Re: [Caml-list] native compilation: no implementation provided for dynlink?

2009-03-17 Thread Martin Jambon
Joel Reymont wrote: > How do I fix this? Upgrade ocamlfind/findlib for 3.11. > Thanks, Joel > > --- > > + ocamlfind ocamlopt -package 'extlib, dynlink, camlp4.lib' -linkpkg -g > src/easy_ast.cmx src/easy_lexer.cmx src/token.cmx src/static1.cmx > src/easy_parser.cmx src/easy_symtab.cmx src/

Re: [Caml-list] Commuting labeled arguments

2009-03-14 Thread Martin Jambon
Philippe Veber wrote: > Hi all, > > is this behaviour of the type checker expected ? > > Objective Caml version 3.11.0 > > # let f g x y = g ~x ~y;; > val f : (x:'a -> y:'b -> 'c) -> 'a -> 'b -> 'c = > # let g ~y ~x = x + y;; > val g : y:int -> x:int -> int = > # f g;; > Error: This ex

Re: [Caml-list] camlp4: how do you write this rule?

2009-03-11 Thread Martin Jambon
Joel Reymont wrote: > I would like my expression rule to parse "1 + 2 points" as "Plus (1, > Points 2)". > > I currently have the following, with Points right-associative and at the > bottom, but it doesn't work. Is this something that Camlp4 can handle? > > Thanks, Joel > > expr: > [ ...

Re: [Caml-list] ocamllex question

2009-03-10 Thread Martin Jambon
Robert Muller wrote: > I am attempting to use ocamllex together with ocamlyacc to parse a > subset of python. Python uses indentation to denote > statement blocks so a lexer is sometimes required to return a sequence > of tokens without advancing the input pointer. In > particular, a lexer for pyth

Re: [Caml-list] recursive records with weak hashtbl

2009-03-04 Thread Martin Jambon
Vsevolod Fedorov wrote: > Hello! > > I want to define two records referencing each other. First record (A) > has direct reference to second (B) and second (B) has weak hash table to > list records A, which have reference to it. For example (pseudo code): > > type a > { > id : int ; > mutable

Re: [Caml-list] stl?

2009-03-03 Thread Martin Jambon
Brian Hurt wrote: > > > On Tue, 3 Mar 2009, Jon Harrop wrote: > >> Functors give >> you the same capability in OCaml but they are rarely used precisely >> because >> the functionality is not very useful. > > I think I disagree with this. I think functors aren't used very much in > Ocaml becaus

Re: [Caml-list] Using camlp4 syntax extensions in the top-level

2009-02-25 Thread Martin Jambon
David Allsopp wrote: > I'm trying to use json-static in the toplevel (OCaml 3.11.0 / MinGW / > findlib 1.2.4) but I'm getting an error message: > > # #camlp4o;; > C:\Dev\OCaml\lib\dynlink.cma: loaded > C:\Dev\OCaml\lib\camlp4: added to search path > C:\Dev\OCaml\lib\camlp4\camlp4o.cma: loaded >

Re: [Caml-list] speeding up matrix multiplication (newbie question)

2009-02-20 Thread Martin Jambon
Erick Matsen wrote: > Wow, once again I am amazed by the vitality of this list. Thank you > for your suggestions. > > Here is the context: we are interested in calculating the likelihood > of taxonomic placement of short "metagenomics" sequence fragments from > unknown organisms in the ocean. We s

Re: [Caml-list] Hiding private types

2009-02-10 Thread Martin Jambon
David Rajchenbach-Teller wrote: > Dear list, > > I'm looking for a way to remove one or two annoyances of Batteries, > which are related to private magic leaking into the type system and into > the documentation. > > > > We define a module [IO] with, among other things, a type [output]. I

Re: [Caml-list] Warning wished

2009-01-28 Thread Martin Jambon
Julien SIGNOLES wrote: > Hello, > > Is it a bug or a well-known feature that the above program does not emit > a warning (because "f x" should have type unit in the body of "g") ? > > = > let f x = x > let g x = f x; 1 > (* let _ = g 2 *) > The compiler could have a command-line switch

Re: [Caml-list] Making a polymorphic type non-polymorphic to comply with original signature

2009-01-20 Thread Martin Jambon
Hugo Ferreira wrote: > Hello, > > I have the following definition: > > module rec H : > sig > type 'a node = > | Node of 'a node J.t > | Leaf of 'a > > type 'a t = 'a node > val equal : 'a t -> 'a t -> bool > val hash : 'a t -> int > end = > struct >

Re: [Caml-list] What is a future of ocaml?

2009-01-14 Thread Martin Jambon
Dawid Toton wrote: > (say, following is a collection of dreams :)) > > Is there any hope for a grand 'OCaml 4' release that would iron out the > last ugly spots left in the language with some breaking changes? ^^ Hahaha. (the rest of

Re: [Caml-list] Parsing simple type expressions

2009-01-06 Thread Martin Jambon
David Allsopp wrote: > ocamlyacc - you can get most of it for free out of parsing/parser.mly in the > OCaml sources... the section on type expressions starts at line 1144 for > OCaml 3.11.0. Our json-wheel library is a complete example: http://martin.jambon.free.fr/json-wheel.html Martin >>

Re: [Caml-list] Computing with big numbers?

2008-12-04 Thread Martin Jambon
Florian Hars wrote: > Alan Schmitt schrieb: >> But I don't think this applies here, as the hashes I'm >> looking at are the one used by Unison to identify file contents. > > Then it is *especially* relevant, as it is quite trivial to generate > several files with different content and the same MD

Re: [Caml-list] Computing with big numbers?

2008-12-01 Thread Martin Jambon
Alan Schmitt wrote: > Hello, > > In preparation for a talk I'm going to give, I wanted to estimate how > good 128 bits MD5 hashes were: how many hashes must be taken before the > probability for a collision become non negligible? (I'm assuming > equi-probability of every hash.) > > The brute forc

Re: [Caml-list] Ocaml 3.01 and camlp4 syntax?

2008-11-12 Thread Martin Jambon
Erik de Castro Lopo wrote: > Hi all, > > Mostly out of curiosity, I'm having a look at the efuns Emacs > clone written in Ocaml: > > http://pauillac.inria.fr/cdrom/prog/unix/efuns/eng.htm > > and trying to compile it with a recent Ocaml compiler like 3.10.2. > >>From the files, it seems tha

Re: [Caml-list] Hiding a public module/type?

2008-11-03 Thread Martin Jambon
David Teller wrote: > Dear list, > > In order to simplify the error messages for users of my library, I'd > like to hide some type aliasing. > > I have the following: > > (*** module [Inner], defined in inner.mli ***) > type t > > > (*** module [Outer], defined in outer.mli ***) > type t

Re: [Caml-list] understanding weak

2008-10-31 Thread Martin Jambon
Aleksey Nogin wrote: > On 31.10.2008 07:57, Martin Jambon wrote: > >> let x = (1, 2);; >> let wa = Weak.create 10;; >> Weak.set wa 0 (Some x);; >> ... >> print_int (fst x);; >> >> (fst x) would certainly cause funny effects if x were GC'ed a

Re: [Caml-list] understanding weak

2008-10-31 Thread Martin Jambon
Aleksey Nogin wrote: > On 31.10.2008 07:57, Martin Jambon wrote: > >> let x = (1, 2);; >> let wa = Weak.create 10;; >> Weak.set wa 0 (Some x);; >> ... >> print_int (fst x);; >> >> (fst x) would certainly cause funny effects if x were GC'ed a

Re: [Caml-list] understanding weak

2008-10-31 Thread Martin Jambon
Daniel Bünzli wrote: > > Le 31 oct. 08 à 15:57, Martin Jambon a écrit : > >> (fst x) would certainly cause funny effects if x were GC'ed at an >> arbitrary time after it has been added to the weak array. > > You are confusing reclaiming the weak pointer (the S

Re: [Caml-list] understanding weak

2008-10-31 Thread Martin Jambon
Daniel Bünzli wrote: > > Le 31 oct. 08 à 03:14, Martin Jambon a écrit : > >> Warren Harris wrote: >>> I'd like to understand better how ocaml's weak pointers operate. First, >>> although it doesn't seem to be specified in the documentation, I assum

Re: [Caml-list] understanding weak

2008-10-30 Thread Martin Jambon
Warren Harris wrote: > I'd like to understand better how ocaml's weak pointers operate. First, > although it doesn't seem to be specified in the documentation, I assume > that weak pointers will *not* be reclaimed (e.g. from a weak hash table) > if the program retains some other reference to the ob

Re: Indentation (was Re: [Caml-list] What does Jane Street use/want for an IDE? What about you?)

2008-10-26 Thread Martin Jambon
Daniel Bünzli wrote: > > Le 26 oct. 08 à 01:08, Martin Jambon a écrit : > >> In performance-critical code or maybe imperative code in general, it >> feels good to control when closures are created. In such cases, avoiding >> local functions helps. > > Just t

Indentation (was Re: [Caml-list] What does Jane Street use/want for an IDE? What about you?)

2008-10-25 Thread Martin Jambon
Daniel Bünzli wrote: > > Le 25 oct. 08 à 14:43, Martin Jambon a écrit : > >> Now I generally tend to use this: >> >> let x = >> List.map ( >>fun z -> >> very_blabla >> ... >> ) my_list >> in > > I think t

Re: [Caml-list] What does Jane Street use/want for an IDE? What about you?

2008-10-25 Thread Martin Jambon
DooMeeR wrote: > Another possibility is: > > let x = List.map begin fun z -> > very_blabla > end my_list in > > It's quite compact, doesn't run into the margin, is consistent with > tuareg, but might be less readable. Now I generally tend to use this: let x = List.map ( fun z -> ve

Re: [Caml-list] What does Jane Street use/want for an IDE? What about you?

2008-10-20 Thread Martin Jambon
Kuba Ober wrote: > I have questions to the kind folks at Jane Street, > and others who use OCaml for commercial/non-research > development: what do you guys use for your development > environment? What would be the minimal set of functionality > that would make you happy for an IDE? What are killer

Re: [Caml-list] Syntax highlighting and Ocaml/PHP integration

2008-10-01 Thread Martin Jambon
On Wed, 1 Oct 2008, Dario Teixeira wrote: P.S. Another (possibly far-fetched) solution is to take advantage of the syntax highlighting capabilities of Vim or Emacs. Something along the lines of embedding or remotely invoking one of these editors, with the sole purpose of asking

Re: [Caml-list] mutually dependent class and type

2008-09-25 Thread Martin Jambon
On Fri, 26 Sep 2008, Sébastien Hinderer wrote: Dear list, Is there a (clean) way to define simultaneously a class and a type that are mutually recursive ? I don't think so, but you don't have to. Something like this : class element (c : content) = object ... end and type content = | Data

[Caml-list] Dum: dumper module with cycle detection

2008-09-22 Thread Martin Jambon
Hi list, Wink.com is releasing a module called Dum for dumping data. It derives from Dumper by Richard W Jones (now Std.dump in Extlib) and from Size by Jean-Christophe Filliatre. http://oss.wink.com/dum/ The main improvement over the original Dumper is that shared values and therefore cycl

Re: [Caml-list] Ocaml type with constraints?

2008-09-21 Thread Martin Jambon
On Mon, 22 Sep 2008, Andrej Bauer wrote: Angela Zhu wrote: Hi, I want to define an OCaml type with constraints. For example: type item = Item of int * float;; If here this float type is for price of some item, and I want to make sure it is positive. In other words, if x = (xi, xf) of type it

Re: [Caml-list] How to join ocaml-tutorial.org?

2008-09-01 Thread Martin Jambon
On Sun, 31 Aug 2008, Richard Jones wrote: On Sun, Aug 31, 2008 at 03:40:42PM +0200, Martin Jambon wrote: Is it possible to create new user accounts to edit the OCaml tutorial at http://ocaml-tutorial.org/ ? http://ocaml-tutorial.org/_login says "This site is only available for u

[Caml-list] How to join ocaml-tutorial.org?

2008-08-31 Thread Martin Jambon
Hi list, Is it possible to create new user accounts to edit the OCaml tutorial at http://ocaml-tutorial.org/ ? http://ocaml-tutorial.org/_login says "This site is only available for use to registered members. If you believe that you should be a member of this site, please contact the administr

Re: [Caml-list] Specifying recursive modules?

2008-08-20 Thread Martin Jambon
On Wed, 20 Aug 2008, Jérémie Lumbroso wrote: Hello, I'd always thought of separating specification and definition as simply not possible in OCaml, but OCaml's reference manual (3.10, which is, as far as I can tell, the most recent version of the documentation) seems to contradict my assumption:

Re: [Caml-list] Why is this coercion necessary?

2008-08-14 Thread Martin Jambon
On Wed, 13 Aug 2008, Jacques Carette wrote: Here is a much simplified version from a (much) larger problem I have recently encountered: type 'a a = [`A of 'a b] and 'a b = [`B of 'a a] and 'a c = [`C ] type 'a d = [ 'a a | 'a b | 'a c] type e = e d # this code gives an error (details below

Re: [Caml-list] Released Mikmatch 1.0.0 and Micmatch 1.0.0

2008-07-28 Thread Martin Jambon
On Mon, 28 Jul 2008, SerP wrote: Martin Jambon wrote: Hi list, I am pleased to announce the availability of Micmatch for the new Camlp4. The new package is called "Mikmatch", with a K. "Micmatch" with a C refers to the original implementation which now uses Camlp5.

[Caml-list] Released Mikmatch 1.0.0 and Micmatch 1.0.0

2008-07-26 Thread Martin Jambon
Hi list, I am pleased to announce the availability of Micmatch for the new Camlp4. The new package is called "Mikmatch", with a K. "Micmatch" with a C refers to the original implementation which now uses Camlp5. http://martin.jambon.free.fr/micmatch.html or GODI if you want to jump direc

Re: [Caml-list] Another question about modules

2008-07-15 Thread Martin Jambon
On Tue, 15 Jul 2008, Andre Nathan wrote: Hi I've run this: ocamlc -c a.mli ocamlc -c b.mli ocamlopt -c a.ml The third command gives the error. I thought that the circular dependency problem was related only to mutually-dependent types on separate modules, but I guess I was wrong. Searching t

Re: [Caml-list] Mutually recursive types in different modules

2008-07-14 Thread Martin Jambon
On Mon, 14 Jul 2008, Andre Nathan wrote: Hello Say I have the following type definition: type a = { x: int; foo: b } and b = { y: int; bar: a } Is it possible to define types a and b in their own files (thus in modules A and B) and still allow them to be mutually recursive? No. The usual

Easy-format 1.0.0 (Re: [Caml-list] New library: Easy-format 0.9.0)

2008-07-13 Thread Martin Jambon
I've just released a richer version of Easy-format. The main URL is still http://martin.jambon.free.fr/easy-format.html It now offers the following additional features: - Support for separators that stick to the next list item (e.g. "|") - More wrapping options - Added Custom kind of nodes for u

[Caml-list] New library: Easy-format 0.9.0

2008-07-09 Thread Martin Jambon
Hi list, I would like to announce a small library (a module in fact) that is meant to make it easy to produce pretty-printed text: http://martin.jambon.free.fr/easy-format.html The data to be printed goes through a tree that carries all the information required for pretty-printing. After t

[Caml-list] ocamlhackers.ning.com is open

2008-06-26 Thread Martin Jambon
I couldn't resist creating an OCaml social network at Ning: http://ocamlhackers.ning.com/ It's free and easy. Allows you to have your OCaml blog and exclusively OCaml friends. If you like this, join now :-) Martin -- http://wink.com/profile/mjambon http://mjambon.com/ __

  1   2   >