maml has quit ["Leaving"]
mlh_ has joined #ocaml
mfurr has quit ["Client exiting"]
araujo has joined #ocaml
vezenchio has quit ["Ayn Rand encapsulates the rage that every teenager feels on finding that his first paycheque has had taxes taken out of it"]
Sonarman has quit [Read error: 104 (Connection reset by peer)]
araujo has quit ["Programs must be written for people to read, and only incidentally for machines to execute"]
bk_ has joined #ocaml
mrsolo__ has quit [Read error: 54 (Connection reset by peer)]
ulfdoz_ has joined #ocaml
mauke has quit [Remote closed the connection]
mauke has joined #ocaml
Sonarman has joined #ocaml
ulfdoz has quit [Read error: 110 (Connection timed out)]
Herrchen has joined #ocaml
Herrchen_ has quit [Read error: 60 (Operation timed out)]
skylan has joined #ocaml
monochrom has quit ["good morning, sweet dream"]
bk_ has quit [""(quit)""]
mrvn has joined #ocaml
pango has quit [Remote closed the connection]
mrvn_ has quit [Read error: 110 (Connection timed out)]
pango has joined #ocaml
Snark has joined #ocaml
Msandin has joined #ocaml
totaln00b has joined #ocaml
<
totaln00b>
how can I convert a function that returns an into t a function that returns nothing?
<
Saulzar>
Return unit "()"
<
totaln00b>
let rec tksplit a =
<
totaln00b>
[] -> ([], [])
<
totaln00b>
| x :: y :: b ->
<
totaln00b>
let (c, d) = tksplit b
<
totaln00b>
in (x::c, y::d);;
<
totaln00b>
I want to split "a", which has even length
<
totaln00b>
so that it returns a tuple (x, y) for me
<
totaln00b>
where x has the even indexed elements of a
<
totaln00b>
and y has the odd indexed elments of a
<
totaln00b>
what am I doing wrong?
<
Saulzar>
Don't think you can do the matching like that
<
totaln00b>
fixed that
<
Saulzar>
let rec tksplit = function
<
totaln00b>
needed match blah with
<
totaln00b>
here, how about this though
<
totaln00b>
let tkwrite x y z = write_out
<
totaln00b>
(String.concat "" ["setctr "; zero_fill x; (string_of_float y);;
<
totaln00b>
compiles to give me
<
totaln00b>
blah blah -> int
<
totaln00b>
let tkwrite x y z = write_out
<
totaln00b>
(String.concat "" ["setctr "; zero_fill x; (string_of_float y); " 0 \n"]); ();;
<
totaln00b>
won't compile
<
totaln00b>
I thought that just made it into a func that returned unit
<
totaln00b>
let tkwrite x y z = write_out
<
totaln00b>
(String.concat "" ["setctr "; zero_fill x; (string_of_float y); " 0 \n"]); ();;
<
totaln00b>
Warning: this expression should have type unit.
<
totaln00b>
val tkwrite : float list -> float -> 'a -> unit = <fun>
<
Saulzar>
It does compile
<
Hadaka>
that's a warning, not an error
<
Hadaka>
and you should just put 'ignore' around the whole thing
<
totaln00b>
how so?
<
totaln00b>
and how do I get ri of the warning?
<
Hadaka>
ignore has type 'a -> ()
<
Hadaka>
and it causes no warnings
<
Hadaka>
so just give your value that you want to get rid of as a parameter to ignore
<
totaln00b>
ah, cool; thanks
<
Hadaka>
then it doesn't need the ; () thing either
<
Saulzar>
Hmm, but doesn't write_out have type unit anyway? Or it seems that it probably should...
<
totaln00b>
it calls the unix write function
munga has joined #ocaml
totaln00b has quit ["Leaving"]
mlh_ has quit ["who are you people and what are you doing in my computer!?"]
munga has quit ["Client exiting"]
araujo has joined #ocaml
Msandin has quit [Read error: 104 (Connection reset by peer)]
Skal has joined #ocaml
Saulzar has quit ["Leaving"]
araujo has quit ["Programs must be written for people to read, and only incidentally for machines to execute"]
Skal has quit [Read error: 104 (Connection reset by peer)]
Skal has joined #ocaml
vikasg has joined #ocaml
vikasg has quit [Read error: 145 (Connection timed out)]
vikasg has joined #ocaml
<
vikasg>
OCaml's graphics library is the only one I've come across that matches my ideal of a simple graphics library
* Snark
only uses lablgtk2
vikasg has quit ["Leaving"]
vezenchio has joined #ocaml
Demitar has joined #ocaml
puppygalore has joined #ocaml
puppygalore has left #ocaml []
pango has quit ["Leaving"]
mrsolo_ has joined #ocaml
menace has joined #ocaml
pango has joined #ocaml
<
mflux_>
vincenz, it only comes so far, but it's nice if you want to prototype something that needs visual output and ascii doesn't quite cut it
<
mflux_>
such as graphs or for example hull-algorithms
<
mflux_>
I suppose visualizing trees too can be helpful
<
mflux_>
oh, vikasg propablt left some time ag
<
Snark>
mflux_: about six hours ago ;-)
MisterC has joined #ocaml
Skal has quit [Read error: 145 (Connection timed out)]
Snark has left #ocaml []
menace has quit ["Verlassend"]
Amorphous has quit [Read error: 110 (Connection timed out)]
__DL__ has quit ["Bye Bye"]
<
mrvn>
I din't say which year did I?
vodka-goo has joined #ocaml
vodka-goo has quit [Read error: 54 (Connection reset by peer)]
mlh has joined #ocaml
mlh has quit [Client Quit]
mlh has joined #ocaml