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
<systems> this is not really easy to grasp for the more complex objects
<mrvn> Its a way of thinking
<systems> for chars and numbers, sure, but for records and such ... it's kind weird at first
TachYon has joined #ocaml
<mellum> It has many advantages, though. Easier to prove stuff, easier to find errors usually, more efficient garbage collection,...
<systems> :)
<mellum> Well, I'm going to bed now... bye
<mrvn> n8
<systems> sweet dreams
<systems> but your buffer mrvn they should be mutable right!!
<mrvn> Since I have two seperate functions that add and sub to/from it it needs to be.
<mrvn> hmm, 77 lines of code for my buffer. Lets see if it works.
<systems> :))
<mrvn> Works.
<systems> congratulations
<mrvn> at least for very small data
<mrvn> damn, doesn't work for big data
<systems> >:(
skylan has quit ["O_O"]
systems has left #ocaml []
skylan has joined #ocaml
<mrvn> I hate "off by one" errors
<mrvn> n8
TachYon has quit [Remote closed the connection]
franzz has joined #ocaml
<franzz> heya anyone home?
<Riastradh> I am.
<franzz> i think i figured out my problem (compiling ocaml)
<franzz> dang...does ocamllex typically come with ocaml?
mrvn_ has joined #ocaml
mrvn has quit [Read error: 60 (Operation timed out)]
Riastradh has quit [Read error: 54 (Connection reset by peer)]
Riastradh has joined #ocaml
mattam has joined #ocaml
<pattern_> i am still wrestling with trying to understand how a y combinator works
<pattern_> line 24 calls "fact_print 5"
<pattern_> which calls "y ( printer_wrapper fact_ ) 5"
<pattern_> which calls "( printer_wrapper fact_ ) ( printer_wrapper fact_ ) 5" ?
<pattern_> i'm trying to follow how the functions are called here, and which arguments are applied to which functions, but this is so convoluted
<pattern_> can anyone who understands this give me a hand? i'm having a really hard time
dash has joined #ocaml
Kinners has joined #ocaml
K_singing is now known as Krystof
TachYon76 has joined #ocaml
TachYon76 has quit [Remote closed the connection]
pattern_ has quit ["..."]
pattern_ has joined #ocaml
Kinners has left #ocaml []
systems has joined #ocaml
<systems> bonjour
<mrvn_> moin
mrvn_ is now known as mrvn
systems has quit [Read error: 60 (Operation timed out)]
systems has joined #ocaml
taw has joined #ocaml
<taw> i have 3 chars
<taw> how can i make string from them ?
<taw> no string_of_char in ocaml
<taw> i want to do something like 'a' ^ 'b' ^ 'c'
<taw> any ideas ?
<systems> i think their is an sprintf
<systems> you can print your chars in a string ?
<taw> print ?
<taw> how sprintf works in ocaml ?
<taw> it's such a huge hole in type system after all
<systems> wait , i'll check i am also still newbie
<taw> best would be a (char list -> string) function
<systems> The sprintf function has the same format specification as printf, but
<systems> it prints the output to a string and returns the result.
<taw> hehe
<systems> i took this from the book i am reading
<taw> i know c ;)
<taw> you don't have to explain that to me ;)
<systems> mmm :)
<taw> does ocaml even have printf ?
<baader> String.create ?
* baader is newbie aswell
TachYon26 has joined #ocaml
<taw> (String.make 1 a) ^ (String.make 1 b) ^ (String.make 1 c)
<taw> is what i'm doing now
<taw> but that's so horribly ugly
<baader> ah hm
<baader> yes
<taw> some string_of_char_list [a;b;c]
<taw> would be best
<smkl> Printf.sprintf "%c%c%c" a b c ...
<taw> hmm
<systems> let a = Printf.sprintf "%c%c%c" 'a' 'b' 'c' ;;
<systems> works form me
<systems> oops smkl , sorry
<systems> strings are mutable right?
<smkl> let implode lst = let str = String.create (List.length lst) in let rec lst2str str i = function (l::ls) -> str.[i] <- l; lst2str str (i+1) ls | [] -> str in lst2str str 0 lst
* taw is scared already :)
<baader> :>
<taw> btw. do any of you happen to know formula for normal of place specified by 3 points ?
Kinners has joined #ocaml
mellum has quit [Read error: 110 (Connection timed out)]
<smkl> do you mean cross product?
mellum has joined #ocaml
<taw> hmm, yes :)
<taw> i always wondered what this cross product thing is good for hehe
TachYon26 has quit [Read error: 60 (Operation timed out)]
<systems> what is that?
systems has quit ["Client Exiting"]
taw has quit ["Client Exiting"]
<mrvn> The cross product (in 3d) gives you a vector thats perpendicular to the two other vectors.
<mrvn> x = y1*z2 - z1*y2; y = z1*x2 - x1*z2; z = x1*y2 - y1*x2;
<mrvn> or the negative of that depending on a right handed or left handed system. (all iirc)
<mrvn> smkl: still there?
Kinners has quit [Read error: 110 (Connection timed out)]
Yurik has joined #ocaml
<Yurik> re
Yurik_ has joined #ocaml
Yurik has quit [Read error: 104 (Connection reset by peer)]
<smkl> mrvn: yes
smkl has quit [Remote closed the connection]
smkl has joined #ocaml
<baader> ocaml is irritating, i wonder if its worth the effort learning it when writing for example an irc client requires mainly imperative features anyway
<baader> or perhaps i'm just havin trouble to think the 'functional way'
karryall has joined #ocaml
<mrvn> smkl: Do you know of a Module that is a mix of queue and buffer? I need to buffer input while I pass it through my program.
<mrvn> So I need to add strings at the end and chop of strings at the start efficiently.
<mrvn> baader: Where does an irc client need imperative features?
<mrvn> baader: The best thing with ocaml is that unless you explicity try to you can't get segfaults.
<baader> hmm
<mrvn> baader: Your irc client would _never_ crash.
<baader> nm i'm still very very new to it, and currently i don't quite get the hang of it
<mrvn> Your main problem is probably non-blocking IO and sockets, right?
<baader> no its the language :>
<mrvn> well, after that
<baader> syntax is so non-C-ish, doesn't resemble anything i've done before
<vegai> fortunately, C-style syntax is not the prettiest ;-/
<baader> i agree :>
<Smerdyakov> Non-C-ish syntax is one of the surest signs that serious thought has gone into a language, and so you should expect quality!
<mrvn> With C you allways have buffer overlows and such to worry about.
<vegai> though not because of syntax
<mrvn> Smerdyakov: like Pascal?
<mrvn> If I have an in_channel and out_channel with the same Unix.file_descr and I do a Unix.select of their FDs. Is there any way to see which of the two got an error or is that meaningless?
<Smerdyakov> Yes
<Smerdyakov> Pascal was a great advancement
<mrvn> WAS a nice teaching language. Nice clean strict structure.
<mrvn> Noone any idea on the select?
baader has quit ["I'll be back"]
karryall has quit ["bye"]
<smkl> perhaps it's possible to dup the channel
<mrvn> Possible but that could double the number of FDs which hurts select.
<mrvn> Time for the epoll system call.
<mrvn> I wonder why there is no poll call in ocaml.
Smerdyakov has quit [brunner.freenode.net irc.freenode.net]
Smerdyakov has joined #ocaml
<mrvn> Anyone know if there is a parser generator that produces continuation passing style code?
systems has joined #ocaml
systems has quit [Read error: 60 (Operation timed out)]
TachYon has joined #ocaml
TachYon has quit [Remote closed the connection]
mattam_ has joined #ocaml
mattam has quit [Read error: 110 (Connection timed out)]
zack_ has joined #ocaml
polin8 has quit ["Lost terminal"]
<mrvn> Didn't ocaml have a curses module?
<mellum> let curse = print_string "goddamit\n";;
<mrvn> Well, thats a bit disapointing. It should have different curses depending on the gender, daytime, moon phase, ....
<mellum> as in "You evening full moon bitch!"?
liyang has quit ["leaving"]
liyang has joined #ocaml
TachYon has joined #ocaml
zack_ has quit ["Client Exiting"]
Kinners has joined #ocaml
skylan has quit [Read error: 104 (Connection reset by peer)]
skylan has joined #ocaml