mimosa has quit [Read error: 54 (Connection reset by peer)]
<Kinners>
anyone here have experience with ocaml in Windows?
g1m has quit []
phubuh has quit [Remote closed the connection]
Tomasso has joined #ocaml
Tomasso has quit ["Client exiting"]
Kinners has left #ocaml []
wrunt has quit ["To err is human, to moo bovine."]
Kinners has joined #ocaml
polin8 has joined #ocaml
polin8 has quit [Remote closed the connection]
Kinners has quit [Read error: 54 (Connection reset by peer)]
mfurr has joined #ocaml
mfurr has quit ["me go sleep now"]
afxpy has joined #ocaml
afxpy is now known as afxpy_sleep
lus|wazze has quit ["Copyright is a temporary loan from the public domain, not property"]
Hipo has quit ["å"]
karryall has quit [Remote closed the connection]
Hipo has joined #ocaml
buggs|afk has joined #ocaml
buggs has quit [Read error: 110 (Connection timed out)]
g1m has joined #ocaml
mimosa has joined #ocaml
The-Fixer has quit ["Goodbye"]
buggs|afk is now known as buggs
The-Fixer has joined #ocaml
Xcalibor has joined #ocaml
systems has joined #ocaml
systems has quit ["Client Exiting"]
gim_ has joined #ocaml
smimram_ has joined #ocaml
mimosa has quit [Read error: 113 (No route to host)]
g1m has quit [No route to host]
CybeRDukE has joined #ocaml
<CybeRDukE>
hi
<CybeRDukE>
i need some help with ocaml's hash-table
<CybeRDukE>
maybe it's more a problem of understanding parametic modules
<Smerdyakov>
OK. Ask question and receive answer. ;)
<CybeRDukE>
so if anyone is here who could help me, please scream.
<Demitar>
*aiee*
<Smerdyakov>
It's generally not worth asking to ask.
<CybeRDukE>
*g*
<Smerdyakov>
People usually get annoyed with it, and people who aren't there are the time but my see your question 5 minutes after you send it can't help you.
<Demitar>
Smerdyakov, can I ask you a question? *ducks*
<CybeRDukE>
i try to use the example about hashtables from the oreilly book
<Demitar>
CybeRDukE, good for you. :)
<CybeRDukE>
but e.g. the add funtion still expects a hash key. so why did i implement a hash funtion if the table does not use it automatically
<Smerdyakov>
What's a "hash key"?
<CybeRDukE>
the result of the funtion 'hash'
<Demitar>
Smerdyakov, probably something like Hashtbl.hash, ie the quick lookup used in a chained hashtable.
<Demitar>
CybeRDukE, I don't know why you created such a function. :)
<Smerdyakov>
CybeRDukE, well, I don't believe you.
<Smerdyakov>
CybeRDukE, I don't think there are any Hashtbl functions that take hashing results.
<Smerdyakov>
CybeRDukE, the Hash.S.t type is the type of _unhashed_ keys.
<Smerdyakov>
er
<Smerdyakov>
CybeRDukE, the Hash.S.key type is the type of _unhashed_ keys.
<CybeRDukE>
hmmm, and what i the last parameter of the add funtion good for?
<Smerdyakov>
To give the value to associate with the key....
<Smerdyakov>
Maybe you are thinking of this in Java OO terms.
<Smerdyakov>
The Hashtbl.S structure that you create with a functor application does NOT have a "private hash table inside it."
<Smerdyakov>
You must still create your own hash tables, and pass them to every relevant call.
<Smerdyakov>
The Hashtbl.S.t type is the type of the hash tables that that structure uses.
<CybeRDukE>
sorry, but i don't really understand
<Demitar>
CybeRDukE, do you understand how to use Hashtbl.*?
<CybeRDukE>
for me, a hash table creates an int from a key using a hash function and stores it at that position in the table
<CybeRDukE>
so i used x mod 13 for the hast funtion and passed tge module to Hashtbl.Make
<Demitar>
Well it probably does just that, but it doesn't show you exactly what it does.
<Smerdyakov>
CybeRDukE, the fact that it "creates an int" is an implementation detail that you don't need to worry about once you create the Hashtbl.S structure.
<CybeRDukE>
shouldn't that new table use the hash funtion itself?
<Smerdyakov>
It does use it.
<Demitar>
From a usage point of view it is a mapping.
<CybeRDukE>
Smerdyakov: the fact that the add-funtion expects not only a value but also a key confuses me
<Smerdyakov>
CybeRDukE, why?
<Smerdyakov>
CybeRDukE, a hash table maps KEYS to VALUES.
<Smerdyakov>
CybeRDukE, that is the ABSTRACT DEFINITION of a hash table.
<Smerdyakov>
CybeRDukE, you use a hash table to see what key is associated with a value.
<Smerdyakov>
CybeRDukE, neither keys nor values have anything to do with hash function results.
<Smerdyakov>
CybeRDukE, er, you use a hash table to see what value is associated with a key.
<CybeRDukE>
of cource but the hash funtion maps values to keys, right?
<Smerdyakov>
No.
<Smerdyakov>
The values are of ANY TYPE.
<Smerdyakov>
You can use a hash table to map string keys to binary tree values.
<Smerdyakov>
The values are of interest to you by themselves.
<Smerdyakov>
They are NOT created by the hash functionl;
<CybeRDukE>
aahhhhh, now i understand
<Smerdyakov>
This is not an OCaml issue. You don't seem to know what a hash table is.
<CybeRDukE>
i just misunderstood the use of the hash tbl! thx
<Smerdyakov>
It's the same way all hash tables are used....
<CybeRDukE>
well, i had hash tabls in mind where key and value are the same... but of course the key/value thing is much more useful
<CybeRDukE>
thx a lot for your help
<Smerdyakov>
:-)
phubuh has joined #ocaml
<Maddas>
phubuh: out of personal interest, how much bandwidth do you have?
<phubuh>
10 Mbit/s. :-)
* Maddas
mutters something about sweden
<phubuh>
:-P
<Demitar>
Well he doesn't have 100Mbit/s. ;-)
<Maddas>
I'm sure he's just waiting for the upgrade.
<phubuh>
My ISP wants to upgrade some time next summer.
<Maddas>
See?
<Maddas>
I'd be happy if I could get 1mbit/s for a reasonable amount of money.
* Demitar
on the other hand only has 512kbit/s. ;-)
<Demitar>
SUNET is a bit too fast though. ;-) 10Gbit in the main system and 2.5Gbit to each university.
* Demitar
ponders how to say "stamnät" in english.
<phubuh>
The individual dorms only get 10 Mbit/s, though, right?
<Demitar>
I don't know for sure but that's what I'd be guessing.
<Maddas>
only 10mbit oh no!($*!
<phubuh>
:-)
<Maddas>
We get 6mbit for 6*6*4 people, shared.
<phubuh>
Ouch!
<Maddas>
That's only because it's a student complex near to the university, otherwise, you don't get anything from university.
<Demitar>
Maddas, well a friend of mine called SUNET "swedens largest playground". ;-)
<Maddas>
Except cheaper internet, 1mbit for 17 Euro monthly, which is awesome compared to normal offers.
<Demitar>
Well 17 Euro is cheap. My 512k adsl costs about twice as much, then again I'm not a uni student anymore.
<Maddas>
Demitar: My 512k ADSL costs about 4x as much.
Hipo has quit [Read error: 104 (Connection reset by peer)]
<Maddas>
They upgraded it to 768kbit due to many complaints though, since you didn't effectively get anywhere as much and some consumer protecting organisation intervented.
afxpy_sleep has quit [calvino.freenode.net irc.freenode.net]
liyang has quit [calvino.freenode.net irc.freenode.net]
drlion has quit [calvino.freenode.net irc.freenode.net]
teratorn has quit [calvino.freenode.net irc.freenode.net]
det has quit [calvino.freenode.net irc.freenode.net]
rox has quit [calvino.freenode.net irc.freenode.net]
Demitar has quit [calvino.freenode.net irc.freenode.net]
demitar_ has joined #ocaml
demitar_ is now known as Demitar
afxpy_sleep has joined #ocaml
liyang has joined #ocaml
rox has joined #ocaml
teratorn has joined #ocaml
drlion has joined #ocaml
det has joined #ocaml
mattam has joined #ocaml
<CybeRDukE>
bye
CybeRDukE has quit ["God is real... unless declared an integer."]
lus|wazze has joined #ocaml
mattam_ has quit [Read error: 110 (Connection timed out)]
buggs has quit [Connection reset by peer]
buggs has joined #ocaml
<phubuh>
Gah! I hate that type constructors aren't curryable.
<mellum>
Wasn't there some camlp4 magic that made them curryable?
<phubuh>
Ooh!
<mellum>
I've never really missed it, it's not too hard to write (fun x -> A x) after all
<phubuh>
No, but it gets annoying when you have semi-long lists that all use different type constructors, e.g., do_something (match foo with bar -> Bar | baz -> Baz | qux -> Qux) has to be written as do_something (match foo with bar -> (fun x -> Bar x) | baz -> (fun x -> Baz x) | qux -> (fun x -> Qux x))
<phubuh>
Haskell got me used to them. :-)
<Riastradh>
phubuh, no, it wasn't camlp4; it's this thing called 'Haskell'...
<Riastradh>
Bah!
<phubuh>
I want to stay as far away as possible from GHC's non-standard I/O extensions
<Riastradh>
Which ones?
<mellum>
I think the "revised syntax" for Ocaml has currified constructors
<phubuh>
Non-blocking I/O, for instance.
<phubuh>
mellum, oh, that's great! I'd use it if it had an Emacs mode. :(
<mellum>
phubuh: Hm, does the standard one not play along nicely with it? I've never really tried the revised syntax, I looked at it once and didn't like a few decisions
<phubuh>
Maybe it does.
<phubuh>
I'll try when I get the time. :-)
<mellum>
Ah yes, I didn't like a::b witten as [a::b] for example, that is confusing
<mellum>
although for sure it would reduce bugs with bogus precedence assumprions of ::
<phubuh>
?! That's weird.
<phubuh>
I don't understand how anyone talented enough to operate a computer could craft something as hellishly worthless as the Direct Connect protocol.
<mellum>
But forcing x.val instead of !x really seems like a bad idea, that will make imperative programs totally unreadable
<phubuh>
"ValidateDenide", "LogedIn", strange magic rituals that are entirely unnecessary, etc.
<phubuh>
Ugh. I like the Scheme camlp4 syntax. :-)
<Riastradh>
I just like Scheme!
<mellum>
Riastradh: then what are you doing on #ocaml? ;)
<Riastradh>
mellum, converting people!
<phubuh>
Riastradh lurks in all the language channels to insert subtle quips!
<mellum>
Riastradh: Heretic!
<Riastradh>
You infidels are using an inferior language! Switch to Scheme before the Ultimate and All-Powerful Lambda sends you into the darkest depths of the Imperative Hell!
<phubuh>
Lambda? That's an inconveniently long name!
* phubuh
throws some fun at Riastradh.
<Riastradh>
Flee while you can! Let yourself fall into the gentle clutches of Scheme! Break the bonds of an idiotic syntax!
<mellum>
Hey, Scheme is more imperative than Ocaml, it has set-cdr and Ocaml hasn't :)
<phubuh>
No, your syntax is idiotic -- it doesn't even know the precedence rules of the standard mathematical operators!
<Riastradh>
It doesn't need to know that! OCaml, with its disgusting infix syntax, needs such silly problems to worry about that people worry too much about silly things!
<Riastradh>
Algebraic syntax, I admit, would be cool, but not in plain text.
<phubuh>
Heck, the entire -point- of Scheme syntax is to be as idiotic as possible!
<mellum>
Now I think you're confusing it with C++.
<phubuh>
C++ tries to be smart, but fails horribly, and ends up more idiotic than anything. :-)
buggs has quit [Read error: 110 (Connection timed out)]
<Maddas>
Oh oh, Scheme bashing! Am I late?
<phubuh>
Better late than never!
<Maddas>
Yay!
* Riastradh
invokes a continuation into Maddas's head and starts subverting him from within.
<Maddas>
Scheme has call/cc, that's enough already against Scheme!
<Maddas>
haha
<Riastradh>
Oh, so having one of the most powerful control structures possible is a bad thing?
<Maddas>
Yes!
* Riastradh
can't wait to hear the illogic behind this one.
<Maddas>
It's so obvious that I need no reasoning!
<Riastradh>
No, it obviously isn't obvious, because I'm waiting for your explanation!
<Maddas>
You're just trying to ridicule me by ignorance!
* Maddas
runs
* Maddas
distributes "call/cc is evil!" leaflets while running
<Maddas>
Actually, I wish O'Caml had it too, just for fooling around
<Riastradh>
Just for fooling around and nothing else?
<Riastradh>
Not, like, implementing backtracking or coroutines?
<Maddas>
Maybe that, too :)
<Maddas>
But fooling around is all that I have time for at the moment
<Maddas>
...and trying to understand it, of course :)