00:01
mikeX has joined #ocaml
00:01
buluca has joined #ocaml
00:01
cmeme has joined #ocaml
00:01
flux__ has joined #ocaml
00:01
zamez has joined #ocaml
00:01
Foxyloxy has joined #ocaml
00:01
l_a_m has joined #ocaml
00:01
fremo has joined #ocaml
00:01
Hadaka has joined #ocaml
00:01
khaladan has joined #ocaml
00:01
TaXules has joined #ocaml
00:01
mattam has joined #ocaml
00:01
ulfdoz has joined #ocaml
00:01
haelix has joined #ocaml
00:01
Ugarte has joined #ocaml
00:01
triple_ has joined #ocaml
00:01
Norgg has joined #ocaml
00:01
pingu has joined #ocaml
00:01
zmdkrbou has joined #ocaml
00:01
bebui has joined #ocaml
00:01
_fab has quit [Remote closed the connection]
00:01
m3ga has joined #ocaml
00:01
m3ga has left #ocaml []
02:25
clog has joined #ocaml
02:29
beschmi has joined #ocaml
02:41
batdog has quit [Read error: 110 (Connection timed out)]
02:41
chessguy has joined #ocaml
02:54
danly has joined #ocaml
02:58
mikeX has quit ["leaving"]
03:09
batdog|gone has joined #ocaml
03:10
batdog|gone is now known as batdog
03:13
jordan has joined #ocaml
03:14
<
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?
03:17
<
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
03:20
<
tsuyoshi >
are you serious that it isn't included because it's a few lines?
03:20
<
tsuyoshi >
that's not a very good reason...
03:20
<
jordan >
why String.iter? it expects a function that returns unit
03:21
<
jordan >
I'd need something like String.map
03:21
<
tsuyoshi >
you could do it with String.iter... although
03:21
<
tsuyoshi >
it only goes forward and not reverse iirc
03:21
<
tsuyoshi >
so it'd be better to use a for loop to make a list
03:21
<
beschmi >
jordan: string.iter and a list ref work too
03:22
<
beschmi >
tsuyoshi: that's the reasoning of the inria people, seems like they want to keep the standard lib pretty minimal
03:23
<
jordan >
why a list ref? i don't understand
03:23
<
beschmi >
i think that's why extlib was started and it's the first thing i install after the compiler
03:28
<
jordan >
what's wrong with something like
03:28
<
jordan >
let l = ref [] in (String.iter (fun x -> !l = (List.append !l [x])) "abc");;
03:30
dibblego has joined #ocaml
03:32
<
beschmi >
you have to use l := !l @ [x] or even better l := x :: !l and List.rev !l before returning the list
03:32
sponge45 has left #ocaml []
03:33
<
beschmi >
but if you find yourself writing these small functions over and over, you should install extlib
03:34
<
tsuyoshi >
huhhh...
03:34
<
tsuyoshi >
wow I would make a recursive function
03:34
<
tsuyoshi >
rather than use a reference
03:37
<
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) [];;
03:38
<
beschmi >
i would prefer the ref in this case because you can reuse String.iter instead of using indices
03:38
<
tsuyoshi >
that's wrong
03:40
<
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) [];;
03:40
<
tsuyoshi >
there, that's right
04:16
dbueno has joined #ocaml
04:16
<
dbueno >
Is there a way to do bitwise ops on Big_ints?
05:02
Smerdyakov has quit ["Leaving"]
05:12
<
jordan >
let l = ref [];; l := [1];; fails?
05:13
<
jordan >
i dont understand why
05:14
<
jordan >
restarted ocaml and it worked
05:20
triple_ has quit [Read error: 54 (Connection reset by peer)]
05:22
sponge45 has joined #ocaml
05:28
buluca has quit [Read error: 110 (Connection timed out)]
05:42
Mr_Awesome has quit ["...and the Awesome level drops"]
05:43
dbueno has quit ["Leaving"]
05:44
Demitar_ has joined #ocaml
05:44
Demitar has quit [Read error: 104 (Connection reset by peer)]
05:49
triple_ has joined #ocaml
05:55
Demitar_ has quit [Read error: 104 (Connection reset by peer)]
05:55
Demitar__ has joined #ocaml
05:55
Demitar__ has quit [Read error: 104 (Connection reset by peer)]
05:56
dibblego has quit ["Leaving"]
06:13
danly has quit ["Leaving"]
06:19
beschmi has quit [Read error: 111 (Connection refused)]
06:31
pango_ has quit [Remote closed the connection]
06:33
sponge45 has quit ["zzzzzzzzzz"]
06:33
yondalf has joined #ocaml
06:58
Snark has joined #ocaml
07:02
yondalf has quit ["leaving"]
07:05
_velco has joined #ocaml
07:51
love-pingoo has joined #ocaml
08:02
kral has joined #ocaml
08:05
<
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
08:05
<
flux__ >
while running, that is
08:05
<
flux__ >
surely it's some problem with sdl, but..
08:05
<
tsuyoshi >
can you get a backtrace
08:07
<
flux__ >
I suppose I might
08:08
<
flux__ >
I better use a natively compiled version for that
08:09
<
flux__ >
except apparently ubuntu's libsdl for ocaml doesn't link natively
08:09
velco has joined #ocaml
08:09
<
flux__ >
hm, SDL_SetColorKey
08:10
<
flux__ >
from sdlttf_render_text_solid
08:10
<
flux__ >
hooray, not ocaml's fault ;-)
08:28
ikaros_ has joined #ocaml
08:28
gene9 has joined #ocaml
08:28
ikaros has quit [Read error: 110 (Connection timed out)]
08:29
love-pingoo has quit ["Connection reset by pear"]
08:34
Skal has joined #ocaml
08:38
gene9 has quit ["Leaving"]
08:39
Ugarte_ has joined #ocaml
08:39
Ugarte has quit [Read error: 54 (Connection reset by peer)]
09:04
gene9 has joined #ocaml
09:13
gene9 has quit ["Leaving"]
09:43
pango has joined #ocaml
09:43
pango has quit [Remote closed the connection]
09:44
pango has joined #ocaml
10:18
buluca has joined #ocaml
10:21
himbele has joined #ocaml
10:44
Demitar__ has joined #ocaml
11:05
slipstream-- has joined #ocaml
11:08
_fab has joined #ocaml
11:11
slipstream has quit [Read error: 104 (Connection reset by peer)]
11:24
pango has quit [Remote closed the connection]
11:25
himbele has quit ["Leaving"]
11:26
pango has joined #ocaml
11:38
]] has joined #ocaml
11:50
Snark has quit ["Leaving"]
11:59
joshcryer has quit [Read error: 110 (Connection timed out)]
12:03
dark_light has quit ["Ex-Chat"]
12:07
datrus has joined #ocaml
12:20
MisterC has joined #ocaml
12:32
Skal has quit [Connection timed out]
12:33
love-pingoo has joined #ocaml
12:56
<
datrus >
can a Set contain the same element twice? when i do Set.elements on a string set, the resulting lists contains duplicate strings
13:00
<
datrus >
ah no, my mistake. apparently the @ operator has less precedence than function call
13:41
]] is now known as lde`
13:41
lde` is now known as ]]
13:52
pango has quit [Remote closed the connection]
13:55
pango has joined #ocaml
14:31
dylan has joined #ocaml
14:32
dylan has left #ocaml []
14:45
Smerdyakov has joined #ocaml
14:47
mikeX has joined #ocaml
15:49
chessguy has joined #ocaml
16:20
Leonidas has joined #ocaml
16:23
bmiller has joined #ocaml
16:33
love-pingoo has quit ["Leaving"]
16:40
kral has quit [Read error: 104 (Connection reset by peer)]
16:41
trrkkkkkk has joined #ocaml
16:52
danly has joined #ocaml
16:54
bluestorm has joined #ocaml
17:02
velco has quit ["Ex-Chat"]
17:27
_velco has quit ["I'm outta here ..."]
17:29
smimou has joined #ocaml
17:43
_fab has quit [Read error: 110 (Connection timed out)]
17:43
_fab has joined #ocaml
17:51
Snark has joined #ocaml
18:05
jordan has quit [Read error: 110 (Connection timed out)]
18:17
ygrek has joined #ocaml
18:18
Ugarte_ is now known as Ugarte
18:18
]] has left #ocaml []
18:19
]] has joined #ocaml
18:19
]] has left #ocaml []
18:19
love-pingoo has joined #ocaml
18:19
]] has joined #ocaml
18:19
]] has quit ["ERC Version 5.1.4 (IRC client for Emacs)"]
18:32
ygrek has left #ocaml []
18:42
gunark has joined #ocaml
18:43
<
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)
18:45
<
gunark >
hm ok looks like i have to extract a single char value, and then i can get the int value of that
18:48
lde has joined #ocaml
18:49
<
mellum >
int_of_char
18:53
mariano_ has joined #ocaml
18:58
trrkkkkk has joined #ocaml
19:03
Snark has quit ["Leaving"]
19:06
<
gunark >
ah nice...what's the difference between Char.code 'c' and int_of_char 'c'?
19:06
mariano_ has quit [Remote closed the connection]
19:07
trrkkkkkk has quit [Read error: 148 (No route to host)]
19:08
pattern- has joined #ocaml
19:09
<
lde >
gunark: in pervasives.ml: external int_of_char : char -> int = "%identity"
19:09
<
lde >
in char.ml: external code: char -> int = "%identity"
19:11
mariano_ has joined #ocaml
19:14
pattern has quit [Read error: 110 (Connection timed out)]
19:14
pattern- is now known as pattern
19:32
<
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 :(
19:42
bluestorm is now known as bluestorm_aw
19:44
trrkkkkkk has joined #ocaml
19:52
trrkkkkk has quit [Read error: 145 (Connection timed out)]
19:58
<
gunark >
that's the one
19:58
<
gunark >
fftw_stub.c: In function ‘fftw_alloc_null_bigarray’:
19:58
<
gunark >
fftw_stub.c:132: error: invalid lvalue in assignment
19:58
<
gunark >
make:
*** [fftw_stub.o] Error 1
20:01
<
tsuyoshi >
probably not hard to fix...
20:01
<
tsuyoshi >
or maybe you don't know c?
20:01
<
gunark >
c mostly makes me nauseous
20:02
<
tsuyoshi >
oh, well
20:02
<
gunark >
anyway i'm looking at it and don't really know why it wouldn't work... looks fine to me
20:03
jajs has joined #ocaml
20:04
<
gunark >
COMPLEX_BIGARRAY_VAL(null_bigarray) = NULL;
20:04
<
gunark >
where COMPLEX_BIGARRAY_VAL is...
20:04
<
gunark >
#define COMPLEX_BIGARRAY_VAL(v) ((fftw_complex *) Data_bigarray_val(v))
20:08
<
lde >
which fftw do you have?
20:09
<
gunark >
2.1.5-17 looks like
20:09
<
gunark >
should I get 3 maybe?
20:10
<
gunark >
lets try that...
20:10
bluestorm_aw is now known as bluestorm
20:10
<
lde >
no, you need 2
20:11
<
gunark >
hm well then... :(
20:12
<
mellum >
casts as lvalues were disabled in newer gccs, this used to be an extension
20:12
<
mellum >
but nobody understood wtf the semantics should be, so it was dropped :)
20:14
<
gunark >
my competence in C is near-illiterate, so i'm probably screwed
20:15
<
lde >
so deleting (fftw_complex *) should fix that iiuc
20:15
<
lde >
this could brake something else
20:16
<
lde >
Data_bigarray_val(null_bigarray) = NULL; should work
20:16
<
gunark >
lets see..
20:17
<
gunark >
now i've got ld issues, but that seems to have worked
20:19
<
tsuyoshi >
casting it to a fftw_complex * shouldn't be a problem I don't think
20:19
<
tsuyoshi >
that's weird
20:21
<
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
20:27
<
lde >
seems like everyone is using gcc 3 ;-)
20:44
love-pingoo has quit ["Connection reset by pear"]
20:53
<
tsuyoshi >
gunark: lot of what stuff?
21:07
<
gunark >
sciency stuff
21:09
<
gunark >
argh i finally got it all to compile... now i get this when i run the test :(
21:09
<
gunark >
*** glibc detected
*** ./test: malloc(): memory corruption: 0x080f9e18
***
21:24
<
gunark >
oh jesus it actually works
21:29
chessguy has joined #ocaml
21:29
ruben17 has joined #ocaml
21:33
ruben17 has quit []
21:51
jajs has quit [Remote closed the connection]
22:10
pango has quit ["Leaving"]
22:13
pango has joined #ocaml
22:40
bluestorm has quit ["Konversation terminated!"]
22:54
Leonidas has quit ["An ideal world is left as an exercise to the reader"]
23:11
zames has joined #ocaml
23:24
smimou has quit ["bli"]
23:27
zamez has quit [Read error: 110 (Connection timed out)]
23:45
trrkkkkk has joined #ocaml
23:53
trrkkkkkk has quit [Read error: 145 (Connection timed out)]