Banana changed the topic of #ocaml to: OCaml 3.08.1 available! | Archive of Caml Weekly News: http://sardes.inrialpes.fr/~aschmitt/cwn/ | A tutorial: http://merjis.com/richj/computers/ocaml/tutorial/ | 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/
dan2 has joined #ocaml
<dan2> how do I find the length of a string array?
<kinners> Array.length
<dan2> thanks
<dan2> kinners: how do I turn a string array to a list?
<kinners> Array.to_list
<Smerdyakov> Sounds like someone isn't bothering to read the manual. :D
lodewijk has joined #ocaml
lodewijk has quit ["[BX] Elvis has left the building"]
<dan2> whats the syntax for arrays?
<dan2> erm, vectors
<dan2> to create them
<dan2> [|"foo";"bar";|]?
<kinners> you don't need the final ;
<dan2> ahh
shawn has joined #ocaml
shawn_ has quit [Connection reset by peer]
shawn_ has joined #ocaml
shawn has quit [Read error: 104 (Connection reset by peer)]
cjohnson has quit [Read error: 104 (Connection reset by peer)]
cjohnson has joined #ocaml
salo has joined #ocaml
<salo> is the float value of pi defined somewhere in the standard modules?
<kinners> no
<salo> alas
srv has quit [Remote closed the connection]
srv has joined #ocaml
mrsolo has joined #ocaml
<dan2> salo: Math.pi?
mrsolo has quit [Read error: 232 (Connection reset by peer)]
<dan2> salo: (probably doesn't exit)
<dan2> exist
<salo> doesnt appear to be a Math module
<kinners> people generally use let pi = 2.0 *. acos 0.0 or similar
cjohnson has quit [Read error: 104 (Connection reset by peer)]
cjohnson has joined #ocaml
mrsolo has joined #ocaml
<salo> module Domain = Set(OrderedInt);;
<salo> is this not the way to label an OrderedInt?
<kinners> do you mean Set.Make(...)?
<salo> module OrderedInt =
<salo> struct
<salo> type t = int
<salo> let compare = compare
<salo> end;;
<salo> module Domain = Set.Make(OrderedInt);;
<salo> does that seem sensible?
<kinners> yes
<salo> so i can use Domain.cardinal, Domain.remove, etc?
<kinners> yes
kinners has quit ["leaving"]
<salo> what type is a Domain value? doesn't appear that Domain is a valid type ...
<Smerdyakov> salo, you shouldn't need to ask this.
<Smerdyakov> salo, the signature of Set should contain all the information you need.
<salo> how about "type domain = Domain.t" is that legit?
<Smerdyakov> Why don't you try it and see?
<salo> well it appears to work, but i am on to other errors
cjohnson has quit ["The main attraction: distraction"]
avlondono has joined #ocaml
salo has quit []
GreyLensman has quit ["Leaving"]
ez4 has quit ["Quitting!"]
mrsolo_ has joined #ocaml
mrsolo has quit [Read error: 113 (No route to host)]
det has quit ["leaving"]
det has joined #ocaml
shawn has joined #ocaml
shawn_ has quit [Read error: 104 (Connection reset by peer)]
srv has quit [Read error: 232 (Connection reset by peer)]
srv has joined #ocaml
vezenchio has joined #ocaml
<det> Is it possible to write camlp4 expanders that expand to an expander
pango has quit ["Client exiting"]
pango has joined #ocaml
ez4 has joined #ocaml
mlh has quit [Client Quit]
Naked_ has joined #ocaml
Naked_ is now known as Hadaka
m3ga has joined #ocaml
m3ga has quit [Client Quit]
ez4 has quit ["Quitting!"]
ofranja has joined #ocaml
_fab has quit [Remote closed the connection]
daapp has joined #ocaml
mlh has joined #ocaml
daapp has left #ocaml []
mlh has quit [Client Quit]
_fab has joined #ocaml
cjohnson has joined #ocaml
shawn_ has joined #ocaml
shawn has quit [Read error: 104 (Connection reset by peer)]
CosmicRay has joined #ocaml
vincenz has quit ["leaving"]
vincenz has joined #ocaml
eugos has joined #ocaml
cjohnson has quit [Read error: 104 (Connection reset by peer)]
cjohnson has joined #ocaml
cjohnson has quit [Read error: 104 (Connection reset by peer)]
cjohnson has joined #ocaml
haakonn_ has joined #ocaml
haakonn has quit [Read error: 104 (Connection reset by peer)]
eugos has quit ["Leaving"]
mrsolo_ has quit [Read error: 60 (Operation timed out)]
karryall has joined #ocaml
Smerdy has joined #ocaml
Smerdyakov has quit [Nick collision from services.]
Smerdy is now known as Smerdyakov
Smerdy has joined #ocaml
Smerdyakov has quit [Read error: 110 (Connection timed out)]
karryall has quit ["tcho"]
Smerdy is now known as Smerdyakov
menace has joined #ocaml
mrsolo_ has joined #ocaml
docelic has quit ["brb"]
docelic has joined #ocaml
pango has quit ["Leaving"]
pango has joined #ocaml
det has quit ["Lost terminal"]
mrsolo_ has quit [Read error: 110 (Connection timed out)]
det has joined #ocaml
menace has quit [" HydraIRC -> http://www.hydrairc.com <- s0 d4Mn l33t |t'z 5c4rY!"]
vezenchio has quit [Read error: 60 (Operation timed out)]
cjohnson has quit [Read error: 54 (Connection reset by peer)]
cjohnson has joined #ocaml
cjohnson has quit [Read error: 54 (Connection reset by peer)]
cjohnson has joined #ocaml
Nutssh has joined #ocaml
eugos has joined #ocaml
cjohnson has quit [Connection reset by peer]
cjohnson has joined #ocaml
eugos has left #ocaml []
monochrom has joined #ocaml
cjohnson has quit [Read error: 232 (Connection reset by peer)]
cjohnson has joined #ocaml
CosmicRay has quit ["Client exiting"]
mrsolo_ has joined #ocaml
mlh has joined #ocaml
monochrom has quit ["Don't talk to those who talk to themselves."]
cjohnson has quit [Read error: 104 (Connection reset by peer)]
monochrom has joined #ocaml
cjohnson has joined #ocaml
zigong has joined #ocaml
cjohnson has quit [Read error: 54 (Connection reset by peer)]
cjohnson has joined #ocaml
Blicero has joined #ocaml
mrsolo_ has quit [Read error: 110 (Connection timed out)]
cjohnson has quit [Read error: 54 (Connection reset by peer)]
cjohnson has joined #ocaml
<vincenz> hello
<vincenz> how do I find the key of something that matches a map-find?
<Smerdyakov> What?
<vincenz> Map.find only gives me the value not the key of a found match
<Smerdyakov> But the key is exactly the argument you pass to Map.find....
<vincenz> not quite
<Smerdyakov> OK.
<vincenz> basically I have a map of blocks
<vincenz> with as key (begin-address, end-address)
<Smerdyakov> You are abusing the contract if you want to distinguish between things that your comparison function says are equal.
<vincenz> well let me explain the situation
<vincenz> so I have this map
<vincenz> (ba, ea)
<vincenz> and now I find (ba1, ea1)
<Smerdyakov> I don't know what that means.
<vincenz> that's the key, begin-address, end-address
<Smerdyakov> But you said it was a map....
<vincenz> yes
<vincenz> it maps to some values that I need
<Smerdyakov> A key is not a mpa.
<vincenz> ...
<Smerdyakov> A key is not a map.
<vincenz> it maps the begin-address and end-address to the size of the block and num_accesses
<vincenz> but the compare function works as follows
<Smerdyakov> OK, but there is a difference between the key and the map.
<Smerdyakov> Look, if you care about the key values, add them to the type that you map to.
<vincenz> if ea2 <= ba1 or ea1 <= ba2 then it doesn't match
<vincenz> touche
<vincenz> was just hoping for a better way, but alright
<vincenz> howabout a find/remove in one ?
<vincenz> so I don't have to run over the tree twice
monochrom has quit ["Don't talk to those who talk to themselves."]