gildor changed the topic of #ocaml to: Discussions about the OCaml programming language | http://caml.inria.fr/ | OCaml 3.12.0 http://bit.ly/aNZBUp
ulfdoz_ has joined #ocaml
ulfdoz has quit [Ping timeout: 244 seconds]
ulfdoz_ is now known as ulfdoz
__marius__ has joined #ocaml
__marius__ has quit [Remote host closed the connection]
__marius__ has joined #ocaml
__marius__ has quit [Remote host closed the connection]
Smerdyakov has quit [Quit: Leaving]
lamawithonel__ has quit [Remote host closed the connection]
lamawithonel__ has joined #ocaml
sepp2k has quit [Quit: Leaving.]
lamawithonel__ has quit [Remote host closed the connection]
lamawithonel__ has joined #ocaml
lamawithonel__ has quit [Ping timeout: 255 seconds]
lamawithonel has joined #ocaml
lamawithonel_ has joined #ocaml
lamawithonel has quit [Ping timeout: 255 seconds]
joewilliams_away is now known as joewilliams
lamawithonel_ has quit [Excess Flood]
lamawithonel_ has joined #ocaml
lamawithonel__ has joined #ocaml
lamawithonel_ has quit [Ping timeout: 255 seconds]
lamawithonel__ has quit [Excess Flood]
lamawithonel__ has joined #ocaml
lamawithonel__ has quit [Excess Flood]
lamawithonel__ has joined #ocaml
joewilliams is now known as joewilliams_away
lamawithonel has joined #ocaml
lamawithonel__ has quit [Ping timeout: 246 seconds]
lamawithonel has quit [Excess Flood]
lamawithonel has joined #ocaml
dnolen has quit [Quit: dnolen]
alfa_y_omega has quit [Read error: Operation timed out]
vivanov has joined #ocaml
alfa_y_omega has joined #ocaml
vivanov has quit [Quit: Lost terminal]
vivanov has joined #ocaml
vivanov has quit [Ping timeout: 246 seconds]
vivanov has joined #ocaml
jmcarthur has quit [Ping timeout: 250 seconds]
alexyk has joined #ocaml
Tommytom has joined #ocaml
<Tommytom> Hello, just one question, how can I close permanently a socket, not shutdown.
axiles has joined #ocaml
Tommytom has quit [Quit: http://irc2go.com/]
Tommytom has joined #ocaml
<Tommytom> Nobody ?
Snark has joined #ocaml
Tommytom has quit [Ping timeout: 240 seconds]
alexyk has quit [Quit: alexyk]
Snark has quit [Quit: Ex-Chat]
edwin has joined #ocaml
<flux> Unix.close would have been the answer :)
ztfw has joined #ocaml
iratsu1 has quit [Ping timeout: 246 seconds]
vivanov has quit [Read error: Connection reset by peer]
vivanov_ has joined #ocaml
avsm has joined #ocaml
vivanov_ has quit [Ping timeout: 276 seconds]
ikaros has joined #ocaml
avsm has quit [Quit: Leaving.]
avsm has joined #ocaml
nejimban has quit [Ping timeout: 276 seconds]
Cyanure has joined #ocaml
vivanov has joined #ocaml
avsm has quit [Quit: Leaving.]
avsm has joined #ocaml
iratsu has joined #ocaml
Anarchos has joined #ocaml
Vinnipeg has joined #ocaml
Anarchos has quit [Quit: Vision[0.9.7-H-090423]: i've been blurred!]
avsm has quit [Quit: Leaving.]
vivanov has quit [Quit: Lost terminal]
lopex has joined #ocaml
Cyanure has quit [Remote host closed the connection]
Vinnipeg has quit [Quit: Ухожу я от вас (xchat 2.4.5 или старше)]
Tobu_ has quit [Quit: No Ping reply in 210 seconds.]
Tobu has joined #ocaml
BiDOrD has joined #ocaml
jmcarthur has joined #ocaml
BiDOrD_ has quit [Ping timeout: 276 seconds]
ygrek has joined #ocaml
Anarchos has joined #ocaml
vivanov has joined #ocaml
ikaros has quit [Quit: Ex-Chat]
pixelou has joined #ocaml
<pixelou> hi ! I'm new to ocaml and i'd just like to know hw to pass a reference to a fonction (I don't see how to do what I want without this)
<zorun> when passing an array to a function, it is actually passed as a reference
<zorun> don't know if it is your goal
<zorun> any non-mutable type (eg. a list) can't be passed by reference, obviously
<pixelou> It was for a single variable at first
<pixelou> not an array
<zorun> in a functional language, the term « variable » generally does not make sense ;)
<pixelou> in fact I'm used to do imperative programming and I can't manage to do a fonction that fills an array whith a loop and then returns this array
<zorun> then there is another, cleaner solution :)
<pixelou> I hope so
<zorun> what do you want to do exactly?
<pixelou> I have a distribution of point and for each point I add the echo signal to the signal actually received by the microphone
<zorun> which basically means taking the sum of two arrays, in your case?
<pixelou> yes, in a way
<zorun> working with lists is a much more natural way to do things in a functional language
<zorun> I would do it that way:
<pixelou> ok, I see
<zorun> List.map2 (+) list1 list2
avsm has joined #ocaml
<pixelou> so i need to build list2 before.... ok I'll try to modify my code
<hcarty> pixelou: For reference, Arrays can be quite natural in OCaml too. With Batteries you get an equivalent Array.map2 function
<zorun> I don't think there is a `map2' function for Array, but you can write it as well
<hcarty> pixelou: You could compute the values from list2 on the fly, if that is simpler
<pixelou> no I'll use a procomputed one it's possible in my case because i always use the same signal
<hcarty> zorun, pixelou: My guess is that the stdlib lacks Array.map2 because Array.mapi provides a reasonable, if slightly less pretty, replacement for Array.mapN
<zorun> hcarty: interesting, how do you build a map2 function from mapi?
Boscop_ has joined #ocaml
Boscop has quit [Ping timeout: 255 seconds]
mcclurmc_home has quit [Ping timeout: 255 seconds]
<zorun> got it, something like "let map2 f a1 a2 = Array.mapi (fun i e -> f a2.(i) e) a1"
<zorun> you're right, not so pretty
<hcarty> zorun: Indeed. It's not terribly difficult, but it's not terribly readable either :-)
Boscop_ has quit [Ping timeout: 255 seconds]
Boscop has joined #ocaml
Boscop has quit [Read error: Connection reset by peer]
Boscop has joined #ocaml
Boscop has quit [Changing host]
Boscop has joined #ocaml
Tobu has quit [Ping timeout: 264 seconds]
Tobu has joined #ocaml
ikaros has joined #ocaml
othiym23 has quit [Quit: Linkinus - http://linkinus.com]
avsm has quit [Quit: Leaving.]
Anarchos has quit [Quit: Vision[0.9.7-H-090423]: i've been blurred!]
ApeShot has joined #ocaml
<ApeShot> Is it some peculiarity of my emacs setup or does the ocaml-mode with Tuareg indent `match` expressions incorrectly?
<ApeShot> Each case is indented one level higher than the previous one
<ApeShot> So a match expression tends to cruise off the edge of the screen pretty fast
<zorun> which version of tuareg-mode?
<ApeShot> The one in the ubuntu repos. Let me check the exact version
<zorun> working fine with 2.0.4 here
<ApeShot> Ok, I'll install from source - the repo is way out of date
<zorun> and as far as I remember, this bug never showed up since I've started using tuareg-mode (a couple of years ago)
<ApeShot> Well, hopefully it will fix itself when I update. I've been using emacs for years, but I've never really gotten into how to deal with indentation except at a very superficial level
nejimban has joined #ocaml
dnolen has joined #ocaml
ApeShot has quit [Remote host closed the connection]
lopex has quit []
jamii has joined #ocaml
ApeShot has joined #ocaml
<ApeShot> Running the latest tuareg now, still getting the weird match/case indentation.
<ApeShot> Running GNU Emacs 23.1.1 (i486-pc-linux-gnu, GTK+ Version 2.20.1)
<ApeShot> of 2011-03-04 on palmer, modified by Debian
<zorun> do you have a .emacs?
<ApeShot> I have a .emacs.d with lots of sub scripts
<ApeShot> Do you want the one specific one associated with ocaml?
<ApeShot> I add the tuareg directory to the load path, require 'tuareg, configure the auto-mode-alist to do tuareg mode for ml files
<ApeShot> And thats it
mjonsson has joined #ocaml
<ApeShot> Ok, just loaded an emacs -q, so without any init files, added the tuareg directory, required tuareg-mode, set up the auto-mode list and opened an ml file, which went into tuareg mode, as you'd expect
<ApeShot> It is still indenting match expressions incorrectly
<ApeShot> All I can imagine is that its my version of emacs
<ApeShot> Oh, I see
jamii has quit [Ping timeout: 276 seconds]
<ApeShot> If you don't lead each line with | it indents incorrectly
<zorun> *each* line? what do you mean?
<zorun> oh, you mean the first one?
<ApeShot> So you can write as legit ocaml match x with 10 -> "ten" | 11 -> "eleven" |...
<ApeShot> But that will indent incorrectly
<ApeShot> You have to say instead match x with | 10 -> "ten" <newline> | 11 -> "eleven" <newline> | ...
<ApeShot> Each line after with should lead with the "|"
<ApeShot> Rather than putting it on the previous line, as I was doing
<ApeShot> My code compiles either way, but only indents correctly the latter
<zorun> Actually, using a | even for the first line is considered a good practice
<ApeShot> Why?
<zorun> maybe some kind of symmetry
<ApeShot> Interesting
<ApeShot> Ok, well, thanks
<ApeShot> Have a great one
ApeShot has quit [Remote host closed the connection]
<pixelou> does anyone know why ocaml would say says "unused variable echo" about my function echo
<zorun> because you don't use it, maybe?
<pixelou> but it is not a variable
Smerdyakov has joined #ocaml
mcclurmc_home has joined #ocaml
<pixelou> it's a function
<zorun> pixelou: actually, it is the same thing for OCaml
<zsparks> it is a variable with function type.
<pixelou> ok sorry for question then
<zorun> no problem
<ygrek> it is a value to be precise
<pixelou> anyway, when I call the function it fails to find it, I must have made some mistakes before
<pixelou> thank you ygrek for this precision, I must admit I' m really dicovering ocaml
<pixelou> and sorry for my poor english.... discover is not exact here, I should say finding out how ocaml works
lamawithonel_ has joined #ocaml
lamawithonel has quit [Ping timeout: 255 seconds]
mcclurmc_home has quit [Ping timeout: 255 seconds]
mcclurmc_home has joined #ocaml
mcclurmc_home has quit [Ping timeout: 255 seconds]
ikaros has quit [Quit: Ex-Chat]
<pixelou> it finaly works !!! : http://pastebin.com/1tempzD7 (so that you can understand what I wanted)
<Smerdyakov> pixelou, you can remove all of those double semicolons.
<pixelou> I learnes that after writing them..
<pixelou> *learned
<Smerdyakov> pixelou, agh! Don't use loops in OCaml!
<pixelou> it was easier I will convert this after
<pixelou> I suppose you mean using a loop on an array?
<pixelou> I'm just looking for the function that does the same thing
<Smerdyakov> I mean never use loops in OCaml. They're in the language, but a lot of us have strong negative reactions to them.
<Smerdyakov> Use recursive functions instead.
<pixelou> but technichally it offers similar performances, doesn't it?
<zsparks> pixelou: so does goto; doesn't mean it's good style.
<pixelou> yes indeed
<Smerdyakov> It's harder to understand, for the same reason that side effects in general are hard to understand.
Boscop has quit [Ping timeout: 255 seconds]
lamawithonel_ has quit [Remote host closed the connection]
Anarchos has joined #ocaml
lamawithonel_ has joined #ocaml
ftrvxmtrx_ has joined #ocaml
dnolen has quit [Quit: dnolen]
ftrvxmtrx has quit [Ping timeout: 244 seconds]
lamawithonel_ has quit [Excess Flood]
Boscop has joined #ocaml
lamawithonel_ has joined #ocaml
george_z0rwell has quit [Ping timeout: 250 seconds]
Reaganomicon has joined #ocaml
lopex has joined #ocaml
Tommytom has joined #ocaml
<Tommytom> Hello, I don't understand why my program (socket + thread) work perfectly on Linux, but on Windows, it doesn't send any paquet.
<Tommytom> Just reception work
ygrek has quit [Ping timeout: 250 seconds]
Boscop has quit [Ping timeout: 255 seconds]
pixelou has quit [Quit: Quitte]
ftrvxmtrx_ has quit [Read error: Connection reset by peer]
ftrvxmtrx_ has joined #ocaml
Boscop has joined #ocaml
Tommytom has quit [Quit: http://irc2go.com/]
alexyk has joined #ocaml
eikke has joined #ocaml
alexyk has quit [Ping timeout: 276 seconds]
eikke has quit [Ping timeout: 276 seconds]
impy has joined #ocaml
sepp2k has joined #ocaml
avsm has joined #ocaml
Anarchos has quit [Read error: Operation timed out]
Tobu has quit [Read error: Connection reset by peer]
axiles has quit [Remote host closed the connection]
vivanov has quit [Ping timeout: 260 seconds]
jamii has joined #ocaml
eb4890 has joined #ocaml
eikke has joined #ocaml
eikke has quit [Ping timeout: 240 seconds]
Smerdyakov has quit [Quit: Leaving]
eikke has joined #ocaml
eikke has quit [Ping timeout: 264 seconds]
ulfdoz has quit [Read error: Operation timed out]
rgee has quit [Ping timeout: 240 seconds]
rgee has joined #ocaml
edwin has quit [Remote host closed the connection]
Tobu has joined #ocaml
ikaros has joined #ocaml
Anarchos has joined #ocaml
Anarchos has quit [Quit: Vision[0.9.7-H-090423]: i've been blurred!]
Smerdyakov has joined #ocaml
avsm has quit [Quit: Leaving.]
ztfw has quit [Remote host closed the connection]
avsm has joined #ocaml
eikke has joined #ocaml
eikke has quit [Ping timeout: 240 seconds]
Smerdyakov has quit [Quit: Leaving]
Reaganomicon has quit [Read error: Connection reset by peer]
ikaros has quit [Quit: Ex-Chat]
mjonsson has quit [Remote host closed the connection]
avsm has quit [Quit: Leaving.]
avsm has joined #ocaml
avsm has quit [Client Quit]
lamawithonel_ has quit [Ping timeout: 255 seconds]
eb4890 has quit [Ping timeout: 255 seconds]
Morphous_ has quit [Ping timeout: 250 seconds]
lamawithonel_ has joined #ocaml
lamawithonel__ has joined #ocaml
lamawithonel_ has quit [Ping timeout: 255 seconds]
philtor has joined #ocaml
Morphous_ has joined #ocaml
Modius has quit [Ping timeout: 244 seconds]
lamawithonel__ has quit [Ping timeout: 250 seconds]
lamawithonel__ has joined #ocaml
alfa_y_omega has quit [Ping timeout: 258 seconds]
lamawithonel__ has quit [Ping timeout: 255 seconds]
alfa_y_omega has joined #ocaml
Modius has joined #ocaml
othiym23 has joined #ocaml
alfa_y_omega has quit [Excess Flood]
alfa_y_omega has joined #ocaml