__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/
<Axioplase> 1 rule never reduced; 2 reduce/reduce conflicts.
<Axioplase> must be something wrong :)
<Axioplase> here's the parser: http://rafb.net/paste/results/pJ4aCl87.html
<Axioplase> (brainfuck is very sequential. hence the "tree" which looks like a weird list...)
HotNoodleOfInqui has quit [Client Quit]
quamaretto has joined #ocaml
thei0s has joined #ocaml
<Axioplase> argh
<Axioplase> one line appeard twice..
<vodka-goo> Axioplase: what about loops ?
<Axioplase> "what about loops?" ?
<vodka-goo> sorry, forget that
<erik> does xavier leroy hang out in here?
<vodka-goo> but loops are also the reason for your error
<vodka-goo> erik: I don't think so
<vodka-goo> Axioplase: the parser doesn't know how to parenthesize nested loops
<vodka-goo> you must tell it to do it left-associative or right-associative
<Axioplase> well... loops are a bit weird... it enters the loop only if the value at the pointer is >0. Which can only be known at eval time. that's why it takes no arg.
<vodka-goo> there's an ambiguity
<Axioplase> ha.
<vodka-goo> hum
<vodka-goo> I said crap ;)
<Axioplase> is it ok then? (because the scheme/lisp parser you showed me looks like the same...)
<vodka-goo> run ocamlyacc -v to get a .output file with more info
<vodka-goo> Axioplase: ideally, you shouldn't have any error (it could cause trouble if you don't understand them)
<vodka-goo> btw don't you want START seq END seq { Loop($2,$4) } ?
<vodka-goo> can't there be anything after a loop ?
<vodka-goo> was the error caused by the duplicated line ?
<Axioplase> vodka-goo: after removing the duplicate line, there was no error left.
<Axioplase> but you're rigthn I forgot the recursion after loops.
thei0s has left #ocaml []
<Axioplase> vodka-goo: err... is the sum type defined at the right place in the parser ?
rillig has quit ["exit(EXIT_SUCCESS)"]
<vodka-goo> yours ?
<vodka-goo> looks like the good place, why ?
<Axioplase> File "parser.mli", line 13, characters 48-54:
<Axioplase> Unbound type constructor bfTree
<Axioplase> though I have no error when doing "ocamlyacc parser.mly"
<vodka-goo> ocamlyacc doesn't run ocamlc
<Axioplase> this error was givent by ocamlc -c parser.mli
<Axioplase> sorry, I forgot to tell it.
<vodka-goo> is the type defined in parser.mli ?
<vodka-goo> I would have believe ocamlyacc copies it there
<Axioplase> heres what I have now: http://rafb.net/paste/results/tV4OQR63.html
malc_ has joined #ocaml
<vodka-goo> but what ends up in parser.mli ?
<Axioplase> vodka-goo: jsut the "token" type and "val seq"
<vodka-goo> strange
<vodka-goo> so put your bfTree in another module
<vodka-goo> it's actually better, so your compiler/interpreter module won't depend on the parser (would be the case if bfTree was declared in the parser)
<Axioplase> That's what I've jsut done (check my last rafb.net post)
raziel_ has joined #ocaml
Raziel has quit ["what have you found?... the same old fears..."]
raziel_ has quit [Client Quit]
Raziel has joined #ocaml
<Axioplase> dammit..
<Axioplase> vodka-goo: may it be possible that ocamlc doesn't look in current directory ?
<vodka-goo> don't think so
<Axioplase> lexer.ml won't find "Parser" either.
<Axioplase> I think there is a path problem or something like that.
<Axioplase> it just won't open modules I created myself...
malc_ has quit ["leaving"]
Skal has quit [Remote closed the connection]
Bigb[a]ng is now known as Bigbang
_exa has joined #ocaml
lispy has joined #ocaml
exa has quit [Read error: 110 (Connection timed out)]
_exa has quit [Read error: 110 (Connection timed out)]
_fab has quit [Remote closed the connection]
Axioplase has quit ["leaving"]
shirogane has joined #ocaml
Bigbang is now known as Bigb[a]ng
* dylan wishes ocaml had unboxed machine types...
<quamaretto> Why does dylan wish that?
<dylan> So implementing dha1 in ocaml would be more fun.
<vodka-goo> for easier bindings ?
<dylan> *sha1
<vodka-goo> missed
<vodka-goo> good night
<erik> is anyone here familiar with the ocaml asmcomp stuff?
<dylan> And so I could conceive writing a TCP/IP stack in ocaml, too. :)
vodka-goo has quit ["Connection reset by by pear"]
<erik> i'm trying to figure out how to ask for a register
pango_ has joined #ocaml
pango has quit [Read error: 110 (Connection timed out)]
Nutssh has joined #ocaml
Smerdyakov has quit ["Leaving"]
shirogane has quit [Read error: 104 (Connection reset by peer)]
Nutssh has quit ["Client exiting"]
Sesh has quit ["Chatzilla 0.9.69 [Firefox 1.0.5/20050716]"]
Snark has joined #ocaml
cmeme has quit ["Client terminated by server"]
cmeme has joined #ocaml
bluestorm has joined #ocaml
ramkrsna has quit [Read error: 110 (Connection timed out)]
ramkrsna has joined #ocaml
pango_ has quit [Remote closed the connection]
pango has joined #ocaml
_fab has joined #ocaml
Schmurtz has quit ["Dodo !"]
Skal has joined #ocaml
m3ga has joined #ocaml
Revision17 has joined #ocaml
revision17_ has quit [Read error: 110 (Connection timed out)]
Snark has quit [Read error: 110 (Connection timed out)]
Snark has joined #ocaml
Bigb[a]ng is now known as Bigbang
m3ga has quit [Read error: 104 (Connection reset by peer)]
ski has quit ["later .."]
malc_ has joined #ocaml
_fab has quit [Read error: 104 (Connection reset by peer)]
_fab has joined #ocaml
_fab has quit [Read error: 104 (Connection reset by peer)]
_fab has joined #ocaml
_fab has quit [Read error: 104 (Connection reset by peer)]
_fab has joined #ocaml
_fab has quit [Read error: 104 (Connection reset by peer)]
Raziel has quit ["Yo soy goma. Tú eres cola."]
Raziel has joined #ocaml
_fab has joined #ocaml
_fab has quit [Read error: 113 (No route to host)]
_fab has joined #ocaml
_fab has quit [Read error: 104 (Connection reset by peer)]
_fab has joined #ocaml
vodka-goo has joined #ocaml
quamaretto_ has joined #ocaml
_fab has quit [Read error: 104 (Connection reset by peer)]
gim has joined #ocaml
_fab has joined #ocaml
_fab has quit [Read error: 104 (Connection reset by peer)]
Bigbang is now known as Bigb[a]ng
Bigb[a]ng is now known as Bigbang
_fab has joined #ocaml
<vincenz> re
quamaretto_ has quit ["Chatzilla 0.9.69 [Firefox 1.5/2005111116]"]
ski has joined #ocaml
_fab has quit [Read error: 113 (No route to host)]
Smerdyakov has joined #ocaml
Raziel has quit [Remote closed the connection]
jeremy_c has joined #ocaml
<jeremy_c> How do I do a comparison from stat.st_perm to see if a file is executable?
<jeremy_c> hm, nm. seems that Unix.access might be a better choice.
<jeremy_c> hm, maybe not. I don't know how to deal with a unit type.
<jeremy_c> let acinf = Unix.access "/bin/ls" [Unix.X_OK] in
<jeremy_c> how do I check if acinf is True or False?
<bluestorm> what are you looking for ?
<bluestorm> is a file is executable ?
<jeremy_c> bluestorm: to see if /bin/ls is executable.
<bluestorm> ah
<bluestorm> hum
<bluestorm> if you have the good perms ?
<Smerdyakov> jeremy_c, are you purposely not reading the manual?
<jeremy_c> bluestorm: Unix.access should do it, but I am still new to OCaml and do not know how to deal with access's output, a unit?
<jeremy_c> Smerdyakov: I am on the manual.
<Smerdyakov> Why don't you paste what it says?
<jeremy_c> val access : string -> access_permission list -> unit
<jeremy_c> Check that the process has the given permissions over the named file. Raise Unix_error otherwise.
<jeremy_c> hm.
<Smerdyakov> That sure looks like your answer.
<jeremy_c> :-)
<bluestorm> hum jeremy_c
<bluestorm> why is stat.st_perm a bad solution ?
<jeremy_c> bluestorm: it's not, I just figured access would be much easier than interpreting all the diff permission levels.
<bluestorm> ok
<bluestorm> hum
<bluestorm> but
<bluestorm> it's
<bluestorm> try access file [X_OK]; true with _ -> false
<bluestorm> but it could be written better i guess
<bluestorm> try access file [X_OK]; true with Unix_error -> false | exn -> raise exn
<bluestorm>
<bluestorm> do you know the try/with syntax ?
<jeremy_c> bluestorm: yes. I just was not reading as Smerdyakov pointed out. I got hung up on the function definition returning unit.
<Smerdyakov> bluestorm, why did you explicitly catch and re-raise other exceptions?
<bluestorm> Smerdyakov, hum
<bluestorm> i guess having a incomplete matching would result in a warning, isn't it ?
<Smerdyakov> No, not for try.
<bluestorm> ah
<bluestorm> even thus, i usually do something like | exn -> Printf.printf "unknow exception in function function_name : %s\n" (Printexc.to_string exn)
<Smerdyakov> bluestorm, even if the calling function has a handler waiting to handle that exception in a way that doesn't indicate an error?
<bluestorm> hum
<bluestorm> you mean, my way ?
<bluestorm> yes
<bluestorm> but you can use a failwith if you don't want the error to be stopped
<bluestorm> i personnaly prefer match the exception in the function and not having to try/with when calling it
<Smerdyakov> failwith raises an exception.
<Smerdyakov> It will be matched by a variable pattern like any other exception.
<bluestorm> yes
gim has quit []
_fab has joined #ocaml
ppsmimou has quit ["Leaving"]
quamaretto has quit [Read error: 104 (Connection reset by peer)]
HotNoodleOfInqui has joined #ocaml
_fab has quit [Read error: 113 (No route to host)]
quamaretto has joined #ocaml
HotNoodleOfInqui has quit [Read error: 110 (Connection timed out)]
exa has joined #ocaml
smimou has joined #ocaml
gim has joined #ocaml
bluestorm has quit [Remote closed the connection]
rillig has joined #ocaml
zigong has joined #ocaml
jeremy_c has quit ["leaving"]
monochrom has joined #ocaml
pango has quit ["Leaving"]
pango has joined #ocaml
SnarkBoojum has joined #ocaml
Snark has quit [Nick collision from services.]
SnarkBoojum is now known as Snark
Snark has quit ["Leaving"]
Raziel has joined #ocaml
raziel_ has joined #ocaml
raziel_ has quit [Client Quit]
Raziel has quit [Client Quit]
Raziel has joined #ocaml
zigong has quit [Remote closed the connection]
ski has quit [Read error: 110 (Connection timed out)]
<Smerdyakov> OK, who wants to help me test a web site about programming languages? http://www.softwarescrutiny.net/ss/intro
exa has quit [Remote closed the connection]
<malc_> Smerdyakov: ever saw this http://tunes.org/wiki/Programming_Languages ?
<Smerdyakov> malc_, yes. I don't think it comes close to the idea, and I also don't like associating with TUNES. :)
<malc_> heh, i can understand that sentiment
<malc_> think it's almost like being in the duke nukem forever team
<Smerdyakov> The DNF team is probably more polite.
* malc_ contemplates going to #tunes and doing some ass whooping
<Smerdyakov> Oh, but those TUNES goofcats have actually started using real wiki software instead of their custom garbage!
<malc_> and after that you are accusing them of impoliteness? :)