<tautologico>
a looming deadline makes me miss that kind of things
<mauke>
damn, there is no range function
<tautologico>
nop
<mauke>
let rec range from to = if from > to then [] else from :: range (from + 1) to
<mauke>
let explode s = List.map (fun i -> s.[i]) (range 0 (String.length s - 1))
<mauke>
and now the same stuff in perl: sub implode { join '', @_ } sub explode { split //, $_[0] }
<tautologico>
I don't need explode right now :)
<tautologico>
well, in python:
<tautologico>
I don't remember, but it has functions for this too
<tautologico>
anyway, perl is made for this kind of stuff
<mauke>
yeah
<tautologico>
the only minor quibble is that range is not tail recursive
<tautologico>
but it shouldn't hurt in this case
<mauke>
huhu, in haskell:
<tautologico>
I made one that is tail recursive because I needed large ranges
<mauke>
implode :: [Char] -> String
<mauke>
implode = id
<tautologico>
well, not fair :)
<tautologico>
in haskell strings are char lists
<tautologico>
which is a more elegant representation, indeed
<tautologico>
good time to check how String.concat is implemented
<tautologico>
hm... that's a bit huge
<mauke>
lots of unsafe_blits
<tautologico>
yep
<tautologico>
my implode was
<tautologico>
let implode chlist = List.fold_left (fun s ch -> s ^ (String.make 1 ch)) "" chlist
<tautologico>
wonder which is more efficient
<tautologico>
well
<tautologico>
concat creates a single string with the right size
<tautologico>
fold will create many intermediate strings
cjohnson has quit [""We live like penguins in the desert...""]
eyda|mo has joined #ocaml
eyda|mo is now known as eyda|mon
ulfdoz has joined #ocaml
<eyda|mon>
the PXP seems like an overkill for what I want to do. I did see XML-light, but is there anything similar?
eyda|mon2 has quit [Read error: 110 (Connection timed out)]
<eyda|mon>
h, there it is
ulfdoz_ has quit [Read error: 60 (Operation timed out)]
tautologico has quit []
eyda|mon has quit []
vezenchio has joined #ocaml
epichrom has quit ["What is the meaning of "meaning"?"]
_shawn has joined #ocaml
<ulfdoz>
re
__DL__ has joined #ocaml
shawn_ has quit [Read error: 110 (Connection timed out)]
Snark has joined #ocaml
Herrchen has joined #ocaml
<Snark>
slt
pediddle has joined #ocaml
pediddle is now known as pediddle_
pediddle_ is now known as pediddle
pediddle has left #ocaml []
angagon has joined #ocaml
det has quit ["Terminated with extreme prejudice - dircproxy 1.0.5"]
det has joined #ocaml
gcharlo2 has joined #ocaml
_JusSx_ has joined #ocaml
Skal has joined #ocaml
Smerdyakov has quit [Client Quit]
Smerdyakov has joined #ocaml
Herrchen has quit ["bye"]
smimou has joined #ocaml
Shadek has joined #ocaml
<Shadek>
hello
<Shadek>
which editor / programming environment can I use to program in OCAML ?
<det>
emacs is great
kinners has joined #ocaml
<Shadek>
does it have a read, eval loop ?
<kinners>
ocaml? yes
<kinners>
using ledit/rlwrap makes it usable, and the emacs mode can be very useful
_JusSx_ has quit ["leaving"]
<kinners>
and there is the editor+shell written in tk too
<Shadek>
ok, I'll try the emacs solution
<Shadek>
I have it already configured with slime (lisp)
<kinners>
(ocamlbrowser is the tk version)
<Shadek>
but emacs+slime was a single ebuild... I wonder if there is an equivalent for ocaml... I suppose I'll have to configure it by hand
<kinners>
all I know is that an ocaml mode came with my xemacs, and that there is another mode called tuareg which I installed seperately (via a debian pkg)
<Shadek>
I see that in gentoo, there is an ocaml mode for xemacs, but I have emacs installed... I just don't want 2 emacs flavors to be installed at the same time.