shawn has joined #ocaml
bluestorm has quit ["Konversation terminated!"]
mikeX has quit ["leaving"]
jlouis__ has quit [zelazny.freenode.net irc.freenode.net]
ikaros has quit [zelazny.freenode.net irc.freenode.net]
Smerdyakov has quit [zelazny.freenode.net irc.freenode.net]
Submarine has quit [zelazny.freenode.net irc.freenode.net]
bsmith has quit [zelazny.freenode.net irc.freenode.net]
a-priori_ has quit [zelazny.freenode.net irc.freenode.net]
gunark has quit [zelazny.freenode.net irc.freenode.net]
lucca has quit [zelazny.freenode.net irc.freenode.net]
Submarine has joined #ocaml
bsmith has joined #ocaml
a-priori_ has joined #ocaml
jlouis has joined #ocaml
ikaros has joined #ocaml
Smerdyakov has joined #ocaml
lucca has joined #ocaml
malc_ has joined #ocaml
pstickne_ has quit [Read error: 54 (Connection reset by peer)]
pstickne_ has joined #ocaml
Mr_Awesome has quit ["...and the Awesome level drops"]
Smerdyakov has quit ["Leaving"]
malc_ has quit ["leaving"]
mrvn_ has joined #ocaml
mrvn has quit [Read error: 110 (Connection timed out)]
Amorphous has quit [zelazny.freenode.net irc.freenode.net]
delamon has quit [zelazny.freenode.net irc.freenode.net]
Amorphous has joined #ocaml
delamon has joined #ocaml
slipstream-- has joined #ocaml
slipstream has quit [Read error: 60 (Operation timed out)]
jlouis has quit [Connection reset by peer]
jlouis has joined #ocaml
benny__ is now known as benny
benny_ has joined #ocaml
benny has quit [Read error: 60 (Operation timed out)]
love-pingoo has joined #ocaml
rickardg has joined #ocaml
haelix has quit [Read error: 104 (Connection reset by peer)]
shawn has quit [Read error: 60 (Operation timed out)]
jlouis has quit [Remote closed the connection]
smimou has joined #ocaml
screwt8 has quit [Remote closed the connection]
Submarine has quit ["Leaving"]
love-pingoo has quit ["Connection reset by pear"]
shawn has joined #ocaml
screwt8 has joined #ocaml
bluestorm has joined #ocaml
rickardg has quit [Remote closed the connection]
screwt8 has quit [Read error: 104 (Connection reset by peer)]
love-pingoo has joined #ocaml
Amorphous is now known as puk
puk is now known as Amorphous
screwt8 has joined #ocaml
screwt8 has quit [Read error: 104 (Connection reset by peer)]
pwang has joined #ocaml
pwang has quit [Client Quit]
screwt8 has joined #ocaml
ikaros has quit ["segfault"]
Types_and_Kinds has joined #ocaml
Types_and_Kinds_ has joined #ocaml
Types_and_Kinds_ has quit [Remote closed the connection]
Types_and_Kinds_ has joined #ocaml
Types_and_Kinds has quit [Read error: 110 (Connection timed out)]
Types_and_Kinds_ is now known as Types_and_Kinds
er has quit [Remote closed the connection]
Smerdyakov has joined #ocaml
cjeris has joined #ocaml
<
flux>
hm, it's difficult to make printf-calls cps-style
<
flux>
because it already is cps..
<
flux>
ilta plänätty!
<
flux>
whops, ECHAN
<
mrvn_>
That should make it trivial.
<
flux>
my function definitions are like let foo cont = let result = do_something () in cont result
<
flux>
that is, the continuation is always the last parameter
<
flux>
so I can write foo @@ fun result ->\n bar result @@ fun result2 ->\n..
<
flux>
I don't think that's going to work with printf
<
flux>
(actually ksprintf)
<
mrvn_>
flux: you have to parse the format string and add a cont argument at the end.
<
mrvn_>
flux: passing the continuation first seems to make things a lot easier.
<
flux>
but it wrecks the code flow :)
<
flux>
well, I just use: send (fmt "..." ...) @@ fun () -> .. now
<
mrvn_>
But then you have to have all the arguments for printf preassembled already.
<
mrvn_>
And have to buffer them all if it blocks
<
mrvn_>
(which probably isn't a problem)
Types_and_Kinds has quit []
pango has quit [Remote closed the connection]
pango has joined #ocaml
Types_and_Kinds has joined #ocaml
Types_and_Kinds has quit [Client Quit]
love-pingoo has quit ["Leaving"]
tree has joined #ocaml
<
tree>
hi, have a little problem with correct handling chars and strings
<
tree>
i want to append a char to string
<
tree>
how can i do it?
<
mrvn_>
let add_char s c = let t = String.create (String.length s + 1) in String.blit s 0 t 0 (String.length s); t.[String.length s] = c; t
<
mrvn_>
let add_char s c = s^(String.make 1 c)
<
mrvn_>
If you need that frequently I suggest using module Buffer.
<
tree>
mrvn_: thx, i thought that there is simple method to make a string from char and then use ^ operator
<
flux>
String.make 1 'a'
<
flux>
the second version ;)
<
tree>
flux: but my char is not a constant
<
mrvn_>
Yeah, make is the closest you get to string_of_char
<
tree>
flux: hmm, i see. It does not have to be
<
mrvn_>
Adding a char to a string is rather expensive. Try to avoid it.
ikaros has joined #ocaml
david_koontz has joined #ocaml
jlouis has joined #ocaml
slipstream-- has quit [Read error: 54 (Connection reset by peer)]
slipstream has joined #ocaml
smimou has quit ["bli"]
Types_and_Kinds has joined #ocaml
rillig has joined #ocaml
Submarine has joined #ocaml
Types_and_Kinds has quit []
ikaros has quit [Remote closed the connection]
slipstream-- has joined #ocaml
malc_ has joined #ocaml
slipstream has quit [Read error: 60 (Operation timed out)]
ikaros has joined #ocaml
TaXules has quit [Read error: 110 (Connection timed out)]
smimou has joined #ocaml
Mr_Awesome has joined #ocaml
smimou has quit ["bli"]
rillig has quit ["exit(EXIT_SUCCESS)"]
cjeris has quit [Read error: 104 (Connection reset by peer)]
bluestorm has quit ["Konversation terminated!"]