<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)]