[Caml-list] Revised syntax scope (3.10 vs. 3.11)

2009-03-26 Thread Andre Nathan
Hello I've found the following difference of behavior between OCaml 3.10 and 3.11. The code below <:expr< do { let a = "foo" in print_endline a; print_endline a } >> when run through camlp4o becomes, in 3.10, let a = "foo" in (print_endline a; print_endline a) w

[Caml-list] Re: Récursivité terminale

2009-03-26 Thread Chung-chieh Shan
(So that's how you say "tail-recursive" in French...) Xavier Leroy wrote in article <49cb9854.1020...@inria.fr> in gmane.comp.lang.caml.inria: > A technique that always works is to convert your function to > continuation-passing style. The resulting code is hard to read and > not particularly e

Re: [Caml-list] Toplevel with camlp4

2009-03-26 Thread Andre Nathan
On Thu, 2009-03-26 at 22:15 -0400, Peng Zang wrote: > Are you using OCaml 3.10? I recall there's a bug that doesn't let you #use > more than once due to bad file descriptors. It's been fixed in 3.11 That was it. Thanks! Andre ___ Caml-list mailing l

Re: [Caml-list] Toplevel with camlp4

2009-03-26 Thread Peng Zang
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Are you using OCaml 3.10? I recall there's a bug that doesn't let you #use more than once due to bad file descriptors. It's been fixed in 3.11 Peng On Thursday 26 March 2009 09:59:20 pm Andre Nathan wrote: > Hello > > I have the simple program bel

[Caml-list] Toplevel with camlp4

2009-03-26 Thread Andre Nathan
Hello I have the simple program below: let () = Sys.interactive := false; Toploop.initialize_toplevel_env (); for i = 1 to (Array.length Sys.argv) - 1 do ignore (Toploop.use_file Format.std_formatter Sys.argv.(0)) done which works fine when compiled with $ ocamlc -o a

Re: [Caml-list] printf "%a" vs sprintf "%a"

2009-03-26 Thread Tiphaine Turpin
Thanks for the replies. sprintf2 is just fine for me. Tiphaine Jérémie Dimino a écrit : > Tiphaine Turpin wrote: > >> has type string. But %a breaks this rule. Wouldn't it be simpler to have >> two separate directives which accept respectively string printers and >> channel printers, regardle

Re: [Caml-list] printf "%a" vs sprintf "%a"

2009-03-26 Thread Jérémie Dimino
Tiphaine Turpin wrote: > has type string. But %a breaks this rule. Wouldn't it be simpler to have > two separate directives which accept respectively string printers and > channel printers, regardless of the outer printing function ? Note that you can do it with batteries and the new printf. The

Re: [Caml-list] printf "%a" vs sprintf "%a"

2009-03-26 Thread David Rajchenbach-Teller
Yeah, the behaviour of *printf is weird in this respect (and that of Extlib's printf is even a tad worse). For this reason, in Batteries Included, we have Printf.sprintf (which behaves as the base Printf.sprintf) and Printf.sprintf2 (which behaves as you expected) All of this in addition to ou

[Caml-list] printf "%a" vs sprintf "%a"

2009-03-26 Thread Tiphaine Turpin
Hi, I'am confused by the interpretation of "%a": # Printf.printf "%a";; - : (out_channel -> '_a -> unit) -> '_a -> unit = # Printf.sprintf "%a";; - : (unit -> '_a -> string) -> '_a -> string = Usually, the typing of formatting functions is such that printf something has type unit if and only

Re: [Caml-list] Récursivité terminale

2009-03-26 Thread Xavier Leroy
Je voudrais savoir s'il existait un moyen de transformer une fonction récursive non terminale en fonction récursive terminale avec Caml. [ Translation: is there a way to transform a non-tail-recursive function into a tail-recursive function? ] A technique that always works is to convert you

[Caml-list] Récursivité terminale

2009-03-26 Thread David . Bulone
Bonjour, Je voudrais savoir s'il existait un moyen de transformer une fonction récursive non terminale en fonction récursive terminale avec Caml. ___ Caml-list mailing list. Subscription management: http://yquem.inria.fr/cgi-bin/mailman/listinf

Re: [Caml-list] qt / windows gui

2009-03-26 Thread Richard Jones
On Wed, Mar 25, 2009 at 02:00:18PM +, Joel Reymont wrote: > Are there OCaml bindings for QT? > > Would OCaml + QT be a good option for a Windows app? What's wrong with Gtk for this? It now supports native Mac widgets via: http://live.gnome.org/GTK%2B/OSX We also have a very thorough set of

[Caml-list] CFP: DML 2009--Towards a Digital Mathematics Library, Ontario, CA, Jul 8-9th

2009-03-26 Thread dml2009
Call for papers: Towards a Digital Mathematics Library (DML 2009) July 8-9th, 2009, Ontario, CA c/o CICM 2009 Workshop webpage: http://www.fi.muni.cz/~sojka/dml-2009.html Deadlines: April 29th: abstract submissions May 4th: paper submissions May 22nd: paper acceptance/reje