dark_light changed the topic of #ocaml to: OCaml 3.09.2 available! Archive of Caml Weekly News: http://sardes.inrialpes.fr/~aschmitt/cwn/ | A free book: http://cristal.inria.fr/~remy/cours/appsem/ | Mailing List: http://caml.inria.fr/bin/wilma/caml-list/ | Cookbook: http://pleac.sourceforge.net/
typecheck has quit [Client Quit]
Smerdyakov has joined #ocaml
hikozaemon has joined #ocaml
danly has quit [Read error: 104 (Connection reset by peer)]
fab_ has joined #ocaml
_fab has quit [Read error: 110 (Connection timed out)]
jcreigh has joined #ocaml
bzzbzz has joined #ocaml
jcreigh has quit [Read error: 110 (Connection timed out)]
dleslie has joined #ocaml
bzzbzz has quit ["leaving"]
Smerdyakov has quit ["Leaving"]
khaladan has joined #ocaml
dibalout has joined #ocaml
mwc has joined #ocaml
<mwc> Any ideas how to zero in on this? Stack overflow in structural comparison
<mwc> oh, I found out how to get a stack trace
<mwc> nvm
smimou has joined #ocaml
mwc has quit ["Leaving"]
Snark has joined #ocaml
typecheck has joined #ocaml
slipstream-- has joined #ocaml
slipstream has quit [Read error: 110 (Connection timed out)]
kaspersv has joined #ocaml
mwc has joined #ocaml
<mwc> I'm having a lot of trouble with this function:
<mwc> For instance
<mwc> # remove_duplicates compare [1;2;3;1];;
<mwc> - : int list * bool = ([1; 2; 3], false)
<mwc> I should have a true down there. It's like half the else branch of the conditional is being taken, and the other half isn't!
hikozaemon has quit ["Leaving..."]
<smimou> mwc: rem_dump is evaluated *after* !dups_found it seems
<smimou> I guess the order of evaluation for a pair of the form (f x, g y) is unspecified, so you should not rely on it
<smimou> BTW, the "right" comparison in ocaml is = and not ==
<smimou> (it's the same on integers but it's not semantically good to use == here)
<smimou> yep that's it
<smimou> # (print_string "a", print_string "b");;
<smimou> ba- : unit * unit = ((), ())
<mwc> So then what's == do?
<mwc> thanks smimou, I'll just add an extra let statement to force evaluation before the tuple.
<smimou> its physical equality (same memory location)
<mwc> Ahah
<smimou> but on integers it's the same as =, so it's more a matter of taste here
<mwc> I was looking for the difference in the reference, I didn't find anything and assumed that == is equivalent to =, just a sort of lexical pacifier
<mwc> time to grep my code :(
<smimou> heh
<mwc> how do = and == behave on refs?
<mwc> == same ref I assume, but what does = mean?
<smimou> no it's not that
<smimou> for example "a" == "a" is false
<smimou> because two strings are created in memory
<mwc> ok
<smimou> but let s = "a" in s == s is true
<mwc> that's what I thought, "pointer" equality
<mwc> if they reference the same object
<smimou> yes sorry
<mwc> okay, what about let a = ref () and b = ref (). I assume a == a is true, but what does = mean?
<smimou> it means that they point to = things
<smimou> # let s1 = ref "a" and s2 = ref "a" in s1 = s2;;
<smimou> - : bool = true
<mwc> hmm, in that case = is true
<mwc> yeah, just did it myslef
<mwc> I htink I understand it now, thanks
<mwc> That's rem_dup thing was causing two different bugs in this module. One to go
Jonex has joined #ocaml
benoyst has joined #ocaml
<benoyst> hello.
mwc has quit [Read error: 110 (Connection timed out)]
kaspersv has quit [Client Quit]
mwc has joined #ocaml
mwc has quit ["Leaving"]
shekmalhen has joined #ocaml
ookk has joined #ocaml
asbeta has joined #ocaml
ookk_ has joined #ocaml
shawn__ is now known as shawn
ookk has quit [Read error: 110 (Connection timed out)]
Smerdyakov has joined #ocaml
<ookk_> can i omit the else from an if-then-else statement?
<ookk_> im talking about an imperative function
ookk_ is now known as ookk
<asbeta> if it returns unit then yes
<ookk> wenn i tried to ommit the else statement it went to the row below the if-statement when the else path would have been taken
<ookk> when*
<asbeta> i don't understand you
<asbeta> # if true then ();;
<asbeta> - : unit = ()
<asbeta> maybe you have overlapping ifs?
<ookk> yes
<asbeta> and outermost if have else statement?
<ookk> and i dont think it gets the scope right
<ookk> none have else
<asbeta> # if false then if true then ();;
<asbeta> - : unit = ()
<asbeta> maybe one of your ifs doesn't return unit
<ookk> do i have to use brackets or something?
<asbeta> no, your program may not be type-correct
<ookk> if primes.(n) then
<ookk> radicals.(n) <- n;
<ookk> if 2*n < 100000 then
<ookk> r (2*n) (2*n);
<asbeta> what's r type?
<ookk> the 2nd if is within the 1st
<ookk> its an imperative function to
<ookk> let rec r k n =
<ookk> primes.(n) <- false;
<ookk> radicals.(n) <-(radicals.(n)*k);
<ookk> if n+k < 100000 then
<ookk> r k (n+k);
<ookk> the problem im having is that the 2nd if-statement in p doesnt lie in the scope of the 1st if-statement
<ookk> it breaks out of the 1st if after the first row has executed
<ookk> maybe Array.set a n doesnt return unit?
<asbeta> so you should use begin/end
<asbeta> or ()
<asbeta> if .. then (..; ..)
<ookk> results in syntax error
<asbeta> what's the code?
shekmalhen has quit ["bêêêêêêêh"]
<ookk> ok thx
<ookk> when i did that it gave me syntax error
<asbeta> np
<ookk> does the tabulation matter?
<asbeta> no
<ookk> ok
<ookk> ahh you had a ; after end
<ookk> i didnt
ita has joined #ocaml
<ita> hello
<ita> ocamldep folder/file.ml folder/file2.ml does not return anything, is that expected ?
finelemo1 has joined #ocaml
<dylan> try ocamldep -I folder folder/file.ml folder/file2.ml
<ita> aaah, thanks !
<ookk> anyone know of an partial_sort algorithm for ocaml?
ita is now known as ita|zzz
Chea_544 has joined #ocaml
<Chea_544> Is this a good language to make an im client in
finelemon has quit [Read error: 113 (No route to host)]
<dylan> Depends. The interface options are limited
<Chea_544> dylan well GTK seems like a good choice for me
<Chea_544> dylan: have you worked with LablGTK at al
<dylan> No, I really hate graphical user interfaces.
<Chea_544> welll me tooo but for my customers its kinda needed :P
<Chea_544> my people are not gonna use Ncurses
<Chea_544> i mean how big is a hello world in ocaml natively compiled
<Chea_544> with lablgtk
<Chea_544> i dont want my program bloated or huge really
<dylan> your people will be using Linux or something?
<Chea_544> Yes
<Chea_544> and also GTK on windows looks pretty good these days
<dylan> well, lablgtk is not compiled in statically.
<dylan> so it doesn't change the size much
<dylan> lablgtk... I am not sure how well, if at all, it works on Windows
<Chea_544> i looked at it on the site it works in windows
<Chea_544> hmmmmm
<Chea_544> i dunno if i should use Ocaml or C hmmmmm
<Chea_544> C seems to have alot more documentation
<dylan> C requires a lot more documentation
<Chea_544> i seeee
<Chea_544> so programming in Ocaml will be fairly easier '?
<Chea_544> i havent worked with C all to much
<dylan> well, then I would invest time in learning ocaml
<Chea_544> i have messed aroound with a few tutorials looked pretty straight forward
<Chea_544> does ocaml compile good on windows ?
<Chea_544> i am going to use jabber for my system also
<Chea_544> and theres a jabbr but i cant find it
<Chea_544> authors site is down
<Chea_544> i can fund a version for FreeBSD do you think if i extract the file .......and put everything in the appropriate directies it will work ?
<Chea_544> dylan
<dylan> Does ocaml compile well on windows? I dunno
<dylan> While I am using Windows right now, it's not habitual. ;)
<dylan> Chea_544: No idea. if it's source, you probably can try compiling it
<Chea_544> its not source
<Chea_544> as in .ml files
<dylan> just binaries?
<Chea_544> yes
<Chea_544> wellll
<Chea_544> let me check
<Chea_544> dylan: i have http://img443.imageshack.us/img443/5319/fffffffffffffffffsj6.jpg and some documentation
<Chea_544> is the soruce there or any way i can turn it back into source .....Or will it work on my platform if i put the files in the right places
<dylan> I don't know, I don't know, and probably not
<Chea_544> grrrrrrrr
<dylan> Actually,
<dylan> I don't know, No, and No.
<Chea_544> whats in the .a file ?
<dylan> ...
<dylan> it's a static library
<dylan> machine code. :P
<Chea_544> ahhhhh
<Chea_544> so theres no way i can turn that back to source
<Chea_544> this lib was made liek 4 years ago
<Chea_544> i really wish source was saved on the actual camp hump site not remote crap
<Chea_544> dylan: are you ever active on the mailing list etc ?
<dylan> I'm subscribed, but I've never felt I had anything useful to post.
<Chea_544> im looking for the author
Jonex has quit ["Leaving"]
<Chea_544> found him
<Chea_544> hopefully he will return my email with an attachment of it :)
<Chea_544> i have the soruce :P
dibalout has quit [Read error: 110 (Connection timed out)]
Godeke has joined #ocaml
ita|zzz is now known as ita
mnemonic has joined #ocaml
<mnemonic> hi
Godeke has left #ocaml []
ookk has quit ["This computer has gone to sleep"]
mnemonic has quit ["leaving"]
asbeta has quit ["sleeep"]
smimou has quit ["bli"]
Snark has quit ["Leaving"]
ita is now known as ita|zzz
d-bug has quit ["This computer has gone to sleep"]