__DL__ changed the topic of #ocaml to: OCaml 3.09.0 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/
KrispyKringle is now known as GorzoTheMighty
GorzoTheMighty is now known as KrispyKringle
__DL__ has quit [Remote closed the connection]
humasect has quit [Read error: 110 (Connection timed out)]
Bigbang is now known as Bigb[a]ng
humasect has joined #ocaml
zigong has quit [Remote closed the connection]
mkhl has quit []
tristram has quit [Remote closed the connection]
tristram has joined #ocaml
Skal has quit ["Client exiting"]
KrispyKringle is now known as KrispyKreme
humasect has quit [Read error: 110 (Connection timed out)]
smimou has quit ["bli"]
Skal has joined #ocaml
Skal has quit [Remote closed the connection]
malc_ has quit ["leaving"]
Raziel has quit ["Yo soy goma. Tú eres cola."]
Raziel has joined #ocaml
Raziel has quit [Client Quit]
Raziel has joined #ocaml
vodka-goo has quit ["Connection reset by by pear"]
rillig has quit ["exit(EXIT_SUCCESS)"]
HotNoodleOfInqui has joined #ocaml
quamaretto has quit ["bye"]
Revision17 has joined #ocaml
HotNoodleOfInqui has left #ocaml []
quamaretto has joined #ocaml
sebell has joined #ocaml
Snark has joined #ocaml
pango_ has joined #ocaml
sebell has left #ocaml []
pango has quit [Read error: 110 (Connection timed out)]
ramkrsna has quit [Remote closed the connection]
KrispyKreme is now known as KrispyKringle
Smerdyakov has quit ["Leaving"]
kryptt has joined #ocaml
Schmurtz has quit [Read error: 113 (No route to host)]
Schmurtz has joined #ocaml
Schmurtz has quit [Client Quit]
ramkrsna has joined #ocaml
ramkrsna has quit [Read error: 104 (Connection reset by peer)]
pango_ has quit [Remote closed the connection]
_fab has joined #ocaml
bluestorm has joined #ocaml
bluestorm has quit [Client Quit]
bluestorm has joined #ocaml
Submarine has joined #ocaml
pango has joined #ocaml
bluestorm has quit [Client Quit]
bluestorm has joined #ocaml
ramkrsna has joined #ocaml
ski has quit [Remote closed the connection]
ski has joined #ocaml
m3ga has joined #ocaml
ski has quit [Remote closed the connection]
ski has joined #ocaml
revision17_ has joined #ocaml
Skal has joined #ocaml
Revision17 has quit [Read error: 110 (Connection timed out)]
Schmurtz has joined #ocaml
Bigb[a]ng is now known as Bigbang
Amorphous has quit [Read error: 110 (Connection timed out)]
Schmurtz has quit [Read error: 113 (No route to host)]
Amorphous has joined #ocaml
bluestorm has quit ["Leaving"]
kenpex has joined #ocaml
bluestorm has joined #ocaml
Schmurtz has joined #ocaml
Submarine has quit [Remote closed the connection]
m3ga has quit [Read error: 104 (Connection reset by peer)]
malc_ has joined #ocaml
Raziel has quit [Remote closed the connection]
gim has joined #ocaml
bzzbzz has quit ["leaving"]
bluestorm has quit [Remote closed the connection]
kryptt has quit [Read error: 110 (Connection timed out)]
Skal has quit [niven.freenode.net irc.freenode.net]
pango has quit [niven.freenode.net irc.freenode.net]
noj has quit [niven.freenode.net irc.freenode.net]
pango has joined #ocaml
Skal has joined #ocaml
batdog has quit [Remote closed the connection]
batdog|gone has joined #ocaml
batdog|gone has quit [Remote closed the connection]
batdog|gone has joined #ocaml
batdog|gone has quit [Remote closed the connection]
batdog has joined #ocaml
quamaretto has quit [Nick collision from services.]
HotNoodleOfInqui has joined #ocaml
bluestorm has joined #ocaml
exa has joined #ocaml
_fab has quit [Read error: 104 (Connection reset by peer)]
_fab has joined #ocaml
ski_ has joined #ocaml
ski has quit [Nick collision from services.]
ski_ is now known as ski
_fab has quit [Read error: 113 (No route to host)]
_fab has joined #ocaml
Smerdyakov has joined #ocaml
bluestorm has quit [Remote closed the connection]
vincenz has quit ["Lost terminal"]
vincenz has joined #ocaml
gim has quit [Remote closed the connection]
_JusSx_ has joined #ocaml
<_JusSx_> HI OCAML ppl
<vincenz> hello
Smerdyakov has quit [Read error: 101 (Network is unreachable)]
<_JusSx_> vincenz:
ski_ has joined #ocaml
ski has quit [Nick collision from services.]
ski_ is now known as ski
zigong has joined #ocaml
vodka-goo has joined #ocaml
smimou has joined #ocaml
jave has joined #ocaml
simon has joined #ocaml
<simon> what are the ocaml equivalents to the is*() of ctype.h in C? (isapha, ispunct, etc.)
<smimou> there is no equivalent
<vodka-goo> simon: you can use regexp
<smimou> you can either do it by hand or use regexp
<simon> vodka-goo, rather than a set of character comparisons? I'd rather not.
<malc_> what an idiotic advice
<simon> smimou, I'll just make it myself then.
<smimou> yes for a char a regexp is a bit of an overkill
<vodka-goo> simon: OK tell us what you want to do exactly
<vodka-goo> we'll be able to make a more precise answer
<simon> vodka-goo, isalpha(c)
<vodka-goo> simon: use pattern matching
<smimou> simon: but things like (c >= 'a' && c <= 'z') should work
<vodka-goo> match c with 'a'..'z' | 'A'..'Z' -> true | _ -> false
<malc_> no they will not
<malc_> isXX is locale aware
<malc_> these hacks aren't
<malc_> sigh
<smimou> argl
<simon> malc_, so is* do exist, or are you referring to the C ones?
<smimou> C ones
<malc_> right
<vodka-goo> for good locale aware code, we should check for a binding
<vodka-goo> maybe it's done in extlib ?
<smimou> extlib is a pure caml lib
<vodka-goo> it can still be good ;)
<vodka-goo> if you like the unicode solution, camomile is the lib for unicode in caml
Bigbang is now known as Bigb[a]ng
<simon> ål
<simon> oops, wrong keyboard layout.
<simon> when you do nested matching using 'match', how do you define which 'match' paragraph your '| pattern' is relative to?
<malc_> explicit blocking
<malc_> with () or begin end
<simon> ah. thanks.
zigong has quit [Remote closed the connection]
_JusSx_ has quit ["leaving"]
_JusSx_ has joined #ocaml
Snark has quit [Read error: 110 (Connection timed out)]
rillig has joined #ocaml
malc__ has joined #ocaml
malc_ has quit [Read error: 110 (Connection timed out)]
Mitar has joined #ocaml
Smerdyakov has joined #ocaml
thei0s has joined #ocaml
thei0s has quit ["Jetzt stehst du da.. an der Laterne.. hast Tränen im gesicht.."]
_fab has quit [Read error: 104 (Connection reset by peer)]
pango has quit ["Leaving"]
_fab has joined #ocaml
Mitar has left #ocaml []
Axioplase has joined #ocaml
<Axioplase> Hi!
<Axioplase> Does anyone have some knowledge about ocamllex and ocamlyacc?
<vodka-goo> yup, try your question
kenpex has quit ["[In Me I Trust]"]
<Axioplase> I'm trying to write a brainfuck intrepreter or compiler. I know that I might have a lot of "+" together, so I tought I could do '+'+ { INCR (String.lentgh (lxm) ) }
<Axioplase> and then, do the "+" action as many times as the legnth of that string.
<Axioplase> But when it comes to yacc, I don't know how to write "do this action N times" (nor do I know how to get this number)
<Axioplase> in other (non caml) words, if "i++;" means "increment i", then I want to make "i++;i++;i++;" become "i=i+3"
<Axioplase> (there's no link between, the exmaple "+" and the one I parse, but I think you get what I mean)
malc__ has quit [Read error: 110 (Connection timed out)]
<vodka-goo> you have a token INCR of int
<vodka-goo> in yacc it will be seen as a single token, so only one action will be performed
<Axioplase> hum...
<Axioplase> So I'd still better treat each INCR individually ?
<vodka-goo> paste some code so I can get the approach you're using
Raziel has joined #ocaml
<Axioplase> some lexx/yacc code ? or some brainfuck code ?
<vodka-goo> Axioplase: I don't know brainfuck and I don't know your code, but I think one action INCR { incr $1 } can be OK
<vodka-goo> Axioplase: your parser
<Axioplase> k
<Axioplase> I think I remember how parsing works...
<Axioplase> I need to create my tree sum type.
_JusSx_ has quit [Remote closed the connection]
pango has joined #ocaml
<vodka-goo> Axioplase: depends.. some simple parsers can only perform side effects, return unit
<vodka-goo> for an interpreter it can be enough
<vodka-goo> for a compiler you should build a tree
<Axioplase> hum.. I guess I want to return the tree, so that I can evalueate it with some other code (or compile it to another language)
<vodka-goo> it's more modular yes
<Axioplase> "Who does the most, can do the least" (litteral translation from a proverb from here)
<Axioplase> I just need you to remind me how the parser stops and returns then. (so that I have NOP that will end the parsing?)
<vodka-goo> the "stop" is when the start rule has been recognized
<vodka-goo> the value of the associated action is what is returned
<vodka-goo> I think you need a simple example of parser
lispy has quit [Read error: 110 (Connection timed out)]
<Axioplase> I might think that too :)
<vodka-goo> don't mind the name ;)
<vodka-goo> it's a simple parser, I hope it'll help you figure out how you can design yours
<vodka-goo> examples can be more efficient than explanations
<Axioplase> thanks
<Axioplase> Don't I have to define the constructors in the parser ?
<vodka-goo> http://cvs.sourceforge.net/viewcvs.py/ocul/cul/cul/toplevel.ml?view=markup << here is how you use the lexer/parser
<vodka-goo> Axioplase: the token type is defined implicitely from the %token declarations
<Axioplase> Is it?
<Axioplase> afair I had to write them down, but I may be wrong.
<vodka-goo> maybe you're thinking about the type of the tree you're building
<vodka-goo> which needs to be declared
<vodka-goo> contrary to the type of tokens read by the parser (output by the lexer)
<Axioplase> I'm think of the {Cons($1,$3)} <-- the "Cons". The sume type must be defined in the paser, doesn't it?
<vodka-goo> you're right
<Axioplase> hum... do you have an example file that passes some value with the lexem? (to see how it is read from in the parser)
<vodka-goo> in the same webCVS you can read the associated lexer
smimou has quit ["bli"]
<vodka-goo> and I've posted a link to the file where I use the lexer together with the parser
<Axioplase> ha. Hadn't seen the toplevel