systems 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 | Caml Weekly news http://pauillac.inria.fr/~aschmitt/cwn/
mattam_ has quit [Read error: 113 (No route to host)]
jao has quit ["sleep"]
stef_ has joined #ocaml
emoo has quit [Remote closed the connection]
Kinners has joined #ocaml
lament has quit ["RUDOLPH'S RED NOSE IS NOT ALCOHOL-RELATED"]
docelic is now known as docelic|sleepo
stef__ has joined #ocaml
stef_ has quit [Read error: 110 (Connection timed out)]
lus|wazze has quit ["Das ist die antri-depri-quit-msg... der anti-depri-quit-msgen-blues!"]
polin8 has quit [Read error: 54 (Connection reset by peer)]
polin8 has joined #ocaml
stef__ has quit [Read error: 60 (Operation timed out)]
__DL__ has quit [Remote closed the connection]
HighVoltage has joined #ocaml
<HighVoltage> hi
<HighVoltage> can someone help me out?
<HighVoltage> i have a question about SML
HighVoltage has left #ocaml []
mattam has joined #ocaml
wax has quit [Remote closed the connection]
gene9 has joined #ocaml
systems has joined #ocaml
Kinners has left #ocaml []
systems has quit [Read error: 110 (Connection timed out)]
lus|wazze has joined #ocaml
systems has joined #ocaml
gene9 has quit [Read error: 110 (Connection timed out)]
gene9 has joined #ocaml
systems has quit [Read error: 110 (Connection timed out)]
gene9 has quit []
docelic|sleepo is now known as docelic
two-face has joined #ocaml
two-face has left #ocaml []
Vincenz has joined #ocaml
<Vincenz> Hello
<Vincenz> I'm working with ocamllex. And I was curious if it's possible to pass extra arguments to rules?
<Vincenz> (to allow for tailrecursion like:
<Vincenz> "/*" {comment 1 lexbuf}
<Vincenz> (for embeddable comments)
__DL__ has joined #ocaml
<Vincenz> ne1?
<Vincenz> can I pass extra arguments to rules?
pattern_ has quit [sterling.freenode.net irc.freenode.net]
pattern_ has joined #ocaml
pattern_ has quit [sterling.freenode.net irc.freenode.net]
pattern_ has joined #ocaml
pattern_ has quit [sterling.freenode.net irc.freenode.net]
pattern_ has joined #ocaml
pattern_ has quit [sterling.freenode.net irc.freenode.net]
pattern_ has joined #ocaml
pattern_ has quit [sterling.freenode.net irc.freenode.net]
async has joined #ocaml
pattern_ has joined #ocaml
pattern_ has quit [sterling.freenode.net irc.freenode.net]
pattern_ has joined #ocaml
pattern_ has quit [sterling.freenode.net irc.freenode.net]
pattern_ has joined #ocaml
asquii has joined #ocaml
pattern_ has quit [sterling.freenode.net irc.freenode.net]
asqui has quit [Connection timed out]
asquii is now known as asqui
pattern_ has joined #ocaml
<Vincenz> can I pass extra arguments to rules?
stefp has joined #ocaml
pattern_ has quit [sterling.freenode.net irc.freenode.net]
pattern_ has joined #ocaml
pattern_ has quit [sterling.freenode.net irc.freenode.net]
pattern_ has joined #ocaml
pattern_ has quit [Read error: 110 (Connection timed out)]
pattern_ has joined #ocaml
<async> i still don't understand.. what does 'let _ =' mean?
<lus|wazze> you bind a value to the symbol "_", which is basically like /dev/null in that the resulting value will be ignored
<async> so is that code automatically executed?
<lus|wazze> the expression is evaluated, yes
<lus|wazze> when you bind a name to a value, the corresponding expression will always be evaluated automatically
<lus|wazze> theres nothing special about the symbol _
<lus|wazze> in that regard
<pattern_> so "let _ = x" is the same as "x", right?
<lus|wazze> well theres a syntactic difference
<lus|wazze> with let _ = the compiler knows that a new top-level statement begins now
<lus|wazze> e.g.
<lus|wazze> let foo n = n print_string "hello world" is not the same as let foo n = n let _ = print_string "hello world"
<pattern_> hmm
lament has joined #ocaml
malc has joined #ocaml
systems has joined #ocaml
systems has quit ["Client Exiting"]
lament has quit ["Celebrate Discoflux!"]
Smerdyakov has quit ["bumbling about"]
jao has joined #ocaml
malc has quit [Read error: 110 (Connection timed out)]
systems has joined #ocaml
systems has quit [Read error: 60 (Operation timed out)]
^AndyA^ has joined #ocaml
baader has joined #ocaml
TachYon has joined #ocaml
<Vincenz> can I pass extra arguments to rules?
<lus|wazze> ?
<Vincenz> camllex
<lus|wazze> oh
<lus|wazze> hm
<lus|wazze> no idea
<Vincenz> rule mytoken a = parse
<lus|wazze> though Im not sure why you'd want to
<Vincenz> to get commentdepth
<lus|wazze> ?
<Vincenz> ./*
<Vincenz> /*
<lus|wazze> you mean nested comments?
<Vincenz> yes
<lus|wazze> you can do those simply with recursion
<Vincenz> hmm
<lus|wazze> theres even an example in the ocaml documentation
<Vincenz> oh, just match _
<lus|wazze> waitasec
<Vincenz> ok
<lus|wazze> btw you don't happen to know how I could prove that two fields of order p^2 (where p is a prime) are isomorphic? ;)
<Vincenz> you mean modul op^2?
<Vincenz> you mean modulo p^2?
<lus|wazze> modulo p^2 does not a field make
<Vincenz> aren't all fields modulo some number isomorphic?
<lus|wazze> yes, but only |Z modulo p|Z where p is a prime gives you a field
<Vincenz> what's |Z
<Vincenz> ?
<lus|wazze> whole numbers
<Vincenz> ah
<lus|wazze> i.e.
<Vincenz> yeah
<lus|wazze> {0,1,...,4} is a field
<Vincenz> modulo 5
<Vincenz> yes :)
<lus|wazze> {0,1,...,10} is a field with p=11 elements
<Vincenz> I know
<lus|wazze> correct
<lus|wazze> and so on
<lus|wazze> but
<lus|wazze> {0,1,...,3} is NOT a field
<lus|wazze> modulo 4
<Vincenz> yes, fields have inverse operations
<Vincenz> indeed
<Vincenz> 2 does not have an inverse
<Vincenz> I've had crypto :)
<lus|wazze> but there ARE fields with 4 = 2^2 elements
<Vincenz> hmm
<lus|wazze> they are just a little bit more difficult to construct
<Vincenz> even numbers?
<Vincenz> modulo 9
<lus|wazze> no a field needs a 1 :)
<Vincenz> oh yeah, duh
<lus|wazze> and I have to prove that for any given prime number p, any two fields of order p^2 are isomorphic
<Vincenz> heh
<Vincenz> oh wait
<Vincenz> p^2
<lus|wazze> well an example for a field of order 9 would be
<Vincenz> duh!!!!!
<Vincenz> just get (x,x)
<lus|wazze> the matrices of the form (( a , b ) , ( 2b, a ))
<Vincenz> (0,0) (0,1) (0,2) (1,0) (1,1) (1,2) (2,0) (2,1) (2,2)
<lus|wazze> over the field with 3 elements
<lus|wazze> hm I'm not sure how you would define multiplication for that
TachYon has quit [Remote closed the connection]
<Vincenz> per-element
<lus|wazze> but basically yes, that could be a method
<lus|wazze> no per-element doesn't work
<Vincenz> why not?
<Vincenz> it's an operatio
<Vincenz> operation
<lus|wazze> in a field you can't have a*b=0 when a and b are both not 0
<lus|wazze> (0,1)*(1,0) = (0,0)
<Vincenz> hmm, oh yeah
<lus|wazze> but neither (0,1) nor (1,0) are zero
<lus|wazze> anyway, I already gave an example above
<Vincenz> I haven't touched heavy field mathematics, just the definition in 2nd year college, and a refresh of primefields in my crypto course
<lus|wazze> simply take those 2x2 matrixes with entries from the field with 3 elements
<Vincenz> but basically
<Vincenz> any two fields of the same amount of elements are isomorphic
<lus|wazze> of the above-mentioned form
<Vincenz> yup yup
<lus|wazze> thats not true either , only for finite fields :)
<Vincenz> well, you're working with a prime
<Vincenz> so your field is finit
<Vincenz> e
<lus|wazze> for example,. |Q (the rational numbers) and |Q(sqrt(2)) (the rational numbers including all powers and products of powers of the square root of 2)
<lus|wazze> are equally large, but not isomorphic
<lus|wazze> yes
<lus|wazze> but what I want to do is prove this special case of that theorem
<lus|wazze> that any two finite fields of same order are isomorphic
<Vincenz> hmm
<lus|wazze> only just for fields of order p^2
<Vincenz> I'm afraid I have not had enough mathematics for that
<Vincenz> I studied EE, not math
<lus|wazze> I already DO know that fields of order p are isomorphic, and that a field of order p^n is a vector space of dimension n over that field
<lus|wazze> :)
<lus|wazze> well I do ;)
<Vincenz> you study math?
<Vincenz> pure math?
<Vincenz> neat
<lus|wazze> yup^^
<lus|wazze> anyway we got a little carried away
<Vincenz> yup
<lus|wazze> I was looking for yoru example
<Vincenz> lol
<lus|wazze> I just thought asking couldn't hurt ;)
<lus|wazze> ah there it is
<lus|wazze> entrypoint lexbuf
<lus|wazze> (Where entrypoint is the name of another entry point in the same lexer definition.) Recursively call the lexer on the given entry point. Useful for lexing nested comments, for example.
<lus|wazze> i.e. you can define several rules, and again call a lexer on the current state
<lus|wazze> for example you could do it something like
<lus|wazze> rule foobar = COMMENT-OPENER -> { baz state } | ... and baz COMMENT-OPENER -> { baz state } | COMMENT-CLOSER -> { done } | ANYTHING ELSE -> { ignore it }
<Vincenz> no I know
<Vincenz> I call the comment closer function
<Vincenz> if that one finds an open comment
<Vincenz> I call it again before letting it get out
<Vincenz> :)
<lus|wazze> exactly :)
<lus|wazze> simple recursion^^
<Vincenz> yup
<lus|wazze> damn now I have to get back to my algebra homework
* Vincenz pats lus|wazze on the back
<lus|wazze> and Ive already done all the other problems
<lus|wazze> but this one seems exceedingly difficult to me
<Vincenz> what was another problem?
* Vincenz wants to have a go
<lus|wazze> what I posted above as an example - constructing explicit, finite fields of orders p^2 and p^p
<Vincenz> ah
<Vincenz> p^p
<Vincenz> ?
<lus|wazze> p to the p'th power
<Vincenz> is that a special case?
<Vincenz> what makes p^p more special than....p^143
<Vincenz> taht's just a pth dimension vector that you make a pth dimension matrix of (or a p*p matrix?)
<lus|wazze> you can construct such fields relatively easily if you know that X^p = X in the field with p elements
<Vincenz> ah true
<lus|wazze> well, the way you do that is you prove that the polynomial X^p - X + 1 is irreducible in the field |F_p , that is, the field {0,1,..,p-10
<lus|wazze> well, the way you do that is you prove that the polynomial X^p - X + 1 is irreducible in the field |F_p , that is, the field {0,1,..,p-1}
<lus|wazze> when you knw that, and also know that an irreducible polynomial produces a maximal ideal in that ring, and that a commutative ring modulo a maximal ideal produces a field, you have what you were looking for
<Vincenz> ugh, I wish you used dutch terms
<Vincenz> I might be able to follow more
<lus|wazze> I don't know dutch unfortunately :)
<lus|wazze> hm and the german terms are almost in all cases the same as the english ones
<lus|wazze> except field = körper they are pretty much alike
<lus|wazze> irreducible polynomial = irreduizibles polynom
<lus|wazze> &so on
<Vincenz> I know that
<Vincenz> I know all of them
<Vincenz> except for ideal
<lus|wazze> hm
<Vincenz> maximal ideal
<Vincenz> hmm
<lus|wazze> an ideal in ring-theory is pretty similar to a normal subgroup in group theory if that helps
<Vincenz> ah
<Vincenz> you speaking of ring because each element gets generated from a single element a that is a prime w.r.t p?
smklsmkl has quit [Read error: 110 (Connection timed out)]
<lus|wazze> ring is the name of a certain algebraic structure
<lus|wazze> the set of whole numbers is a ring, for example
<Vincenz> so ring <> group because?
<lus|wazze> a ring is a special case of an abelian group
<Vincenz> ugh
<Vincenz> I should buy a book on math
<Vincenz> brush up
<lus|wazze> ah dont worry
<Vincenz> problem is I saw most of this stuff like a year ago
<Vincenz> you finish college
<Vincenz> you forget it all
<lus|wazze> those are already pretty specific areas
<Vincenz> we had most of it
<lus|wazze> these things dont have much use outside of, say, number theory :)
<Vincenz> for algebra and crypo
<Vincenz> crypto
<lus|wazze> group theory is the most important part of algebra for CS type people
<Vincenz> generative polynomials
<Vincenz> fields
<lus|wazze> you don't really need much field and basically next to no ring theory
<Vincenz> groups
<Vincenz> rings
<lus|wazze> hm
<Vincenz> I did, ee, not cs
* Vincenz slaps lus|wazze around with a recursive trout
<Vincenz> feel that tail
<lus|wazze> well the ring of polynomials is a, now THE really important kind of rings
<lus|wazze> apart from that
<lus|wazze> lol :)
<lus|wazze> polynomials over a field or another commutative ring is really the only really important special case of a ring apart from fields
<lus|wazze> well that, and rings of matrixes
<lus|wazze> bt what would that leave to us math-types if all of the EE and CS people already knew everything about rings and fields and groups ;)
<Vincenz> hehe
<Vincenz> true
<Vincenz> now all you need to do is find a loop in the primitive world
<Vincenz> like, factoring
<Vincenz> find some math trick that will solve it
<Vincenz> and goodbye crypto
<Vincenz> or find the log of a number in a primitive field
<lus|wazze> eek a tick :(
<lus|wazze> i didnt even notice what that was tzhat i was just scratching off D:
<lus|wazze> until i held it in my fingers and looked at it :0
<Vincenz> ugh
<Vincenz> disgusting
<Vincenz> finally someone who talks on ocaml
<Vincenz> usually it's quieter than a tomb here
<Vincenz> that's why I hang out on haskell, although I am trying to learn ocaml
<lus|wazze> =)
<lus|wazze> i dont really like haskell
<Vincenz> too pure to be pragmatic
<lus|wazze> it has a kinda-sorta fanatical "we will allow NO side-effects in our language, even for expressing side-effects!!!!" feel to it imho
<Vincenz> hehe
<Vincenz> monads
<Vincenz> no clue what they are, just their name
<lus|wazze> exactly
<lus|wazze> hm
<lus|wazze> maybe i should pick that tick out of the garbage again, see if its still alive and if so, torture it a bit ... that should learn em nasty little critters >8[
<Vincenz> plus the fact that you don't have sideeffects means you have to pass the entire environment along in each function
<Vincenz> wow
<Vincenz> nasty smiley
<Vincenz> I'd go for a lighter
<Vincenz> pin him on a very fine pin
<Vincenz> and fry him
<Vincenz> SLOWLY
<lus|wazze> sadly i think it didnt survive my scratching action
<Vincenz> damn
<lus|wazze> luckily i got vaccinated just about a week ago now
<Vincenz> where do you livE?
<lus|wazze> so I think I'm safe
<lus|wazze> southern germany
<Vincenz> ah
<lus|wazze> swabia , near the french border
<Vincenz> not so far
<Vincenz> I thought us or something
<lus|wazze> nah
<Vincenz> cause you speak quite fluently in english
<lus|wazze> actually Im not really satisfied with my level of mastery of the english language
<lus|wazze> i want to try to become as close to a native speaker as i can
<lus|wazze> sadly its pretty hard to really get further with that, especially living in a non-english speaking environment
<lus|wazze> my father is originally from the us
<lus|wazze> so i consider it something of a pity that i only know english like a second language, not on the level of a native-speaker like i think i should
<Vincenz> on the other hand you know other languages cause you live in europe
<lus|wazze> the only languages i currently know to any reasonable level are german and english
<lus|wazze> i mean i took some french in school but i dont have anything to show for it
<lus|wazze> what it mainly taught me is that while french people write like this: "je ne sais pas" and would like their language to be represented as sounding something like this: "jay nay say pah" they really speak something like this: "janspa"
<lus|wazze> (no offense to any french people here, this only supposed to show my level of ignorance about the language after learning it in school for about ... oh ... 5 years)
<lus|wazze> :|
<Vincenz> hmm
<lus|wazze> hm?
<stefp> lus|wazze: je ne sais pas de quoi tu parles :)
<lus|wazze> :p
<stefp> you are right about the real pronounciation
<stefp> real languages are very different from what your leanr in school.
<stefp> and IRC can be even weirder.
<lus|wazze> well it seemed to me that especially the way french was taught in school was really pretty far off from what the language really is like
<stefp> but usually in programmatic channels, people try to talks correctly
<lus|wazze> but I don't really know much anymore either way
<stefp> BTW if you are interested in Perl. We organize YAPC::EU 2003 in Paris. http://yapc.mongueurs.net
<lus|wazze> hm i dont really like perl i have to admit
<stefp> I wanted to invite the OCAML guy to talk about their VM, to compare with the Parrot VM. but there was no interest
<stefp> I though perler more curious
<stefp> I am interested in OCAML because I don't know much about type inference
<lus|wazze> ?
<lus|wazze> yeah type inference is interesting
<stefp> s/perler/programmer who do perl/
<lus|wazze> ic
<lus|wazze> but type inferencing is something quite neat i think
<lus|wazze> but its really not that difficult
<stefp> I am a total beginner though. even if the mathematical concepts are not new to me.
<stefp> I read a little about category theory
<lus|wazze> once you get how the algorithm works, its really strikingly simple and elegant
<lus|wazze> heh i don't know any category theory to be honest :)
<lus|wazze> but I've once seen a very terse SML implementation of a unification function
<stefp> SML?
<lus|wazze> before that i never understood the algorithm
<lus|wazze> but that function was just so ... i dont know ... clear it all was clear to me right away
<lus|wazze> sml is another dialect of ml
<lus|wazze> the family of languages, of which ocaml is án example
<stefp> I have bought "modern compiler implementation in ML"
<stefp> so I will have to get familiar with that too.
<lus|wazze> =)
<stefp> I bought "types an proramming language too".
<stefp> A lot to read....
<stefp> I use http://caml.inria.fr/oreilly-book/html to get up to speed with ocaml
<lus|wazze> ok three books thats really a LOT to read ;:)
baader has left #ocaml []
foxster has joined #ocaml
Vincenz has quit []
polin8 has quit [Read error: 104 (Connection reset by peer)]
lus|wazze has quit ["Das ist die antri-depri-quit-msg... der anti-depri-quit-msgen-blues!"]
Begbie has joined #ocaml
Smerdyakov has joined #ocaml
__DL__ has quit [Remote closed the connection]
stefp has quit [Read error: 60 (Operation timed out)]
stefp has joined #ocaml