dark_light changed the topic of #ocaml to: OCaml 3.09.2 available! Archive of Caml Weekly News: http://sardes.inrialpes.fr/~aschmitt/cwn/ | A free book: http://cristal.inria.fr/~remy/cours/appsem/ | Mailing List: http://caml.inria.fr/bin/wilma/caml-list/ | Cookbook: http://pleac.sourceforge.net/
mikeX has joined #ocaml
buluca has joined #ocaml
cmeme has joined #ocaml
flux__ has joined #ocaml
zamez has joined #ocaml
Foxyloxy has joined #ocaml
l_a_m has joined #ocaml
fremo has joined #ocaml
Hadaka has joined #ocaml
khaladan has joined #ocaml
TaXules has joined #ocaml
mattam has joined #ocaml
ulfdoz has joined #ocaml
haelix has joined #ocaml
Ugarte has joined #ocaml
triple_ has joined #ocaml
Norgg has joined #ocaml
pingu has joined #ocaml
zmdkrbou has joined #ocaml
bebui has joined #ocaml
_fab has quit [Remote closed the connection]
m3ga has joined #ocaml
m3ga has left #ocaml []
clog has joined #ocaml
beschmi has joined #ocaml
batdog has quit [Read error: 110 (Connection timed out)]
chessguy has joined #ocaml
danly has joined #ocaml
mikeX has quit ["leaving"]
batdog|gone has joined #ocaml
batdog|gone is now known as batdog
jordan has joined #ocaml
<jordan> what's an efficient way to turn a string into a list (of chars)? i dont see a lib function am i missing it?
<beschmi> there is explode/implode in extlib. it's only a few lines of code (there is String.iter), so it isn't included in the standard lib
<tsuyoshi> are you serious that it isn't included because it's a few lines?
<tsuyoshi> that's not a very good reason...
<jordan> why String.iter? it expects a function that returns unit
<jordan> I'd need something like String.map
<tsuyoshi> you could do it with String.iter... although
<tsuyoshi> it only goes forward and not reverse iirc
<tsuyoshi> so it'd be better to use a for loop to make a list
<beschmi> jordan: string.iter and a list ref work too
<beschmi> tsuyoshi: that's the reasoning of the inria people, seems like they want to keep the standard lib pretty minimal
<jordan> why a list ref? i don't understand
<beschmi> i think that's why extlib was started and it's the first thing i install after the compiler
<jordan> what's wrong with something like
<jordan> let l = ref [] in (String.iter (fun x -> !l = (List.append !l [x])) "abc");;
dibblego has joined #ocaml
<jordan> oh :=
<beschmi> you have to use l := !l @ [x] or even better l := x :: !l and List.rev !l before returning the list
sponge45 has left #ocaml []
<beschmi> but if you find yourself writing these small functions over and over, you should install extlib
<tsuyoshi> huhhh...
<tsuyoshi> wow I would make a recursive function
<tsuyoshi> rather than use a reference
<tsuyoshi> let list_from_string s = let rec loop i l = if i = -1 then l else s.[i] :: l in loop ((String.length s) - 1) [];;
<beschmi> i would prefer the ref in this case because you can reuse String.iter instead of using indices
<tsuyoshi> errr
<tsuyoshi> that's wrong
<tsuyoshi> hmm
chessguy has quit [" HydraIRC -> http://www.hydrairc.com <- IRC with a difference"]
<tsuyoshi> let list_from_string s = let rec loop i l = if i = -1 then l else loop (i - 1) (s.[i] :: l) in loop ((String.length s) - 1) [];;
<tsuyoshi> there, that's right
<tsuyoshi> I think
dbueno has joined #ocaml
<dbueno> Is there a way to do bitwise ops on Big_ints?
Smerdyakov has quit ["Leaving"]
<jordan> let l = ref [];; l := [1];; fails?
<jordan> i dont understand why
<jordan> restarted ocaml and it worked
triple_ has quit [Read error: 54 (Connection reset by peer)]
sponge45 has joined #ocaml
buluca has quit [Read error: 110 (Connection timed out)]
Mr_Awesome has quit ["...and the Awesome level drops"]
dbueno has quit ["Leaving"]
Demitar_ has joined #ocaml
Demitar has quit [Read error: 104 (Connection reset by peer)]
triple_ has joined #ocaml
Demitar_ has quit [Read error: 104 (Connection reset by peer)]
Demitar__ has joined #ocaml
Demitar__ has quit [Read error: 104 (Connection reset by peer)]
dibblego has quit ["Leaving"]
danly has quit ["Leaving"]
beschmi has quit [Read error: 111 (Connection refused)]
pango_ has quit [Remote closed the connection]
sponge45 has quit ["zzzzzzzzzz"]
yondalf has joined #ocaml
Snark has joined #ocaml
yondalf has quit ["leaving"]
_velco has joined #ocaml
love-pingoo has joined #ocaml
kral has joined #ocaml
<flux__> hmh.. I wrote a little game on ocaml/cygwin, now I tried to compile it the first time on a linux-machine and it segfaults :-o
<flux__> while running, that is
<flux__> surely it's some problem with sdl, but..
<tsuyoshi> can you get a backtrace
<flux__> I suppose I might
<flux__> I better use a natively compiled version for that
<flux__> except apparently ubuntu's libsdl for ocaml doesn't link natively
velco has joined #ocaml
<flux__> hm, SDL_SetColorKey
<flux__> from sdlttf_render_text_solid
<flux__> hooray, not ocaml's fault ;-)
ikaros_ has joined #ocaml
gene9 has joined #ocaml
ikaros has quit [Read error: 110 (Connection timed out)]
love-pingoo has quit ["Connection reset by pear"]
Skal has joined #ocaml
gene9 has quit ["Leaving"]
Ugarte_ has joined #ocaml
Ugarte has quit [Read error: 54 (Connection reset by peer)]
gene9 has joined #ocaml
gene9 has quit ["Leaving"]
pango has joined #ocaml
pango has quit [Remote closed the connection]
pango has joined #ocaml
buluca has joined #ocaml
himbele has joined #ocaml
Demitar__ has joined #ocaml
slipstream-- has joined #ocaml
_fab has joined #ocaml
slipstream has quit [Read error: 104 (Connection reset by peer)]
pango has quit [Remote closed the connection]
himbele has quit ["Leaving"]
pango has joined #ocaml
]] has joined #ocaml
Snark has quit ["Leaving"]
joshcryer has quit [Read error: 110 (Connection timed out)]
dark_light has quit ["Ex-Chat"]
datrus has joined #ocaml
MisterC has joined #ocaml
Skal has quit [Connection timed out]
love-pingoo has joined #ocaml
<datrus> can a Set contain the same element twice? when i do Set.elements on a string set, the resulting lists contains duplicate strings
<datrus> ah no, my mistake. apparently the @ operator has less precedence than function call
]] is now known as lde`
lde` is now known as ]]
pango has quit [Remote closed the connection]
pango has joined #ocaml
dylan has joined #ocaml
dylan has left #ocaml []
Smerdyakov has joined #ocaml
mikeX has joined #ocaml
chessguy has joined #ocaml
Leonidas has joined #ocaml
bmiller has joined #ocaml
love-pingoo has quit ["Leaving"]
kral has quit [Read error: 104 (Connection reset by peer)]
trrkkkkkk has joined #ocaml
danly has joined #ocaml
bluestorm has joined #ocaml
velco has quit ["Ex-Chat"]
_velco has quit ["I'm outta here ..."]
smimou has joined #ocaml
_fab has quit [Read error: 110 (Connection timed out)]
_fab has joined #ocaml
chessguy has quit [" Try HydraIRC -> http://www.hydrairc.com <-"]
Snark has joined #ocaml
jordan has quit [Read error: 110 (Connection timed out)]
ygrek has joined #ocaml
Ugarte_ is now known as Ugarte
]] has left #ocaml []
]] has joined #ocaml
]] has left #ocaml []
love-pingoo has joined #ocaml
]] has joined #ocaml
]] has quit ["ERC Version 5.1.4 (IRC client for Emacs)"]
ygrek has left #ocaml []
gunark has joined #ocaml
<gunark> newb question: how do i convert a character from a string into an integer (i.e. i want to know the raw byte value of the character)
<gunark> hm ok looks like i have to extract a single char value, and then i can get the int value of that
lde has joined #ocaml
<mellum> int_of_char
mariano_ has joined #ocaml
trrkkkkk has joined #ocaml
Snark has quit ["Leaving"]
<gunark> ah nice...what's the difference between Char.code 'c' and int_of_char 'c'?
mariano_ has quit [Remote closed the connection]
trrkkkkkk has quit [Read error: 148 (No route to host)]
pattern- has joined #ocaml
<lde> gunark: in pervasives.ml: external int_of_char : char -> int = "%identity"
<lde> in char.ml: external code: char -> int = "%identity"
<gunark> i see
mariano_ has joined #ocaml
pattern has quit [Read error: 110 (Connection timed out)]
pattern- is now known as pattern
<gunark> anyone know if there's a good fast fourier transform library/binding for ocaml? The only one i can find on google looks hacky and won't compile :(
bluestorm is now known as bluestorm_aw
trrkkkkkk has joined #ocaml
trrkkkkk has quit [Read error: 145 (Connection timed out)]
<gunark> that's the one
<gunark> fftw_stub.c: In function ‘fftw_alloc_null_bigarray’:
<gunark> fftw_stub.c:132: error: invalid lvalue in assignment
<gunark> make: *** [fftw_stub.o] Error 1
<tsuyoshi> probably not hard to fix...
<tsuyoshi> or maybe you don't know c?
<gunark> c mostly makes me nauseous
<tsuyoshi> oh, well
<gunark> anyway i'm looking at it and don't really know why it wouldn't work... looks fine to me
jajs has joined #ocaml
<gunark> COMPLEX_BIGARRAY_VAL(null_bigarray) = NULL;
<gunark> where COMPLEX_BIGARRAY_VAL is...
<gunark> #define COMPLEX_BIGARRAY_VAL(v) ((fftw_complex *) Data_bigarray_val(v))
<gunark> meh..
<lde> which fftw do you have?
<gunark> 2.1.5-17 looks like
<gunark> should I get 3 maybe?
<gunark> lets try that...
bluestorm_aw is now known as bluestorm
<lde> no, you need 2
<gunark> hm well then... :(
<mellum> casts as lvalues were disabled in newer gccs, this used to be an extension
<mellum> but nobody understood wtf the semantics should be, so it was dropped :)
<gunark> argh
<gunark> my competence in C is near-illiterate, so i'm probably screwed
<lde> so deleting (fftw_complex *) should fix that iiuc
<lde> no, wait
<gunark> ...
<lde> this could brake something else
<lde> Data_bigarray_val(null_bigarray) = NULL; should work
<gunark> lets see..
<gunark> woohoo
<gunark> now i've got ld issues, but that seems to have worked
<gunark> thanks :)
<tsuyoshi> casting it to a fftw_complex * shouldn't be a problem I don't think
<tsuyoshi> that's weird
<gunark> i'm surprised this hasn't come up... seems like fft would be a necessity with a lot of the stuff ocaml is used for
<lde> seems like everyone is using gcc 3 ;-)
love-pingoo has quit ["Connection reset by pear"]
<tsuyoshi> gunark: lot of what stuff?
<gunark> sciency stuff
<gunark> argh i finally got it all to compile... now i get this when i run the test :(
<gunark> *** glibc detected *** ./test: malloc(): memory corruption: 0x080f9e18 ***
<gunark> whee
<gunark> oh jesus it actually works
<gunark> !!
chessguy has joined #ocaml
ruben17 has joined #ocaml
ruben17 has quit []
jajs has quit [Remote closed the connection]
pango has quit ["Leaving"]
pango has joined #ocaml
bluestorm has quit ["Konversation terminated!"]
Leonidas has quit ["An ideal world is left as an exercise to the reader"]
zames has joined #ocaml
smimou has quit ["bli"]
zamez has quit [Read error: 110 (Connection timed out)]
trrkkkkk has joined #ocaml
trrkkkkkk has quit [Read error: 145 (Connection timed out)]