jemfinch` changed the topic of #ocaml to: nob: it's not an option keyword. It's a datatype. 'a option. It can be either "None" or "Some data" -- it represents either data that's not there (None) or data that's there (Some data)
JGibson has joined #ocaml
awwaiid has joined #ocaml
<GnuVince> I still haven't figured out my reverse.ml problem Taaus
<GnuVince> Errr. forget it
<GnuVince> I just got it
<GnuVince> errr.
<GnuVince> maybe not
<malc> your newstring creation is stupid
<GnuVince> Yah
<malc> besides you index from 1, but should from 0
<GnuVince> reload
<GnuVince> I updated the code
<malc> Array.set newstring i (reverse old_str new_str old_pos new_pos);
<malc> should be (pred i)
<malc> and later on for i = 0 to ...
<GnuVince> yeah...
<GnuVince> but then I should diminish (is that a verb?) my newstring size by one too
<malc> no
<GnuVince> why not?
<malc> thiks
<malc> think i mean
<GnuVince> If I give one argument
<GnuVince> Sys.argv will have a size of 2
<GnuVince> But I only reverse one of those
<GnuVince> so only 1 will go into my newstring array
<malc> yes
<GnuVince> So why should newstring be the same size than Sys.argv?
<malc> it shouldnt
<GnuVince> Why did you say no earlier then?
<malc> because i didnt read your new example, mine had - 1 already
<malc> anyhow
<GnuVince> mkay
<malc> let arr =
<malc> Array.map (fun s -> reverse s (String.copy s) 0 (pred (String.length s)))
<malc> Sys.argv
<malc> in
<malc> Array.iter print_endline (Array.sub arr 1 (pred (Array.length arr)))
<malc> does the same, and has (arguably) more functional falvor
<GnuVince> It probably does
<GnuVince> But I do not understand it
<GnuVince> I'm new to O'Caml
<malc> tell me what exactly is confusing?
<GnuVince> everything?
<GnuVince> I really don't understand it
<GnuVince> Why is Sys.argv all alone on its line for example?
<GnuVince> what is fun?
<GnuVince> What are the parameters given to Array.map and Array.iter and what do those do?
<malc> okay
<malc> Array.map takes two arguments
<malc> a) function that takes array element as argument and returns value of the same type
<malc> b) array
<malc> (fun s -> ...) is this function (higher order)
<malc> Sys.argv is array of strings
<GnuVince> Oh!
<GnuVince> your chat client cut the line?
<malc> it's not necessary to have it on the same line
<malc> Array.iter takes two arguments
<GnuVince> I know, but I was confused nonetheless.
<malc> a) function that takes array element's type and returns unit (i.e. nothing)
<malc> b) array
<malc> so its pretty easy actually
<GnuVince> ok
<GnuVince> I'll look into that
<GnuVince> thanks a lot
<malc> n/p
<malc> let reverse_string s =
<malc> let l = String.length s in
<malc> let r = String.create l in
<malc> let rec f = function
<malc> 0 -> r.[pred l] <- s.[0]
<malc> | n -> r.[l - n] <- s.[pred n]; f (pred n)
<malc> in
<malc> f l;
<malc> r
<malc> neater (thats ofcourse in the eye of the beholder, but still)
malc has quit ["no reason"]
nob has joined #ocaml
<nob> hi
<nob> anybody knows ocamllex ?
nob has quit []
JGibson_ has joined #ocaml
samx2 has joined #ocaml
JGibson has quit [Read error: 110 (Connection timed out)]
samx has quit [Read error: 110 (Connection timed out)]
samx2 is now known as samx
comatoast has quit ["...must...math..."]
comatoast has joined #ocaml
jemfinch` has joined #ocaml
jemfinch has quit [Read error: 104 (Connection reset by peer)]
samx has quit [Read error: 110 (Connection timed out)]
comatoast has quit [carter.openprojects.net irc.openprojects.net]
mellum has quit [carter.openprojects.net irc.openprojects.net]
awwaiid has quit [carter.openprojects.net irc.openprojects.net]
pHa has quit [carter.openprojects.net irc.openprojects.net]
comatoast has joined #ocaml
awwaiid has joined #ocaml
mellum has joined #ocaml
pHa has joined #ocaml
jemfinch_ has joined #ocaml
jemfinch` has quit [Remote closed the connection]
JGibson__ has joined #ocaml
JGibson_ has quit [Read error: 110 (Connection timed out)]
comatoast has quit ["Whoosh!"]
MegaWatS has joined #ocaml
JGibson__ has quit [carter.openprojects.net irc.openprojects.net]
mellum has quit [carter.openprojects.net irc.openprojects.net]
awwaiid has quit [carter.openprojects.net irc.openprojects.net]
pHa has quit [carter.openprojects.net irc.openprojects.net]
JGibson__ has joined #ocaml
awwaiid has joined #ocaml
mellum has joined #ocaml
pHa has joined #ocaml
wazze has joined #ocaml
MegaWatS has quit [Read error: 104 (Connection reset by peer)]
__DL__ has joined #ocaml
MegaWatS has joined #ocaml
wazze has quit [Read error: 104 (Connection reset by peer)]
MegaWatS has quit ["oyasumi nasai"]
graydon has joined #ocaml
pHa has quit ["brb"]
sjh has joined #ocaml
sjh is now known as pHa
__DL__ has quit ["going to real life"]
smklsmkl has joined #ocaml
clog has joined #ocaml
two-face has joined #ocaml
<two-face> Hi there !
<Taaus> Hey.
<two-face> how doing?
<Taaus> I'm fine... You? :)
<two-face> not too bad
<two-face> how things going around ocaml ?
<Taaus> Well, I still haven't used it for anything, uh, useful ;)
<two-face> heh
<two-face> i'm planning a new window manager in ocaml
<Taaus> Neat.
<two-face> very ambitious, kinda E++
<Taaus> Ah.
<Taaus> Well, good luck ;)
<two-face> but also a lighter version for palmtos
<two-face> palmtops
<Taaus> Ah.
<two-face> i'm sure ocaml can do the job
<Taaus> :)
<two-face> with bindings
<two-face> bye
two-face has left #ocaml []
Verbed has joined #ocaml
gene9 has joined #ocaml
gene9 has quit []
samx has joined #ocaml
GnuVince has left #ocaml []
malc has joined #ocaml