CosmicRay has quit ["Client exiting"]
julbouln has joined #ocaml
sieni has joined #ocaml
vincenz has quit [Remote closed the connection]
ski has quit [Read error: 110 (Connection timed out)]
quamaretto has joined #ocaml
quamaretto has quit [Nick collision from services.]
quamaretwo has joined #ocaml
<
shidan>
anyone here?
bluestorm has joined #ocaml
pauldia has joined #ocaml
dtribble_ has joined #ocaml
ayrnieu has joined #ocaml
dark_light has quit [No route to host]
dark_light has joined #ocaml
love-pingoo has joined #ocaml
mrsolo_ has joined #ocaml
mrsolo has quit [Read error: 110 (Connection timed out)]
revision17_ has quit [Read error: 110 (Connection timed out)]
Skal has joined #ocaml
smimou has joined #ocaml
bluestorm has quit [Remote closed the connection]
Schmurtz has joined #ocaml
Schmurtz has quit [Client Quit]
Schmurtz has joined #ocaml
iorek has joined #ocaml
_JusSx_ has joined #ocaml
iorek has quit ["Leaving"]
slipstream has quit [Read error: 104 (Connection reset by peer)]
slipstream has joined #ocaml
bluestorm has joined #ocaml
visq has joined #ocaml
iorek has joined #ocaml
ayrnieu has quit [Read error: 110 (Connection timed out)]
iorek has quit [Client Quit]
Smerdyakov has joined #ocaml
pauldia has quit [Read error: 110 (Connection timed out)]
Revision17 has joined #ocaml
<
_JusSx_>
i need a function such as explode and implode of SML
<
love-pingoo>
i.e. ?
<
_JusSx_>
explode : string -> char list
<
_JusSx_>
implode : char list -> string
<
_JusSx_>
i have a list of char and i wonna create a string from those chars
<
_JusSx_>
shall i code it? or does it exist ?
quamaretwo has quit ["bye"]
<
bluestorm>
val concat : string -> string list -> string
<
bluestorm>
String.concat sep sl concatenates the list of strings sl, inserting the separator string sep between each.
<
love-pingoo>
I once used Str.split to explode a string
<
love-pingoo>
but that's a bit overkill
<
love-pingoo>
Str.split (Str.regexp "") "bla" ;;
<
love-pingoo>
i had a bad perl education..
<
bluestorm>
fun str -> Array.to_list (Array.init (String.length str) (String.get str))
<
bluestorm>
this is for explode
<
_JusSx_>
thanx a lot i will code it by myself
<
bluestorm>
(it's not the better way of course, but it's simple)
<
love-pingoo>
maybe Extlib has these kind of things already coded
<
bluestorm>
and to implode, something like fun list -> String.concat "" (List.map (fun c -> String.make 1 c) list)
<
bluestorm>
dirty but simple
<
bluestorm>
(uhm (fun c -> String.make 1 c) is (String.make 1) )
visq has left #ocaml []
<
pango>
a char list probably uses 20 times the memory of the original string...
* dylan
sometimes pines for a String.fold_left and a String.map
KrispyKringle has joined #ocaml
_JusSx_ has quit ["leaving"]
<
flux__>
fold_right too, I guess, it would slightly more efficiently implement String.explode
<
zmdkrbou>
fold_right is not tail-recursive
jomputin_ has joined #ocaml
Skal has quit [Remote closed the connection]
pattern is now known as pattern-
pattern- is now known as pattern
pauldia has joined #ocaml
bluestorm has quit [Remote closed the connection]
danly has quit [Read error: 104 (Connection reset by peer)]
danly has joined #ocaml
danly has quit [Read error: 104 (Connection reset by peer)]
danly has joined #ocaml
love-pingoo has quit ["quidt"]
pauldia has quit [Read error: 110 (Connection timed out)]
joshcryer has joined #ocaml
smimou has quit ["bli"]
danly has quit [Read error: 104 (Connection reset by peer)]
danly has joined #ocaml