<Myrizio>
pango, ketty: gcaml allows me to define the "wrap" function!! :)
<Myrizio>
let rec wrap = generic
<Myrizio>
| : ('a->'b)->'a->'b => fun func v -> wrap (func v)
<Myrizio>
| fun arg -> hello (); arg
<Myrizio>
;;
* Myrizio
is happy
Smerdyakov has joined #ocaml
khaladan has quit [Read error: 104 (Connection reset by peer)]
mikeX has quit ["zzz"]
<ketty>
Myrizio: nice :)
<Myrizio>
:)
Revision17 has quit ["Ex-Chat"]
dark_light has quit [No route to host]
khaladan has joined #ocaml
Revision17 has joined #ocaml
shawn has quit ["This computer has gone to sleep"]
shawn has joined #ocaml
Myrizio has quit ["Leaving"]
jcreigh has joined #ocaml
DannoHung has joined #ocaml
<DannoHung>
Hi. I was wondering if there's a sleep command? There isn't anything mentioned on ocaml-tutorial.org
<Smerdyakov>
There are no commands in OCaml.
<DannoHung>
Sorry, function
<Smerdyakov>
Maybe you mean such a _function_ in the standard library?
<ketty>
mm.. in the Unix module there is a function...
<DannoHung>
Is it just Unix.sleep ?
<Smerdyakov>
DannoHung, do you know where the manual is?
<ketty>
i think so :)
<DannoHung>
Smerdyakov: Nope. Very new to OCaml. It's for a class. We're writing a dining philosophers problem in Jocaml and the output is whizzing by too fast for me to figure out what's happening.
<Thlayli>
i like OCaml more and more while learning it
<ketty>
and you can install it without messing with your system.. :)
<Thlayli>
ketty are you german?
<ketty>
no
<ketty>
swedish...
<Thlayli>
ah
<Thlayli>
was just curious because of the de-website
<Thlayli>
since i am german
<ketty>
ok..
<Thlayli>
and my english is far away from being perfect ^^
<ketty>
as is mine...
<ketty>
i want to learn to many languages to have time to learn any of them well :)
<Thlayli>
i haven't learned any since school. i only speak german and french
<ketty>
currently i want to learn japanese, chinese and russian.. :)
<Thlayli>
a friend of mine visited stockholm last year and told me some swedish words, but i already forgot them. no wonder if you don't get a chance to use them. and now i met someone from sweden and can't even say hello in his language :(
<ketty>
"hej"
<Thlayli>
i'll try my best to remember ;)
stockholm has joined #ocaml
<stockholm>
Hello, I'm wondering if there is someone who has a couple of minutes to spare to talk in-depth about optimizing OCaml code with me? Specifically, I'm working on a library for computer vision, and am attempting to make it as fast as a similar implementation in C++, but am coming up 3x-4x slow. Thanks in advance for you time.
Snark has quit [Read error: 110 (Connection timed out)]
mauke_ is now known as mauke
Demitar has joined #ocaml
<ketty>
stockholm: sorry, i no nothing about optimization.. you might want to post to the mailing list also..
<stockholm>
ketty: Yea, that's a good idea. I've been reading through all of the old mailing list posts for the past years, and have gotten lots of good tips from them.
slipstream has quit [Read error: 104 (Connection reset by peer)]
slipstream has joined #ocaml
<Thlayli>
is there a way to access list elements by index?
<_JusSx_>
Thlayli: no
<Thlayli>
thx
_JusSx_ has quit ["leaving"]
<ketty>
Thlayli: List.nth
<Thlayli>
thx ketty
<Thlayli>
so there is a way
<mikeX>
Thlayli: keep in mind that you have to iterate over N elements to access the Nth element of a list
<Thlayli>
thanks for the info, but i am not aiming for performance at the moment.
<ketty>
if you would want fast random access you should use arrays..
<Thlayli>
yes, but this is neglibigle for the small set that i have
<Thlayli>
i would not want to implement a resizable array for it
<ketty>
you dont need to implement it..
<Thlayli>
really?
<Thlayli>
is there a datatype like vector?
<ketty>
there is arrays in the standard library...
<Thlayli>
hmm, is there a good reference for the standard-library i can dig into?
<ketty>
have you looked at the manual?
<Thlayli>
yes
<Thlayli>
and it was kinda odd
<dylan>
it's in the manual.
<stockholm>
Go to ocaml.org, and click on "Resources", there's excellent documentation on the standard library there.
<Thlayli>
whenever i clicked on a link that was beyond section 1.6 or so it did not work
<Thlayli>
i was taken to the bottom of the page ^^
<Thlayli>
what the deuce? i dunno what me stupid moron did wrong before
<Thlayli>
but now it works
<ketty>
great :)
marc has joined #ocaml
<marc>
hello.
<ketty>
hello
<Thlayli>
so, i'm finished for today
_fab has quit []
<marc>
I have a problem when i compile http://rafb.net/paste/results/U0Awl270.html with ocamlc. I get a segfault at execution. Can someone try to compile and execute it on its computer ?
<ketty>
with ocaml and ocamlc i get segfault, but not with ocamlopt
<marc>
It's probably a bug in ocamlc but i did not succeed to isolate it.
<marc>
yep.
<Thlayli>
segfault here, too
<marc>
ocamlc -v
<marc>
The Objective Caml compiler, version 3.09.1
<ketty>
mine to
<ketty>
you should probably submit a bug report
<Myrizio_>
mh, i get segfault with ocaml interpreter too...
smimou has joined #ocaml
<Myrizio_>
maybe some stack overflow?
<ketty>
that would generate a stack overflow exception (or error?)
<marc>
It may be a bug in ocamlrun.
<ketty>
generaly if you get segfault and you are not using "unsafe" features it is a bug in the ocaml system...
<marc>
Ok, i will try to submit a report.
<Myrizio_>
ketty: i did not know this fact :)
<marc>
i should try to compile it on the latest ocaml version.
<ketty>
yes, and you might want to try cvs too...
stockholm has quit []
<Myrizio_>
BTW, gcaml has the bug (and gcaml is based on ocaml 3.09.0), so this bug is not specific of 3.09.1
<marc>
I will mail the caml list and let gurus handling this bug.
<marc>
is there theoretic difficulties for type inference in the module system ?
<marc>
don't metacoders waste too much time writing signatures ?
<Demitar>
marc: Two curious facts which might be helpful: 1) Without the call to LS.add it doesn't segfault. 2) Adding one explicit parameter to LL.add (let add x = ... x) makes it work properly as well. (Of course, since I didn't force maximum garbage collection it could be a timing issue.)
vitriol_ has joined #ocaml
<vitriol_>
what is the difference between defining type foo = A | B | C and type foo = [ `A | `B | `C ] ?
<Demitar>
vitriol_: The latter are polymorphic variants.
<marc>
I have send a mail to the caml list with this remark.
<Demitar>
marc, *nods*
<marc>
i haven't understand «Of course, since I didn't force maximum garbage collection it could be a timing issue
<marc>
»
khaladan has quit [Read error: 110 (Connection timed out)]
<Demitar>
marc: I recall from some message on the mailing lists that you can force the garbage collector to collect all heaps every cycle and thus catch memory management issues much closer to their actual breakage.
vitriol_ has quit [Remote closed the connection]
smimou has quit ["bli"]
<pango>
Thlayli: ocamlrun is *bytecode* interpreter, to write "interpreted scripts" you must use #!/usr/bin/ocaml not #!/usr/bin/ocamlrun
<pango>
marc: works for me with ocamlc 3.08.3 (Debian)