2002-02-04 04:30
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)
00:42
JGibson has joined #ocaml
01:02
awwaiid has joined #ocaml
01:06
<
GnuVince >
I still haven't figured out my reverse.ml problem Taaus
01:09
<
GnuVince >
Errr. forget it
01:09
<
GnuVince >
I just got it
01:10
<
GnuVince >
maybe not
01:10
<
malc >
your newstring creation is stupid
01:13
<
malc >
besides you index from 1, but should from 0
01:13
<
GnuVince >
I updated the code
01:14
<
malc >
Array.set newstring i (reverse old_str new_str old_pos new_pos);
01:14
<
malc >
should be (pred i)
01:14
<
malc >
and later on for i = 0 to ...
01:15
<
GnuVince >
but then I should diminish (is that a verb?) my newstring size by one too
01:16
<
GnuVince >
why not?
01:19
<
malc >
think i mean
01:19
<
GnuVince >
If I give one argument
01:19
<
GnuVince >
Sys.argv will have a size of 2
01:19
<
GnuVince >
But I only reverse one of those
01:20
<
GnuVince >
so only 1 will go into my newstring array
01:21
<
GnuVince >
So why should newstring be the same size than Sys.argv?
01:21
<
GnuVince >
Why did you say no earlier then?
01:22
<
malc >
because i didnt read your new example, mine had - 1 already
01:22
<
malc >
Array.map (fun s -> reverse s (String.copy s) 0 (pred (String.length s)))
01:22
<
malc >
Array.iter print_endline (Array.sub arr 1 (pred (Array.length arr)))
01:22
<
malc >
does the same, and has (arguably) more functional falvor
01:23
<
GnuVince >
It probably does
01:23
<
GnuVince >
But I do not understand it
01:23
<
GnuVince >
I'm new to O'Caml
01:24
<
malc >
tell me what exactly is confusing?
01:24
<
GnuVince >
everything?
01:25
<
GnuVince >
I really don't understand it
01:26
<
GnuVince >
Why is Sys.argv all alone on its line for example?
01:26
<
GnuVince >
what is fun?
01:26
<
GnuVince >
What are the parameters given to Array.map and Array.iter and what do those do?
01:26
<
malc >
Array.map takes two arguments
01:27
<
malc >
a) function that takes array element as argument and returns value of the same type
01:27
<
malc >
(fun s -> ...) is this function (higher order)
01:27
<
malc >
Sys.argv is array of strings
01:27
<
GnuVince >
your chat client cut the line?
01:28
<
malc >
it's not necessary to have it on the same line
01:28
<
malc >
Array.iter takes two arguments
01:28
<
GnuVince >
I know, but I was confused nonetheless.
01:28
<
malc >
a) function that takes array element's type and returns unit (i.e. nothing)
01:28
<
malc >
so its pretty easy actually
01:30
<
GnuVince >
I'll look into that
01:30
<
GnuVince >
thanks a lot
01:32
<
malc >
let reverse_string s =
01:32
<
malc >
let l = String.length s in
01:32
<
malc >
let r = String.create l in
01:32
<
malc >
let rec f = function
01:32
<
malc >
0 -> r.[pred l] <- s.[0]
01:32
<
malc >
| n -> r.[l - n] <- s.[pred n]; f (pred n)
01:32
<
malc >
neater (thats ofcourse in the eye of the beholder, but still)
01:53
malc has quit ["no reason"]
02:11
nob has joined #ocaml
02:11
<
nob >
anybody knows ocamllex ?
03:17
JGibson_ has joined #ocaml
03:24
samx2 has joined #ocaml
03:37
JGibson has quit [Read error: 110 (Connection timed out)]
03:44
samx has quit [Read error: 110 (Connection timed out)]
03:45
samx2 is now known as samx
04:19
comatoast has quit ["...must...math..."]
05:18
comatoast has joined #ocaml
05:28
jemfinch` has joined #ocaml
05:30
jemfinch has quit [Read error: 104 (Connection reset by peer)]
05:40
samx has quit [Read error: 110 (Connection timed out)]
05:43
comatoast has quit [carter.openprojects.net irc.openprojects.net]
05:43
mellum has quit [carter.openprojects.net irc.openprojects.net]
05:43
awwaiid has quit [carter.openprojects.net irc.openprojects.net]
05:43
pHa has quit [carter.openprojects.net irc.openprojects.net]
05:44
comatoast has joined #ocaml
05:44
awwaiid has joined #ocaml
05:44
mellum has joined #ocaml
05:44
pHa has joined #ocaml
05:46
jemfinch_ has joined #ocaml
05:46
jemfinch` has quit [Remote closed the connection]
05:47
JGibson__ has joined #ocaml
06:07
JGibson_ has quit [Read error: 110 (Connection timed out)]
06:30
comatoast has quit ["Whoosh!"]
07:18
MegaWatS has joined #ocaml
09:46
JGibson__ has quit [carter.openprojects.net irc.openprojects.net]
09:46
mellum has quit [carter.openprojects.net irc.openprojects.net]
09:46
awwaiid has quit [carter.openprojects.net irc.openprojects.net]
09:46
pHa has quit [carter.openprojects.net irc.openprojects.net]
09:50
JGibson__ has joined #ocaml
09:50
awwaiid has joined #ocaml
09:50
mellum has joined #ocaml
09:50
pHa has joined #ocaml
11:07
wazze has joined #ocaml
11:07
MegaWatS has quit [Read error: 104 (Connection reset by peer)]
11:13
__DL__ has joined #ocaml
11:41
MegaWatS has joined #ocaml
11:41
wazze has quit [Read error: 104 (Connection reset by peer)]
14:12
MegaWatS has quit ["oyasumi nasai"]
17:57
graydon has joined #ocaml
18:11
pHa has quit ["brb"]
18:15
sjh has joined #ocaml
18:16
sjh is now known as pHa
19:48
__DL__ has quit ["going to real life"]
20:12
smklsmkl has joined #ocaml
20:28
clog has joined #ocaml
21:21
two-face has joined #ocaml
21:21
<
two-face >
Hi there !
21:27
<
two-face >
how doing?
21:28
<
Taaus >
I'm fine... You? :)
21:28
<
two-face >
not too bad
21:28
<
two-face >
how things going around ocaml ?
21:28
<
Taaus >
Well, I still haven't used it for anything, uh, useful ;)
21:29
<
two-face >
i'm planning a new window manager in ocaml
21:30
<
two-face >
very ambitious, kinda E++
21:30
<
Taaus >
Well, good luck ;)
21:30
<
two-face >
but also a lighter version for palmtos
21:30
<
two-face >
palmtops
21:31
<
two-face >
i'm sure ocaml can do the job
21:32
<
two-face >
with bindings
21:54
two-face has left #ocaml []
22:28
Verbed has joined #ocaml
22:29
gene9 has joined #ocaml
23:02
samx has joined #ocaml
23:04
GnuVince has left #ocaml []
23:14
malc has joined #ocaml