dylan changed the topic of #ocaml to: OCaml 3.09.1 available! Archive of Caml Weekly News: http://sardes.inrialpes.fr/~aschmitt/cwn/ | A free book: http://cristal.inria.fr/~remy/cours/appsem/ | Mailing List: http://caml.inria.fr/bin/wilma/caml-list/ | Cookbook: http://pleac.sourceforge.net/
Bigbang is now known as Bigb[a]ng
Revision17 has joined #ocaml
demitar_ is now known as Demitar
clog has joined #ocaml
pango has quit [Read error: 110 (Connection timed out)]
kig has joined #ocaml
CosmicRay has joined #ocaml
mikeX has quit [""zz""]
mrsolo has quit [Read error: 104 (Connection reset by peer)]
CosmicRay has quit ["Client exiting"]
Smerdyakov has quit ["Leaving"]
Smerdyakov has joined #ocaml
Smerdyakov has quit ["reboot"]
Smerdyakov has joined #ocaml
Demitar has quit [Read error: 110 (Connection timed out)]
Demitar has joined #ocaml
Smerdy has joined #ocaml
Smerdy has quit [Client Quit]
cookoo has joined #ocaml
jer has quit ["Reconnecting"]
jer has joined #ocaml
khaladan has joined #ocaml
bohanlon has joined #ocaml
perspectivet has quit [Read error: 110 (Connection timed out)]
chimikal_ has joined #ocaml
chimikal has quit [Read error: 110 (Connection timed out)]
pango_ has quit [Remote closed the connection]
pango has joined #ocaml
m3ga has joined #ocaml
vodka-goo has joined #ocaml
m3ga has quit ["disappearing into the sunset"]
bluestorm has joined #ocaml
Revision17 has quit [Read error: 110 (Connection timed out)]
dylan has quit [Read error: 110 (Connection timed out)]
dylan has joined #ocaml
<bluestorm> hum
<bluestorm> i have a little problem with the classes, objects and so on
<bluestorm> how may i declare classes "mutually recursive" ?
<fluxx> I think with 'and'
<bluestorm> hum
<fluxx> hmm, or maybe not :)
<bluestorm> yes
<fluxx> oh, it does work, so class foo ~(a:bar) = object end and bar ~(b:foo) = object end;;
<bluestorm> hum
<bluestorm> aaah
<bluestorm> i putted a second "class"
<bluestorm> thanks a lot :)
<fluxx> no problem.
Axioplase has joined #ocaml
<Axioplase> Hi!
<Axioplase> Is there any way to do some seeks and getc()/ungetc() on a file in caml ?
<fluxx> well, there is seek, but I don't think there's unget..
<Axioplase> actually, I have to write a lexer/parser in ocaml (not use ocamllex/ocamlyacc), and since I don't think that loading the whole file at once is a good idea, I was wondering whether I could read it char after char...
<fluxx> you could use the Stream-module
<fluxx> it provides 'peek'
<Axioplase> Ok. I'll look at this..
<fluxx> why would you want to seek in a parser?
<Axioplase> no, in the lexer.
<bluestorm> hum
<bluestorm> Axioplase, why don't you use the standard input fonction ?
<bluestorm> Stream is useful for parsing
<fluxx> as I hinted not long ago.. ;)
<bluestorm> yes
<bluestorm> so just input_char should be ok, i think
<Axioplase> didn't know it
<fluxx> axioplase, you could still use ocamllex but write your own parser
<fluxx> axioplase, or why are you avoiding them?
<Axioplase> fluxx: but I can't use ocamllex...
<Axioplase> I'm writing another ml langage from scratch with two pals for a school project, and it has to be able to bootstrap.
<Axioplase> And we won't have time to rewrite every single useful module. Plus my teacher said "Do It Yourself"...
<bluestorm> hum
<bluestorm> this is the ocaml function
<Axioplase> yeah, I got over this problem a couple of minutes ago..
<fluxx> oh.. in our compiler class we were allowed (encouraged) to use flex/bison
<Axioplase> Now, I'm trying/wondering how to write the lexer... I think it's gonna take some time without regexps....
<fluxx> there's a lot to do after the parsing :)
<Axioplase> fluxx: this no class. This is a team project. And we must rewrite everything.
<Axioplase> I'm not the one doing typing nor the runtime :)
<bluestorm> hum
<bluestorm> i don't really understand why is a lexer so difficult
<Axioplase> Because I didn't read doc about it maybe.
<bluestorm> hum
<Axioplase> Plyus I have never written an automaton yet.
<bluestorm> wait
<Axioplase> (well, I have in C and a few other langages, but it was just playing with pointers)
Tachyon76 has joined #ocaml
<bluestorm> you juste have to read a file
<bluestorm> and output something with every word and his type (value, keyword, op, function) ?
<bluestorm> (i may have a wrong idea of what a lexer is)
<Axioplase> Read a number, and the output NUMBER. read as many letters as possible, and the output is WORD. read many letters, a dot, many letters, return FLOAT.
<Axioplase> womething like that.
<Axioplase> and it must be easy to modify (not for me, I don't care. But for later's students who'll read the code and use it...)
<bluestorm> hum
<bluestorm> so
<Axioplase> Ideally, something à la lex.
<bluestorm> juste one char per char reading should be ok
<bluestorm> shouldn't it ?
<fluxx> axioplase, ocaml streams (those with [<>]-notation) might be suitable
<fluxx> maybe
<fluxx> but is that "not writing it yourself"?-)
<Axioplase> Streams might be okay, if my pal doing the runtime rewrites them.
<fluxx> for ocaml the approach of having a language describing language compiled into ocaml is a nice one
<bluestorm> fluxx, hum, you would use the stdin as a char stream ?
<fluxx> bluestorm, yes
<bluestorm> hum
<fluxx> it could convert a character stream into a token stream
<fluxx> ocaml streams don't have rollback, though, which is sad
<bluestorm> hum
<bluestorm> i think you could use recursive functions to have some rollback
<fluxx> whenever you successfully match something off a stream, the matched item is removed
<bluestorm> hum
<bluestorm> i know
<bluestorm> but you can keep his value, maybe by stacking it with a recursive function
<fluxx> yes, but it won't be anymore as convenient
<bluestorm> ok
<bluestorm> hum
<bluestorm> about Axioplase problem
<bluestorm> i think that doing some loop using input_char would be easier to have bootstraped than a stream
slipstream-- has quit [Read error: 104 (Connection reset by peer)]
slipstream has joined #ocaml
mikeX has joined #ocaml
mattam has quit [Read error: 104 (Connection reset by peer)]
Banana has quit [Read error: 104 (Connection reset by peer)]
Banana has joined #ocaml
mattam has joined #ocaml
bohanlon has quit ["Leaving"]
Tachyon76 has quit ["Leaving"]
gapz has joined #ocaml
gapz has left #ocaml []
khaladan has quit [Read error: 104 (Connection reset by peer)]
ski has quit [Read error: 110 (Connection timed out)]
gim has joined #ocaml
descender has joined #ocaml
pango has quit ["Leaving"]
pango has joined #ocaml
Revision17 has joined #ocaml
rillig has joined #ocaml
descender has quit ["XML is like violence, if it doesn't solve the problem, just use more."]
descender has joined #ocaml
Oatmeat|umn has quit [Remote closed the connection]
Oatmeat|umn has joined #ocaml
bluestorm has quit ["Leaving"]
khaladan has joined #ocaml
vodka-goo has quit ["zzz"]
mikeX has quit [Remote closed the connection]
mikeX has joined #ocaml
globi has joined #ocaml
<globi> hi
<globi> maybe you know how can i create recursive function without using word "rec"?
<mikeX> you can't
<mikeX> that's the point of rec
<mikeX> why would you want to do that anyway?
<globi> my teacher said that i need to write "rev" function without using "rec" and imperative constructions and library functions
<globi> and that it's possible :)
<mikeX> well that meant you should not use recursion
<mikeX> not find a way to skip the 'rec' keyword :P
<globi> but how can i write it without recursion nor imperative?
<mikeX> I have no idea :)
<globi> me too :)
<globi> or maybe just without using loops?
<kig> write an y-combinator ?
<globi> what's that?
<kig> construct that lets you make recursive lambdas
<globi> ok, now i'm googling ;]
gim has quit ["dodo"]
<Smerdyakov> globi, does your class cheating policy allow you to ask for help on IRC?
<globi> Smerdyakov: why?
<Smerdyakov> globi, because, if it doesn't, you shouldn't be asking here...?
<globi> Smerdyakov: sorry, i'm new to irc. Can't i just ask questions here?
<Smerdyakov> globi, the problem would be if you are breaking the rules that your teacher has set for the class; nothing to do with the rules of this channel.
<globi> :)
<Smerdyakov> So, does your class cheating policy allow you to ask for help on IRC?
<globi> now i understand :)
<globi> no
<Smerdyakov> OK, so you are intentionally breaking the rules by asking here?
<globi> because it's rather hard problem
<globi> yes i allow asking other for help
<globi> *it
<Smerdyakov> Do you have a link to the class web site?
<globi> no
<Smerdyakov> I really doubt that it allows asking arbitrary people for help; maybe collaborating with your classmates, not experts in an online forum like this.
<kig> i don't think it much matters where you learn the things from, as long as you learn them...
<globi> but they can't help me, because they are also begginers
<Smerdyakov> kig, no one learns programming by having someone else make all the hard design decisions for every assignment.
<globi> and i just want to know how to solve that
<Smerdyakov> globi, ask your teacher for help.
<globi> thanks for help anyway :)
<kig> Smerdyakov: fair enough
<JKnecht> smerdyahkov, wasn't that the father in bros. karamazov?
<Smerdyakov> JKnecht, close, but no.
<JKnecht> character in that though, yes?
<Smerdyakov> Yes.
<JKnecht> was he the fathers retainer?
<Smerdyakov> He was one of the brothers.
<JKnecht> the hot headed one?
<Smerdyakov> The illegitimate one
<JKnecht> got it.
globi has quit ["Leaving"]
mikeX_ has joined #ocaml
dark_light has joined #ocaml
mikeX has quit [Read error: 110 (Connection timed out)]
mrsolo__ has joined #ocaml