<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>
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