[Caml-list] Re: The need to specify 'rec' in a recursive function defintion

2010-02-16 Thread Stefan Monnier
 It sure does, tho not with fun but only with var definitions.
  ^^^
  val

Stefan blush!

___
Caml-list mailing list. Subscription management:
http://yquem.inria.fr/cgi-bin/mailman/listinfo/caml-list
Archives: http://caml.inria.fr
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
Bug reports: http://caml.inria.fr/bin/caml-bugs


Re: [Caml-list] Re: The need to specify 'rec' in a recursive function defintion

2010-02-16 Thread Ashish Agarwal
It may be worth recalling the OCaml koans at
http://eigenclass.org/hiki/fp-ocaml-koans. The first one is:
let rec

One day, a disciple of another sect came to Xavier Leroy and said mockingly:

The OCaml compiler seems very limited: why do you have to indicate when a
function is recursive, cannot the compiler infer it?

Xavier paused for a second, and replied patiently with the following story:

One day, a disciple of another sect came to Xavier Leroy and said
mockingly...



On Tue, Feb 16, 2010 at 9:42 AM, Stefan Monnier monn...@iro.umontreal.cawrote:

  It sure does, tho not with fun but only with var definitions.
   ^^^
  val

Stefan blush!

 ___
 Caml-list mailing list. Subscription management:
 http://yquem.inria.fr/cgi-bin/mailman/listinfo/caml-list
 Archives: http://caml.inria.fr
 Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
 Bug reports: http://caml.inria.fr/bin/caml-bugs

___
Caml-list mailing list. Subscription management:
http://yquem.inria.fr/cgi-bin/mailman/listinfo/caml-list
Archives: http://caml.inria.fr
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
Bug reports: http://caml.inria.fr/bin/caml-bugs


WAS Re: [Caml-list] Re: The need to specify 'rec' in a recursive function defintion

2010-02-16 Thread Grant Rettke
On Tue, Feb 16, 2010 at 10:21 AM, Ashish Agarwal agarwal1...@gmail.com wrote:
 let rec

Do OCaml'er look at let rec more as being a message to the programmer,
rather than the compiler, that the way I want to define this function
is recursively so even if 'f' was previously bound you know which one
I mean?

Considering the language allows mutation, I feel like it is more for
humans than the compiler, but of course, the compiler must be told,
too.

___
Caml-list mailing list. Subscription management:
http://yquem.inria.fr/cgi-bin/mailman/listinfo/caml-list
Archives: http://caml.inria.fr
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
Bug reports: http://caml.inria.fr/bin/caml-bugs


Re: WAS Re: [Caml-list] Re: The need to specify 'rec' in a recursive function defintion

2010-02-16 Thread Jon Harrop
On Tuesday 16 February 2010 16:47:03 Grant Rettke wrote:
 On Tue, Feb 16, 2010 at 10:21 AM, Ashish Agarwal agarwal1...@gmail.com 
wrote:
  let rec

 Do OCaml'er look at let rec more as being a message to the programmer,
 rather than the compiler, that the way I want to define this function
 is recursively so even if 'f' was previously bound you know which one
 I mean?

I see it as resolving an ambiguity for both the programmer and compiler. There 
are alternatives as others have mentioned but none seem particularly good or 
bad to me. Moreover, the burden of rec is tiny so I don't think it is worth 
discussing in such detail.

-- 
Dr Jon Harrop, Flying Frog Consultancy Ltd.
http://www.ffconsultancy.com/?e

___
Caml-list mailing list. Subscription management:
http://yquem.inria.fr/cgi-bin/mailman/listinfo/caml-list
Archives: http://caml.inria.fr
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
Bug reports: http://caml.inria.fr/bin/caml-bugs


[Caml-list] Looking for a translator for the pipes chapter of the OCaml unix course

2010-02-16 Thread Daniel Bünzli
Hello,

Due to the unexpected withdrawal of a translator we are looking for a
native english speaker willing to translate the pipes chapter of the
OCaml unix course [1].

For details about the project I refer to the original call for
translators which can be found here [2].

Please contact me directly with the expected timeframe you hope to
achieve for the translation.

Best,

Daniel

[1] http://ocamlunix.forge.ocamlcore.org/pipes.html
[2] http://forge.ocamlcore.org/forum/forum.php?forum_id=366

___
Caml-list mailing list. Subscription management:
http://yquem.inria.fr/cgi-bin/mailman/listinfo/caml-list
Archives: http://caml.inria.fr
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
Bug reports: http://caml.inria.fr/bin/caml-bugs


Re: [Caml-list] Looking for a translator for the pipes chapter of the OCaml unix course

2010-02-16 Thread Richard Jones
On Tue, Feb 16, 2010 at 06:19:04PM +0100, Daniel Bünzli wrote:
 [1] http://ocamlunix.forge.ocamlcore.org/pipes.html

