kaustuv changed the topic of #ocaml to: Discussions about the OCaml programming language | http://caml.inria.fr/ | 3.11.1 out now! Get yours from http://caml.inria.fr/ocaml/release.html
jmou has joined #ocaml
julm has quit [Read error: 110 (Connection timed out)]
jmou is now known as julm
jeddhaberstro has quit [Client Quit]
Pepe_ has quit [Remote closed the connection]
Ppjet6 has joined #ocaml
yziquel has joined #ocaml
yziquel has quit [Client Quit]
sbok_ is now known as sbok
travisbrady has quit []
TaXules_ has quit [Read error: 54 (Connection reset by peer)]
jeddhaberstro has joined #ocaml
mjs22 has joined #ocaml
* palomer finds "Foo of (int * int)" vs "Foo of int * int" very confusing
<palomer> and annoying!
mjs22 has quit []
<mrvn> but there is a difference
<palomer> there shouldn't be!
<palomer> (imho)
Fullma has quit ["Quitte"]
Fullma has joined #ocaml
<AxleLonghorn> what's the difference?
<palomer> slight
<palomer> Foo of (int * int) is all around more flexible
<AxleLonghorn> so what is the difference?
<AxleLonghorn> I'm not seeing it right away
<hcarty> AxleLonghorn: One difference I'm aware of is that, without parens in the type definition, you can't do "match x with Foo t -> ..."
<hcarty> You can with "type t = Foo of (int * int)"
<AxleLonghorn> ah
<AxleLonghorn> interesting
<AxleLonghorn> that does make a difference
caligula__ has joined #ocaml
<hcarty> With "type t = Foo of int * int" you need to do "match x with Foo (a, b) -> ..."
<AxleLonghorn> yeah
<AxleLonghorn> I actually experienced this just this morning
<AxleLonghorn> didn't know there was a way around it
caligula_ has quit [Read error: 110 (Connection timed out)]
Fullma has quit ["Quitte"]
^authentic has joined #ocaml
authentic has quit [Connection timed out]
jawnsy has joined #ocaml
julm has quit [Read error: 110 (Connection timed out)]
julm has joined #ocaml
Lomono has joined #ocaml
Associat0r has joined #ocaml
Lomono has quit ["Don't even think about saying Candlejack or else you wi"]
willb has joined #ocaml
komar_ has joined #ocaml
jeddhaberstro has quit [Client Quit]
julm has quit ["Genetic engineering: no thanks!"]
Jedai has joined #ocaml
_zack has joined #ocaml
animist has joined #ocaml
AxleLonghorn has left #ocaml []
Submarine has joined #ocaml
bla has quit [Read error: 113 (No route to host)]
hkBst has joined #ocaml
Associ8or has joined #ocaml
_zack has quit [Read error: 113 (No route to host)]
Jedai has quit [Read error: 113 (No route to host)]
Associat0r has quit [Connection timed out]
LeCamarade|Away is now known as LeCamarade
LeCamarade has quit ["Gone."]
verte has joined #ocaml
verte_ has joined #ocaml
verte has quit [Nick collision from services.]
verte_ is now known as verte
Submarine has quit [Read error: 110 (Connection timed out)]
Jedai has joined #ocaml
<C_Tux> crap, the mailing-lists are used by scammers to get our emails :'(
<mrvn> you get so little spam that you notice that?
<C_Tux> (I received a nigerian scam and replied, asking who my email address had been found)
<C_Tux> mrvn: mrvn I get more and more spam, most is filtered but not all, anyway that wasn't spam, just a scam sent by somebody real
TaXules has joined #ocaml
Yoric[DT] has joined #ocaml
ulfdoz has joined #ocaml
<flux> it is pretty much assumable that all publicly available mailing lists are harvested for email addresses
<mrvn> It would be a poor sign if ocamls ML would be considered inconsequential even by spamers.
<C_Tux> he :p
ulfdoz has quit [Read error: 60 (Operation timed out)]
_andre has joined #ocaml
_zack has joined #ocaml
Amorphous has quit [Read error: 110 (Connection timed out)]
kblin has joined #ocaml
<kblin> hi folks
Amorphous has joined #ocaml
Yoric[DT] has quit [Remote closed the connection]
verte has quit [Read error: 110 (Connection timed out)]
BiDOrD has quit [Read error: 110 (Connection timed out)]
BiDOrD has joined #ocaml
Jedai has quit [Read error: 113 (No route to host)]
verte has joined #ocaml
Yoric[DT] has joined #ocaml
ulfdoz has joined #ocaml
hkBst has quit [Read error: 104 (Connection reset by peer)]
Jedai has joined #ocaml
LeCamarade has joined #ocaml
hkBst has joined #ocaml
mickybadia has joined #ocaml
mickybadia has left #ocaml []
verte has quit [Read error: 110 (Connection timed out)]
_zack1 has joined #ocaml
_zack has quit [Read error: 110 (Connection timed out)]
ulfdoz has quit [Read error: 60 (Operation timed out)]
Associ8or has quit ["#proglangdesign #ltu ##concurrency"]
bombshelter13_ has joined #ocaml
verte has joined #ocaml
nimred has quit [Success]
Associat0r has joined #ocaml
gim has joined #ocaml
verte has quit ["~~~ Crash in JIT!"]
komar_ has quit ["WeeChat 0.2.6.3-ohshi"]
komar_ has joined #ocaml
jado has joined #ocaml
<jado> hi, i have an annoying problem about records and references and i can't figure it out: http://paste.ubuntu.com/212891/ could someone help me?
<palomer> paste the error as well
<jado> it's done
<palomer> oh, you get an uncaught exception Not_found?
<jado> yes
<jado> it's for the Hashtbl.find
<jado> (i guess)
<palomer> and if you remove nodes.(0).(0).color <- 6;, then it works?
<jado> yes that's right; i'm sorry i could have explained
<palomer> so you have to understand how hashtbl works
<palomer> it simply takes a value and then hashes it based on its contents
<palomer> not on its address
<jado> yes
<palomer> so {place = (0,0); color = 0; def = true} is the key
<jado> yes, but there is something weird:
<palomer> oh wait, you're right...
<jado> it doesn't make sense
<palomer> hrmph, we'll have to wait till one of the smarter people get on this channel to explain to us how the hashtbl works
<mfp> jado: you're modifying the key and thus the hash value
<jado> mfp: ok but that does not explain the Not_found exception?
<mfp> it does
<mfp> when you look for the key,
<mfp> the code in Hashtbl computes its hash
<jado> and stores the value at that address yes
<jado> so now the hash is changed
<palomer> but hashtbl still has it at the old address
<mfp> yes, but the key -> value association remains in the old bucket
<jado> but why when i print the graph the new key is printed?
<mfp> because the association is still there
<mfp> just in a different bucket
<palomer> what's interesting is that Hashtbl.find hashtbl {place = (0,0); color = 0; def = true} still raises a Not_found error
<palomer> I guess Hashtbl does a final equality check at the end
<mfp> yes
<jado> so one very ugly way to it would be to put the color at 0 find the list and then put back the old color?
<jado> to do*
<palomer> you can use objects
<palomer> the hash value of an object is based on its address (if I remember correctly)
<mfp> jado: either get the old value, remove & insert with the new key, or use a stable hash function with the functional interface (or using objects as palomer said)
<jado> that's too much work; i'd rather make an ugly patch :D
<palomer> objects are easy
* palomer is off
<mfp> jado: you can just tag the keys with an id, and use module H = Hashtbl.Make(struct type t = node let hash t = t.id let equal = (=) end)
lutter has joined #ocaml
<mfp> with type node = { id : int; .... }
<jado> yes ok i see; the id is the 'place' actually
<_andre> jado: you could also change your key, using for example a tuple of ints which represents the place
<_andre> heh :)
<mfp> ah, if the key is meant to be node.place, then simply
<mfp> module H = Hashtbl.Make(struct type t = node let hash t = Hashtbl.hash t.place let equal t1 t2 = t1.place = t2.place end)
<jado> thanks :)
nimred has joined #ocaml
<mfp> this way the color & def fields are ignored, and node.place effectively becomes the key, allowing you to change the former
<jado> ok i see
ulfdoz has joined #ocaml
<jado> got to go; thanks again
jado has quit [Remote closed the connection]
Asmadeus has joined #ocaml
nimred has quit ["leaving"]
nimred has joined #ocaml
C_Tux is now known as Camarade_Tux
Submarine has joined #ocaml
_zack1 has quit ["Leaving."]
_andre_ has joined #ocaml
_andre has quit [Read error: 104 (Connection reset by peer)]
travisbrady has joined #ocaml
willb has quit [Success]
ambient has quit [Read error: 145 (Connection timed out)]
_zack has joined #ocaml
amuck_ has joined #ocaml
julm has joined #ocaml
mrvn has quit [Read error: 110 (Connection timed out)]
<Camarade_Tux> I miss a List.inter(section), not having one will prevent me from writing shitty code but it's a bit annoying for small apps you'd write in 10 minutes
<kaustuv> let inter l1 l2 = List.filter_map (fun k -> if List.exists ((=) k) l2 then Some k else None) l1 ;;
<kaustuv> err
<kaustuv> let inter l1 l2 = List.filter (fun k -> List.exists ((=) k) l2) l1 ;;
<Camarade_Tux> he ;p
<Camarade_Tux> it could be better if you sorted the lists and didn't went through all the second list each time
<Camarade_Tux> but sure, it's easy to hack a quick version ;)
<kaustuv> let inter l1 l2 = let ht = Hashtbl.create 1 in List.iter (fun l -> Hashtbl.add ht l ()) l2 ; List.filter (Hashtbl.mem ht) l1 ;;
<kaustuv> O(#l1 + #l2)
<Camarade_Tux> right, you got me here ;)
<flux> funny thing is that it'd be quite difficult to have that in the standard library, because I'm pretty sure Hashtbl depends on Lits ;-)
<Camarade_Tux> but my biggest trouble is getting a compare relationship for a list of attributes (represented as an association list), it should cluster "similar" lists =/
<Camarade_Tux> or has anyone a diff program for xml files?
<Camarade_Tux> I haven't exactly been satisfied with what I've found ;)
<kaustuv> if you write your attributes one per line and sorted, then ordinary diff would be fine
<Camarade_Tux> (I think the python one was bugging me because of deps)
<Camarade_Tux> kaustuv: that's approximately what I'd like to do : sort the xml file and then use vim to diff two files, but I have troubles finding a good compare for the sort
Ppjet6 is now known as Pepe_
<Camarade_Tux> maybe 'if more than 90% of elements in common -> 0'
<kaustuv> seems to me that you have to first define the problem you're trying to solve carefully
<Camarade_Tux> get the differences between the "format" produced by two versions of gobject-introspection : solution, kidnap the commiters and torture them :D
<Camarade_Tux> (they changed the format between 0.6.2 and ... 0.6.3)
willb has joined #ocaml
<julm> Camarade_Tux> or has anyone a diff program for xml files? <- XMLStarlet ?
<Camarade_Tux> julm: I tried it, a diff is advertized but I couldn't find it :o
psnively has joined #ocaml
<julm> zut :|
<julm> "'diff' and 'patch' options are not currently implemented" /o\
<Camarade_Tux> he :P
<kaustuv> "I have a program that can tell whether a given Turing machine halts on all inputs, but it's a 0.1 beta release with some performance problems."
psnively has left #ocaml []
peddie_ has joined #ocaml
Skolem has quit [Read error: 110 (Connection timed out)]
<palomer> does it support unicode?
Yoric[DT] has quit ["Ex-Chat"]
det has quit [Remote closed the connection]
peddie has quit [Read error: 113 (No route to host)]
LeCamarade is now known as LeCamarade|Away
peddie has joined #ocaml
peddie_ has quit [Read error: 60 (Operation timed out)]
_andre_ has quit ["leaving"]
Yoric[DT] has joined #ocaml
willb has quit [Read error: 110 (Connection timed out)]
Yoric[DT] has quit ["Ex-Chat"]
nominolo has joined #ocaml
<nominolo> hm, what does this syntax mean: "foo{bar} ->;" is that a lookup just for side effect?
<nominolo> strangely, it's not part of a pattern
Yoric[DT] has joined #ocaml
* palomer has never seen that syntax
kblin has left #ocaml []
slash_ has joined #ocaml
yziquel has joined #ocaml
sramsay has joined #ocaml
willb has joined #ocaml
anders^^ has joined #ocaml
Submarine has quit [Client Quit]
bombshelter13_ has quit []
_zack has quit ["Leaving."]
komar_ has quit [Read error: 60 (Operation timed out)]
sramsay has quit ["Leaving"]
amuck_ has quit []
willb has quit [Read error: 110 (Connection timed out)]
ztfw has joined #ocaml
Yoric[DT] has quit ["Ex-Chat"]
hkBst has quit [Remote closed the connection]
BiDOrD has quit [Read error: 110 (Connection timed out)]
BiDOrD has joined #ocaml
komar_ has joined #ocaml
komar__ has joined #ocaml
komar_ has quit [Read error: 110 (Connection timed out)]