Hi, I'd like to share a camlp4 syntax extension: pa_scope [1]. It's very similar to Alain Frisch's openin [2]. I made yet another one because I need a...
Zheng Li
li@...
May 3, 2008 12:16 am
9709
Hi, I'd like to share another camlp4 syntax extension: pa_use [1]. It's a simulation of F#'s "use" binding syntax. You're welcome to try it and feedback your...
Zheng Li
li@...
May 4, 2008 1:23 am
9710
Hi there, I know quite little about the underlying mechanics of camlp4. My basic intuition is that it's like a top-down pattern matcher. So I don't understand...
... [...] ... Because naked strings like "item" or "todo" in your example add reserved words to the language, and like all other reserved words (eg. "type",...
Hi Richard, ... Thanks for the hint. I figured this out lately, though it's against my intuition. I used to think that keywords should be created explicitly ...
... Yes, that's how a normal lex/yacc parser would work, but not camlp4. I don't pretend to know the implementation details though ... Rich. -- Richard Jones ...
Hi, I am trying to learn how to optimize my Ocaml programms, what can be done, what is usefull etc... Today I had a little look at quicksort... First I tried...
... Yes, your quicksort implementation looks nice, but it has a much worse runtime than you might think. O(n^2*log n) I think ... When I first looked at this,...
So if I install Visual Studio 2005 and MASM32, can I compile with ocamlopt to native code? Will it also work with Visual Studio 2008 and MASM32? Martin ... ...
... I think so --- last time I looked into this, I think I was using VS2003 + some version of MASM that you had to extract from a "secret" MS download. It was...
... This is actually at least O(n^3) because of the way OCaml's run-time handles deep recursion. ... That can be written: let ( -:- ) x y l = x (y l) ... That...
Dear all, Is additional anything needed to compile my sources using extlib rather than this? ocamlopt -o redsonja_ext.exe -I `ocamlfind query extlib` unix.cmxa...
Andreas Romeyke
romeyke@...
May 6, 2008 8:23 am
9720
Hi, Am Tue, 6 May 2008 10:23:12 +0200 ... In the sources of extlib there was the reason described: add "open ExtLib" on top of file, compile it with: ocamlopt...
Andreas Romeyke
romeyke@...
May 6, 2008 9:43 am
9721
... It's probably easier to do: ocamlfind ocamlopt -o foo.exe -package extlib -linkpkg foo.ml Note that the ocamlfind -package ... syntax also finds dependent ...
Hi, I'd like to share another camlp4 extension pa_cexp [1]. It backports F#¡¯s computation expression to OCaml, which helps you to write monadic expression...
Zheng Li
li@...
May 6, 2008 2:32 pm
9723
Hi, I use following function to combine two lists of integer lists. How could I optimize the function not to build a large temporary list? At the moment there...
Andreas Romeyke
romeyke@...
May 6, 2008 4:09 pm
9724
On Tue, 6 May 2008 18:09:07 +0200, Andreas Romeyke wrote ... One way is to use streams, which will only construct as much of the stream as is necessary for...
Hi, ... As William said, you should consider using a lazy data structure like stream. There's one point I'd like to add: you can use the Sdflow library which...
Zheng Li
li@...
May 6, 2008 9:08 pm
9726
Hi ! I propose the code below, a functional trial without laziness/streams. Processing the list product "by step", I don't think to eat a lot of memory. Inside...
Hi, Thanks to all for your suggestions... Am Tue, 06 May 2008 23:22:08 +0200 ... How could the problem encoded using pure Ocaml? How useful could be the ...
Andreas Romeyke
romeyke@...
May 7, 2008 7:35 am
9728
... If you want Sdflow added to Linux, here's how to go about it (this process applies to any OCaml module): (1) File Request-for-package bugs at: Debian:...
On Wed, 7 May 2008 09:35:36 +0200, Andreas Romeyke wrote ... Camlp4, which I used in my stream example is a part of the official base distribution. And if you...
Hi, Am Wed, 7 May 2008 08:00:55 -0500 ... Thanks for your explanations. I will try to learn more about Streams and Camlp4 as soon as possible. I 've just...
Andreas Romeyke
romeyke@...
May 7, 2008 1:18 pm
9731
On Wed, 7 May 2008 15:18:21 +0200, Andreas Romeyke wrote ... I understand that -- dealing with potentially new concepts like streams on dataflow while still...
Hi, I just updated pa_scope [1] to version 0.02. Now we have syntax for both open-scope and close-scope: * open-scope: M @ expr which opens the module "M" from...
Zheng Li
li@...
May 7, 2008 3:03 pm
9733
On Wed, 7 May 2008 09:35:36 +0200, Andreas Romeyke wrote ... By the way, I had one of those head slapping moments this morning when I realized that you could...
Hello, ... Indeed. ... I agree it's not as easy as it looks like, especially if you want a generic (for $n$ dimension) purely functional and tail recursive ...
Zheng Li
li@...
May 7, 2008 3:44 pm
9735
Hi all. Is there something analogous to ld's stack_size option in OCaml? One can set the stack size through the operating system command ulimit -s, but it...
Hi, I have a module as an implementation file .ml from which I get the .mli interface with ocamlc -i. And I would like to get ocamldoc documentation without...
Florent Monnier
fmonnier@...
May 7, 2008 10:00 pm
9737
Hi William, Am Wed, 7 May 2008 10:10:33 -0500 ... Your solution is quite impressive. It is faster than all variants before and does not occupy so much memory. ...