ChanServ 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
malc has joined #ocaml
jao has joined #ocaml
Miwong has joined #ocaml
<Miwong> hello
Miwong has left #ocaml []
<whee> geh my lexing/parsing isn't doing too well
<whee> parse errors for some reason :\
karryall has quit ["bye"]
MegaWatS has quit ["Oceania has ALWAYS been at war with Eastasia!"]
malc has quit [Read error: 110 (Connection timed out)]
Yurik has joined #ocaml
jao has quit ["ERC v2.93 $Revision: 1.305 $ (IRC client for Emacs)"]
Yurik has quit [Read error: 110 (Connection timed out)]
Yurik has joined #ocaml
Yurik has quit [Remote closed the connection]
mrvn_ has joined #ocaml
mrvn has quit [Read error: 54 (Connection reset by peer)]
mrvn has joined #ocaml
mrvn_ has quit [Read error: 110 (Connection timed out)]
samx has joined #ocaml
samx has quit [Remote closed the connection]
mattam has joined #ocaml
gl has quit [Read error: 104 (Connection reset by peer)]
gl has joined #ocaml
gl has quit [Read error: 54 (Connection reset by peer)]
gl has joined #ocaml
zack has joined #ocaml
lam_ has joined #ocaml
systems has joined #ocaml
systems has quit ["Client Exiting"]
karryall has joined #ocaml
systems has joined #ocaml
<systems> sup
systems has quit ["Client Exiting"]
zack is now known as zack|gname
zack|gname is now known as zack|gnam
lka has joined #ocaml
<lka> Hello, could anyone give a bit of help about OCaml's type definitions?
TachYon25 has joined #ocaml
<lka> Hello TachYon, could you give me a bit of help about OCaml's type definitions?
<karryall> lka: yes ?
<lka> I need two types and it would come handy to name one member in each as 'x1'. Is it possible?
<karryall> you're speaking of records ?
<lka> yes
<karryall> well, no it's not possible
<lka> oh ... that's a pity
<karryall> only if you put them in different modules
<lka> Does it degrade performance, like inhibit inlining?
<lka> ie. to put them in different modules
JohnAAA has joined #ocaml
JohnAAA has left #ocaml []
<karryall> well you can put just the type definition in the module
<karryall> so there would be no penalty
<karryall> you could have a look at this too : http://www.eleves.ens.fr/home/frisch/soft.html#patch_record
<lka> Ok, thanks ... Let me have another question, could you give me a brief example on how to use Array.iter? I tried to use it similarly as Array.map but it did not compile.
<karryall> well, it's like List.iter
<karryall> but with an array :)
<karryall> let a = [| 1; 2; |] in Array.iter print_int a ;;
<lka> Could I use a function and iterate it over the array in order to modify the array elements?
<lka> In place, that is
<karryall> well, you could but that's ugly
<lka> not 'functional style'? :)
<mrvn> lka: Array.iteri for example.
<lka> I know, but I will have to work with big arrays
<karryall> let a = [|1; 2|] in Array.iteri (fun i v -> a.(i) <- succ v) a;;
<karryall> yes, iteri
<karryall> if you want to update in place, it's probably better to use a for loop
<karryall> there's no iter in Bigarray anyways
<mrvn> Thats what iteri probably does.
<lka> Ok, thanks ... really the last one: there is a -inline option for the ocamlopt compiler, what does the number following it mean?
<karryall> it means how hard the compiler should try to inline functions
<karryall> -inline 0 should turn off inlining I think
<lka> SO it has nothing to do with the size of the to be inlined function whatsoever
<lka> Thanks karryall and mrvn for all the help
<lka> This is a friendly group
<lka> Have a nice day
ayrnieu has joined #ocaml
lka has quit []
zack|gnam is now known as zack
mattam has quit ["leaving"]
TachYon25 has quit ["bez ki³y nie ma zaliczenia (z prawd studentek AM)"]
Hellfried has joined #ocaml
Dybbuk has quit [Read error: 110 (Connection timed out)]
Hellfried has quit ["leaving"]
steeldonkey has joined #ocaml
karryall has quit []
steeldonkey has quit [Read error: 104 (Connection reset by peer)]
taw has joined #ocaml
graydon has joined #ocaml
Dalroth has joined #ocaml
zack has left #ocaml []
Dybbuk has joined #ocaml
MegaWatS has joined #ocaml
gl has quit [Read error: 104 (Connection reset by peer)]
gl has joined #ocaml
ayrnieu` has joined #ocaml
ayrnieu has quit [Read error: 110 (Connection timed out)]
gl has quit [Read error: 104 (Connection reset by peer)]
gl has joined #ocaml
Overflow has joined #ocaml
steele has joined #ocaml
ayrnieu` has quit [Read error: 110 (Connection timed out)]
two-face has joined #ocaml
<two-face> hi
<taw> hi
<two-face> how doing?
* taw just made ocaml homework
<taw> s/made/did/ even
<two-face> homework ?
<taw> yup
<taw> we have ocaml course on uni
<two-face> ha good
<taw> and really evil tasks are invented
<two-face> some people are sane somewhere on this planet
graydon_ has joined #ocaml
malc has joined #ocaml
graydon__ has joined #ocaml
<MegaWatS> evil tasks? like what? :)
<taw> like computing every-nth-in-the-circle-dies (aka joseph flavius's) permutation using cyclic lists
graydon has quit [Read error: 113 (No route to host)]
graydon__ is now known as graydon
graydon_ has quit [Read error: 113 (No route to host)]
<MegaWatS> ?
<MegaWatS> what permutations?
<taw> MegaWatS: look at that code
<taw> "1 2 3 4 5 6 7" stand in circle, we want to kill every 3rd
<taw> 3 dies, 6 dies
<taw> now we have "1 2 4 5 7"
<taw> 2 dies
<taw> 7 dies
<taw> we have "1 4 5" now
<taw> etc.
<MegaWatS> hmm I'm still not quite sure what these are supposed to be
<MegaWatS> and I'm not that good at deciphering your uncommented code :)
<MegaWatS> I think it might be better if you simpl told me the definition ?
<taw> N people stand in circle
<taw> we go around killing every Mth person
<taw> as long as nobody lives
<taw> ;)
<taw> s/lives/is alive/
<taw> too late ;)
<MegaWatS> ? as long as nobody is alive?
<taw> yes
<MegaWatS> thatdoesn`t make any sense :|
<taw> oh
<MegaWatS> when nobody is alive, how can you kill them??
<taw> it's very late now ;)
<mrvn> You know what a queue is?
<taw> as long as somobody is alive ;)
<taw> we stop whene everyone dies
<taw> mrvn: this is not a queue, this is circular list
<mrvn> taw: Make a queue with 1,2,3,4,5,6,7 in it.
<MegaWatS> well then you simply kill everybody?
<MegaWatS> or is it about the order in which you do?
<taw> MegaWatS: yes
<taw> the point is the order
<taw> the original purpose was to find where to stand to die last ;)
<MegaWatS> ic
<mrvn> let loop queue = if queue.empty then () else begin queue.push queue.pop; queue.push queue.pop; ignore queue.pop; loop queue end
<mrvn> let rec even
<taw> hmm
<taw> evil ;)
<mrvn> taw: Better memorise the positions for all small primes. :)
<taw> ?
<taw> hehe
<taw> right :)
<taw> why only small primes ?
<taw> not all odd numbers ?
<mrvn> primes are much more mystical
<taw> oh ;)
two-face has quit ["Client Exiting"]
Overflow has quit ["—I-n-v-i-s-i-o-n— 2.0 Build 2104"]
zack has joined #ocaml
malc has quit [Read error: 110 (Connection timed out)]
skylan has quit ["bah."]
mattam has joined #ocaml
skylan has joined #ocaml
<whee> hurf
<whee> time to try working with lex and yacc again
<whee> gl managed to explain it all to me but I'm an idiot and having problems getting a proper lexer :\
<whee> or maybe it's the parser
Dalroth has quit []
<whee> I don't know anymore. heh
<taw> mmm
<taw> you want to know what ?
<whee> eh?
<taw> mmm
<taw> are you having some problems ?
<taw> with yacc/lex/etc. ?
<whee> yeah
<taw> oh :)
<whee> I think it's my parsernow that I look at it
<taw> with what exactly ?
<taw> what problems ? shirt/reduce conflicts ?
<whee> I'm getting parse errors no matter what I do
<taw> oh
<whee> it doesn't actually work on the input I'm trying to match
<taw> try putting intput w/o newline ;)
<taw> ok, that was silly, but i had that problem once ;)
<taw> echo "sample" | ./parser
<taw> didn't work
<taw> echo -n "sample" | ./parser
<taw> did
* taw goes to bed now
taw has left #ocaml []
<whee> noo
<whee> heh
zack is now known as il
il is now known as zack