<mrvn>
Never thought ocaml would switchs thread after each char of a string during output.
<taw>
hoho
<mrvn>
Is there any way to get a in_channel non blocking?
<mrvn>
Or to get the file_descr of it?
* taw
doesn't know
<mrvn>
Do you know what realy_input does with the partially read chars upon End_of_file?
<taw>
i can no slighties idea
<taw>
how to make float +Inf ?
<mrvn>
Float.Inf ?
<mrvn>
s/I/i/
<taw>
no
<mrvn>
Damn, really_input reads the chars into the string and removes them from the input.
<mrvn>
Is there an ftp client/module/class in ocaml somewhere?
<taw>
baad
<taw>
ocaml optimizing compiler is really bad
<taw>
i have made so brilliant optimalizations and it didn't make any difference :-P
<taw>
hehe
<Smerdyakov>
I thought it was a pretty good optimizing compiler.
<Smerdyakov>
As free compilers go
<taw>
hehe
<taw>
it was too good ;)
<taw>
this time
<taw>
it already optimized what i thought i'd have to do by hand
<Smerdyakov>
YOU THOUGHT WRONG
<taw>
hehe
gene9 has joined #ocaml
<stepcut>
mrvn: if Smerdyakov was around, he would tell you and ftp client is so easy there is no need for a pre-made module -- you could have written in the time you have been asking :p
<taw>
hmm
<taw>
no CPAN for ocaml ?
<taw>
we should make some CPAN and some way to write one-liners in ocaml
<taw>
that's the easiest way to promote the language
<taw>
;)
<stepcut>
the closest thing I have seen to CAPN is cdk, (camel development kit) but it seems to be unmaintained
<taw>
cpan ... mainained ... ;)
<taw>
yeah right ;)
<taw>
cdk seems nice start for me
<stepcut>
alot of the stuff wanted ocaml 2.x ...
<stepcut>
but I have pulled a few pieces from extlibs
gene9 has quit []
<taw>
some preprocessor for one-liners would be nice too
<stepcut>
supposedly you need the #!/usr/bin/ocamlrun part because /usr/bin/ocaml might be a script and you can't do #!/bin/some_script or something silly
<stepcut>
but /usr/bin/ocaml isn't a script on my system, so maybe that was in ocaml 2.x or something...
<stepcut>
you will also need to do: #directory "+unix"
<taw>
why ?
<stepcut>
and #load "unix.cma"
<stepcut>
if you want to use the Unix module (for example)
<taw>
interactive ocaml should have simpler syntax
<taw>
like use Unix;
<taw>
;)
<taw>
hmm
* taw
wants perlcaml ;)
<stepcut>
you can't specify the link flags on the #!/usr/bin/ocamlrun line..
<taw>
we would need something more anyway
<taw>
to do that
<stepcut>
any, I have written several ocamlscripts so it does work
<stepcut>
put that in your .emacs file if you are an emacs user
<stepcut>
and use tuareg-mode
<taw>
hmm
<taw>
i use tuareg-mode ...
<taw>
why do i need that ?
<stepcut>
normally tuareg mode will only load if the file ends in .ml (which scripts usually don't) or if the first line contains -*-tuareg-*-
<stepcut>
with that line, emacs will see the #! and the ocamlrun on the first line and realize it is an ocaml script
<taw>
huh ?
<taw>
tuareg ?
<taw>
oh, that was "or"
<taw>
hehe
skylan has quit [Connection reset by peer]
skylan_ is now known as sksylan
sksylan is now known as skylan
taw has quit ["Client Exiting"]
<mrvn>
stepcut: Ever read the ftc RFC?
<mrvn>
ftp even
<mellum>
mrvn: the one that makes you think "I want some of that weed, too"?
<mrvn>
No, the one where you think "That weed must have ben rotten"
<mrvn>
Who thinks about filetransfers between a 3 bit system and 17 bit system?
<mrvn>
s,bit,bit/byte
<mrvn>
Transfering the file in chunks of 666 bytes.
<mrvn>
Of cause noon ever uses chunk mode or non 8-bit transferes but its still there.
<mellum>
There should be a new one, which everybody can reasonably implement to 100%
<stepcut>
bah. Sometimes it would be nice if strings were simple a list of characters
<Smerdyakov>
Try Haskell =D
<stepcut>
Smerdyakov: I noramlly do
<mellum>
stepcut: how would you access character nr. 666 then? walk the whole list?
<stepcut>
mellum: yep :)
<mellum>
Great idea.
<stepcut>
mellum: i said sometimes, not all the time.
<mellum>
stepcut: well, then just write a function to convert it
<stepcut>
mellum: i am...
<stepcut>
I was suprised that such a function did not already exist in the Strings module, that's all...
<mrvn>
mellum: Strings are continous in ocaml but it still dumps them one at a time to the terminal instead of woing a simple write on the buffer.
<stepcut>
strings as a char list is good if you have a recursive function that is generating the string and you don't know how long the string will be ahead of time...
<mrvn>
stepcut: use streams
<mrvn>
or generate a char list and convert it at the end
<mellum>
stepcut: there was a discussion about this very question on the mailing list recently. The function is not there because char list simply is an awkward representation of a string.
<mrvn>
char lists take 16 times the space of a string.
<mrvn>
or even 24
<stepcut>
mrvn: so?
<mrvn>
Thats just too much
* Riastradh
wonders how mrvn comes to that conclusion...
<stepcut>
a wav file is 10 or 20 times bigger than an mp3, but that doesn't mean I don't want both
<mrvn>
Riastradh: 1 tag because its a record, 1 value for the char and 1 value for the next list. 24 Bytes.
<mrvn>
stepcut: wav and mp3 aren't the same.
<stepcut>
neither are a string and a char list
<mrvn>
stepcut: contentwise they are
Kinners has joined #ocaml
<stepcut>
whatever, saying 'png' and 'uncompressed' images then
<mrvn>
By the way, if strings would be char lists, what would you use to interface with the c libraries as buffers?
<stepcut>
mrnv: dunno. I am just used to it being that way from Haskell -- normally I don't care that much except for this one function
<mrvn>
But there should be a explode and implode function, a to_list and from_list
<mrvn>
just like with arrays.
<stepcut>
mrnv: that's all I wanted -- a function to convert between char list and strings...
<stepcut>
i finished writing it too :)
<mrvn>
let explode s = let len = String.length s in let rec loop accu = function 0 -> s.[0]::accu | n -> loop (s.[n]::accu) (n-1) in loop (len-1)
TachYon has joined #ocaml
mellum has quit [Read error: 110 (Connection timed out)]
<stepcut>
does it take alot more time/mem to do: list @ [new_elemnt] than new_element::list ?
<stepcut>
ie. append a single element to the end of a list instead of the beginning?
<mrvn>
exponetially
<mrvn>
list @ elem creates a completly new list doubling the memory requirement.
<mrvn>
(each time its done)
mellum has joined #ocaml
<stepcut>
is it better to generate the list backwards, and then call reverse at the end then?
<mrvn>
Way better for anything longer than say 10 elements