Yurik changed the topic of #ocaml to: http://icfpcontest.cse.ogi.edu/ -- OCaml wins | http://www.ocaml.org/ | http://caml.inria.fr/oreilly-book/ | http://icfp2002.cs.brown.edu/ | SWIG now supports OCaml| Early releases of OCamlBDB and OCamlGettext are available
Kinners has quit [Read error: 104 (Connection reset by peer)]
systems has quit ["Client Exiting"]
mattam_ has quit ["zZz"]
<mrvn> n8
TachYon has quit [Remote closed the connection]
stepcut has quit [Read error: 110 (Connection timed out)]
lament has joined #ocaml
lament has quit [Client Quit]
lament has joined #ocaml
<pattern_> why does this print out my list backwards?
<pattern_> oh, now i remember, association is unspecified with ::
<pattern_> and is actually done right to left :(
musasabi has quit [brunner.freenode.net irc.freenode.net]
musasabi has joined #ocaml
lament has quit ["Did you know that God's name is ERIS, and that He is a girl?"]
foxster has quit []
<pattern_> what does the underscore character mean here: fun _ n -> n + 1
<pattern_> does it mean ignore this argument?
<pattern_> so there are two arguments to this function and the first is ignored?
usander has joined #ocaml
xxd has joined #ocaml
mattam has joined #ocaml
xxd has quit ["EOF"]
<pattern_> what does the underscore character mean here: fun _ n -> n + 1
<pattern_> is it an ignored argument to that function?
xxd has joined #ocaml
TachYon has joined #ocaml
TachYon has quit [Remote closed the connection]
TachYon has joined #ocaml
Kinners has joined #ocaml
TachYon has quit [Remote closed the connection]
<smkl> pattern_: yes
Kinners has left #ocaml []
musasabi has quit [brunner.freenode.net irc.freenode.net]
mellum has quit [brunner.freenode.net irc.freenode.net]
smkl has quit [brunner.freenode.net irc.freenode.net]
emu has quit [brunner.freenode.net irc.freenode.net]
liyang has quit [brunner.freenode.net irc.freenode.net]
usander has quit [brunner.freenode.net irc.freenode.net]
gl has quit [brunner.freenode.net irc.freenode.net]
pattern_ has quit [brunner.freenode.net irc.freenode.net]
karryall has quit [brunner.freenode.net irc.freenode.net]
shea has quit [brunner.freenode.net irc.freenode.net]
td_ has quit [brunner.freenode.net irc.freenode.net]
Riastradh has quit [brunner.freenode.net irc.freenode.net]
xtrm has quit [brunner.freenode.net irc.freenode.net]
xxd has quit [brunner.freenode.net irc.freenode.net]
polin8_ has quit [brunner.freenode.net irc.freenode.net]
rox has quit [brunner.freenode.net irc.freenode.net]
whee has quit [brunner.freenode.net irc.freenode.net]
Krystof has quit [brunner.freenode.net irc.freenode.net]
lam has quit [brunner.freenode.net irc.freenode.net]
xxd has joined #ocaml
usander has joined #ocaml
musasabi has joined #ocaml
td_ has joined #ocaml
mellum has joined #ocaml
polin8_ has joined #ocaml
gl has joined #ocaml
rox has joined #ocaml
pattern_ has joined #ocaml
karryall has joined #ocaml
shea has joined #ocaml
smkl has joined #ocaml
Krystof has joined #ocaml
whee has joined #ocaml
emu has joined #ocaml
lam has joined #ocaml
Riastradh has joined #ocaml
liyang has joined #ocaml
xtrm has joined #ocaml
systems has joined #ocaml
systems has quit ["Client Exiting"]
<pattern_> thanks, smkl :)
mrvn has quit [Remote closed the connection]
mrvn has joined #ocaml
Smerdyakov has quit []
usander has quit ["using sirc version 2.211+KSIRC/1.2.1"]
mattam_ has joined #ocaml
mattam has quit [Read error: 104 (Connection reset by peer)]
Smerdyakov has joined #ocaml
<mrvn> Is there an isalnum, isalpha, isascii, isgraph equivalent in ocaml?
polin8_ has quit ["Now _that's_ a good cup of coffee."]
polin8 has joined #ocaml
TachYon has joined #ocaml
TachYon has quit [Read error: 104 (Connection reset by peer)]
TachYon has joined #ocaml
TachYon has quit [Remote closed the connection]
mattam_ has quit ["test Unreal II"]
<mrvn> Anyone used Threading before? How to I kill a program from within a thread?
systems has joined #ocaml
systems has quit [Client Quit]
taw has joined #ocaml
<mrvn> anyone awake?
stepcut has joined #ocaml
* taw ...
* taw thinking how to generate images in ocaml ...
<mrvn> used threads before?
<taw> in ocaml ? no
<taw> libcamlimages-ocaml-dev package in debian is archaic ...
systems has joined #ocaml
systems has quit ["Client Exiting"]
<mrvn> output with threads is realy fun:
<mrvn> wwrriitteerr lloooopp ppooss==8192081920 iinn__ppooss==8192081920
<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
skylan_ has joined #ocaml
<stepcut> you can write scripts in ocaml...
<stepcut> hold on
<taw> perl -ple 's/(.*)movb\s+\$//; s/\(%ebp\)//; s/(.*),(.*)/$2 $1/ ' <zzi | sort | awk '{print $2}'|ruby -ple '$_=(eval $_).chr' | perl -pe 's/\n//;s/\000/ /g'; echo
<taw> hehe
<taw> l33t stuff like that too ;) ?
<taw> i swear, that thing was actually useful ;)
<taw> some switchers like -p -n -l would be necessary
<taw> and regular expressions in syntax
td_ has left #ocaml []
<taw> and easier conversion string <-> int
<taw> and ...
<taw> ;)
<stepcut> echo 'let _ = print_endline "hello, world";;' | /usr/bin/ocaml
<stepcut> that's the best i can do
<taw> lot of things to make it more perl-like without losing ocamlness
<stepcut> there is also cash... but I have never used it
<taw> $ echo 'let _ = print_endline "hello, world";;' | /usr/bin/ocaml
<taw> Objective Caml version 3.06
<taw> # hello, world
<taw> - : unit = ()
<taw> #
<taw> yeah, that's real good ;)
<taw> can't even make hello world right
<stepcut> i didn't say it was good, just the best i could do
<stepcut> forget a !
<taw> we would need
<taw> 1. new preprocessor
<taw> 2. some program for it which would do -e -p -n -l etc.
<taw> 3. bigger library of common stuff
<taw> that's about it
<stepcut> echo 'let _ = print_endline "hello, world!";;' > /tmp/hello.ml && ocamlc /tmp/hello.ml -o /tmp/hello && /tmp/hello && rm /tmp/hello
<stepcut> :)
<taw> hmm
<stepcut> ??
<taw> can we do #!/usr/bin/ocaml scripts ?
<stepcut> almost
<stepcut> #!/usr/bin/ocamlrun /usr/bin/ocaml
<stepcut> hrm
<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> (setq interpreter-mode-alist (cons '("ocamlrun" . tuareg-mode) interpreter-mode-alist))
<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
pattern_ has quit ["..."]
pattern_ has joined #ocaml