On a completely unrelated note, that is the best looking
hevea-translated TeX document I've ever seen.  Is it all done through
choosing a good HTML stylesheet?

Rich.

-- 
Richard Jones
Red Hat

___
Caml-list mailing list. Subscription management:
http://yquem.inria.fr/cgi-bin/mailman/listinfo/caml-list
Archives: http://caml.inria.fr
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
Bug reports: http://caml.inria.fr/bin/caml-bugs


Re: [Caml-list] Looking for a translator for the pipes chapter of the OCaml unix course

2010-02-16 Thread Daniel Bünzli
 On a completely unrelated note, that is the best looking
 hevea-translated TeX document I've ever seen.

Thanks.

 Is it all done through choosing a good HTML stylesheet ?

Yes mostly. But some environment are redefined specially for html
output. If you want to have a look everything is in that file [1]
which overrides that one [2] used for pdf output. In the source
itself, except for cut names to give meaningful links for chapter
pages, there's very few html/pdf specific code.

Best,

Daniel

[1] 
http://darcs.ocamlcore.org/cgi-bin/darcsweb.cgi?r=ocamlunix;a=headblob;f=/src/prelude.hva
[2] 
http://darcs.ocamlcore.org/cgi-bin/darcsweb.cgi?r=ocamlunix;a=headblob;f=/src/prelude.sty

___
Caml-list mailing list. Subscription management:
http://yquem.inria.fr/cgi-bin/mailman/listinfo/caml-list
Archives: http://caml.inria.fr
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
Bug reports: http://caml.inria.fr/bin/caml-bugs


[Caml-list] Embedding OCaml - manual not up to date.

2010-02-16 Thread Guillaume Yziquel

Hi.

The manual is not up to date when it comes to embedding OCaml code into 
C code.


http://caml.inria.fr/pub/docs/manual-ocaml/manual032.html#toc134

Specifically the section

18.7.5  Embedding the Caml code in the C code

and the piece of compilation code I'm having trouble with is the following:


ocamlopt -output-obj -o camlcode.o unix.cmxa other .cmx and .cmxa files
cc -o myprog C objects and libraries \
   camlcode.o -L/usr/local/lib/ocaml -lunix -lasmrun


This code complains about missing symbols from pervasives.

So I adapt it by compiling with pervasives.cmx, and I get


ocamlopt -output-obj -o camlcode.o pervasives.cmx
ld: /usr/lib/ocaml/pervasives.o: No such file: No such file or directory
File caml_startup, line 1, characters 0-1:
Error: Error during linking
make: *** [camlcode.o] Erreur 


But I cannot find pervasives.o anywhere.

--
 Guillaume Yziquel
http://yziquel.homelinux.org/

___
Caml-list mailing list. Subscription management:
http://yquem.inria.fr/cgi-bin/mailman/listinfo/caml-list
Archives: http://caml.inria.fr
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
Bug reports: http://caml.inria.fr/bin/caml-bugs


[Caml-list] Re: Embedding OCaml - manual not up to date.

2010-02-16 Thread Guillaume Yziquel

Guillaume Yziquel a écrit :

Hi.

The manual is not up to date when it comes to embedding OCaml code into 
C code.


http://caml.inria.fr/pub/docs/manual-ocaml/manual032.html#toc134

Specifically the section

18.7.5  Embedding the Caml code in the C code

and the piece of compilation code I'm having trouble with is the following:

ocamlopt -output-obj -o camlcode.o unix.cmxa other .cmx and 
.cmxa files

cc -o myprog C objects and libraries \
   camlcode.o -L/usr/local/lib/ocaml -lunix -lasmrun


This code complains about missing symbols from pervasives.

So I adapt it by compiling with pervasives.cmx, and I get


ocamlopt -output-obj -o camlcode.o pervasives.cmx
ld: /usr/lib/ocaml/pervasives.o: No such file: No such file or directory
File caml_startup, line 1, characters 0-1:
Error: Error during linking
make: *** [camlcode.o] Erreur 


But I cannot find pervasives.o anywhere.


Well I found it in stdlib.a, but looking back at the thread started by 
Aaron Bohannon mid-december


http://caml.inria.fr/pub/ml-archives/caml-list/2009/12/3375527140f0de987a9dc6d2553990c8.en.html

it seems to me that there is little need for the -output-obj option, as 
shown in the manual. Why not document the embedding by simply compiling 
the C code tha provides the main function, which itself calls 
caml_startup, and then linking it with the .cmx with ocamlopt? Why the 
need for -output-obj, libasmrun.a, etc...?


--
 Guillaume Yziquel
http://yziquel.homelinux.org/

___
Caml-list mailing list. Subscription management:
http://yquem.inria.fr/cgi-bin/mailman/listinfo/caml-list
Archives: http://caml.inria.fr
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
Bug reports: http://caml.inria.fr/bin/caml-bugs