sponge45 changed the topic of #ocaml to: Discussions about the OCaml programming language | http://caml.inria.fr/
mbishop has joined #ocaml
mbishop has quit [Remote closed the connection]
mbishop has joined #ocaml
mbishop has quit [Remote closed the connection]
b00t has joined #ocaml
sponge45 has joined #ocaml
Smerdyakov has joined #ocaml
piggybox has joined #ocaml
b00t has quit [Remote closed the connection]
david_koontz has quit [Read error: 110 (Connection timed out)]
Smerdyakov has quit ["Leaving"]
Mr_Awesome has joined #ocaml
<Mr_Awesome>
does tuareg mode for emacs not support syntax highlighting in file buffers, or am i insane?
<sponge45>
you must be insane :-)
<Mr_Awesome>
is there a way to turn it on, or something?
<sponge45>
I don't know. I can send you my .emacs if you want.
<Mr_Awesome>
that would be awesome
<sponge45>
It's very complicated, and I am not the original author, you are warned.
<sponge45>
Did you get it?
<Mr_Awesome>
yeah, thanks :)
<sponge45>
good luck then!
<sponge45>
bye
sponge45 has quit ["zzzzzzzzzz"]
johnnowak has joined #ocaml
b00t has joined #ocaml
rillig has quit ["exit(EXIT_SUCCESS)"]
stevan_ has joined #ocaml
stevan has quit [Read error: 113 (No route to host)]
johnnowak has quit []
gim has quit [Remote closed the connection]
Mr_Awesome has quit ["...and the Awesome level drops"]
Z4rd0Z has quit []
pstickne_ is now known as pstickne
david_koontz has joined #ocaml
shawn has quit [Remote closed the connection]
_velco has joined #ocaml
shawn has joined #ocaml
shawn has quit [Remote closed the connection]
pango is now known as pangoafk
jlouis has quit [Remote closed the connection]
asmanian has joined #ocaml
love-pingoo has joined #ocaml
velco has joined #ocaml
david_koontz has quit ["Leaving"]
Smerdyakov has joined #ocaml
lmbdwr has joined #ocaml
piggybox has quit [Connection reset by peer]
piggybox has joined #ocaml
Submarine has quit [Remote closed the connection]
Smerdyakov has quit ["Leaving"]
johnnowak has joined #ocaml
b00t has quit [Remote closed the connection]
Z4rd0Z has joined #ocaml
hmmmmmm has joined #ocaml
johnnowak has quit []
love-pingoo has quit ["Leaving"]
<lmbdwr>
what means the _ label in ocaml ?
<stevan_>
lmbdwr: it tells Ocaml that you don't care about that variable
stevan_ is now known as stevan
<lmbdwr>
stevan, but then what does it mean to have a : let _ = ...
<lmbdwr>
and many of that in a single file
<lmbdwr>
(after the let beeing code of func)
<lmbdwr>
beeing a subprogram, basicaly
<stevan>
lmbdwr: I don't know the exact reason or origin for that idiom, but basically it is saying that you don't care about capturing the return value of the let block
asmanian has quit ["Verlassend"]
<lmbdwr>
stevan, ok thanks :)
<flux->
methinks it's to avoid an extra level of indentation with for example emacs :-)
<flux->
however, it's also useful if you don't wan't to use ';;', ever
<flux->
the idiom I follow is let main args = .. let _ = main (List.tail (Array.to_list Sys.argv))
ikaros has quit [Read error: 110 (Connection timed out)]
ikaros has joined #ocaml
love-pingoo has joined #ocaml
asmanian has joined #ocaml
love-pingoo has quit ["Connection reset by pear"]
asmanian has quit [Remote closed the connection]
<lmbdwr>
what is the best way to do a List.map using a function that takes extra parameters ?
<lmbdwr>
(not only the list of elements to apply the function on)
<haelix>
lmbdwr: curry that function, so the extra parameters are set
<haelix>
and pass the resulting function to List.map
slipstream-- has joined #ocaml
velco has quit ["Ex-Chat"]
<lmbdwr>
haelix, can you give an example of map using currified function in ocaml syntax ? I dont find it in ocaml manual/google
<haelix>
there's the function:
<haelix>
let add x y = x + y;;
<haelix>
we will map it:
<haelix>
List.map (add 2) [1;2;3];;
<haelix>
- : int list = [3; 4; 5]
<haelix>
or
<haelix>
let add_2 = add 2;;
<haelix>
List.map add_2 [1;2;3];;
<haelix>
add_2 _is_ a function
slipstream has quit [Connection timed out]
bluestorm has joined #ocaml
<lmbdwr>
haelix, hum :) ok, very nice
<lmbdwr>
the problem is that I dont have such constants '2' as my extra parameter is an environment
<lmbdwr>
and I cannot obviously have as much curryfied functions as I have environments
<lmbdwr>
I guess I have to do a recursive function instead of using a map