<adrien>
ah, didn't really understand what you were after at first
<adrien>
lewis1711: you should use the Str module, or the Pcre one, or mikmatch (look up that one)
<sgnb>
lewis1711: this is because you can only put constructors in pattern (lhs of -> in match ... with)
<sgnb>
and ^ is a function
<lewis1711>
ahh
<lewis1711>
isn't a constructor a function though? it has a type sig and all
<lewis1711>
'a -> Type, or whatever
<sgnb>
lewis1711: not at all... constructors are used to build values, they do not compute anything at all... they don't have a definition, they are just declared
<sgnb>
functions have a body, and compute something
<lewis1711>
hmm
<sgnb>
and btw, you can "see" that ^ is a function by typing "(^)" in the toplevel
<lewis1711>
yeah, I understand that it's just a function written infix
<lewis1711>
i just never clicked that one couldn't have them in pattern matchs
<sgnb>
on the other hand, :: (for lists) is a constructor
<lewis1711>
*matches
<lewis1711>
probably because up intil just then I thought constructors were functions:)
ikaros has joined #ocaml
munga has quit [Ping timeout: 246 seconds]
boscop_ has quit [Ping timeout: 240 seconds]
ftrvxmtrx_ has quit [Ping timeout: 240 seconds]
boscop has joined #ocaml
LeNsTR has joined #ocaml
munga has joined #ocaml
ftrvxmtrx_ has joined #ocaml
lewis1711 has left #ocaml []
ftrvxmtrx_ has quit [Read error: Connection reset by peer]
kani has joined #ocaml
ftrvxmtrx_ has joined #ocaml
cyanure has joined #ocaml
<cyanure>
I guys, I'm trying to use Menhir with ocamlbuild, and i declare an "exception Variable_exists of string" between %{ %} but in my main file "Parser.Variable_exists str" i get "Error: Unbound constructor Parser.Variable_exists". Can someone helps me ?
drunK has joined #ocaml
munga has quit [Ping timeout: 255 seconds]
<thelema_>
cyanure:you'll have to compile your parser module into a mll with menhir and then once with ocamlc to produce a .cmi file
<cyanure>
thelema_, isn't there any automatic feature in ocamlbuild ?
<cyanure>
in _build there is a parser.cmi file anyway
thelema has joined #ocaml
<kerneis>
cyanure: you could probably add a rule in myocamlbuild.ml
<kerneis>
but I have no idea what it would look like
<cyanure>
i don't have a myocamlbuild.ml
<cyanure>
For now i got around it by adding a false file "common.ml" with the exception declaration opening it in both main.ml and parser.mly
<cyanure>
it works but it's kind of ugly
<kerneis>
myocamlbuild.ml is an optionnal file
<kerneis>
where you can add rules for ocamlbuild
<cyanure>
thought it was _tags ?
<kerneis>
also
thelema_ has quit [Ping timeout: 250 seconds]
<cyanure>
ocamlbuild is supposed to simplify ocaml compiling but it really is not
<adrien>
a new tool to learn
<adrien>
and of course, it doesn't cover anything
<adrien>
s/anything/everything/ woops
<cyanure>
let's hope it become more simple to use then (as I learn how to make it work)
<thelema>
cyanure: yes, try the tag "use_menhir"
edwin has quit [Ping timeout: 255 seconds]
<cyanure>
thelema, yes, it is already in there, it works but somehow the exception manually declared arent visible from exterior
Edward has joined #ocaml
<thelema>
cyanure: what happens if you [ocamlbuild parser.byte] and then try to make your main file
<cyanure>
thelema, same problem
ftrvxmtrx_ has quit [Read error: Connection reset by peer]
edwin has joined #ocaml
ski has joined #ocaml
ccasin has joined #ocaml
ftrvxmtrx_ has joined #ocaml
<thelema>
cyanure: you're sure there's no typo? and that _build/parser.cmi is being created?
<cyanure>
thelema, no typo in what ? yeah, i'm sure
<thelema>
in your exception name in both places
<cyanure>
well I'm sure because when i put the exception declaration in a third file and open it in both parser.mly header and in main.ml, it works fine
oriba has joined #ocaml
ftrvxmtrx_ has quit [Read error: Connection reset by peer]
ygrek has quit [Remote host closed the connection]
ygrek has joined #ocaml
ftrvxmtrx_ has joined #ocaml
asmanur has joined #ocaml
asmanur_ has quit [Ping timeout: 276 seconds]
ccasin has quit [Quit: Leaving]
smerz has joined #ocaml
ccasin has joined #ocaml
fabjan has joined #ocaml
yezariaely has joined #ocaml
decaf has quit [Remote host closed the connection]
decaf has joined #ocaml
jm_ocaml has joined #ocaml
jm_ocaml has quit [Remote host closed the connection]
ftrvxmtrx_ has quit [Ping timeout: 240 seconds]
ulfdoz_ has joined #ocaml
ulfdoz has quit [Ping timeout: 246 seconds]
ulfdoz_ is now known as ulfdoz
ftrvxmtrx_ has joined #ocaml
munga has joined #ocaml
infoe has quit [Ping timeout: 250 seconds]
munga has quit [Ping timeout: 250 seconds]
thieusoa1 has quit [Quit: leaving]
ftrvxmtrx_ has quit [Ping timeout: 260 seconds]
ygrek has quit [Ping timeout: 240 seconds]
tnguyen_ has joined #ocaml
decaf has quit [Ping timeout: 240 seconds]
almaisan-away is now known as al-maisan
al-maisan is now known as almaisan-away
tnguyen_ has quit [Remote host closed the connection]
BiDOrD has joined #ocaml
ygrek has joined #ocaml
myu2 has quit [Remote host closed the connection]
decaf has joined #ocaml
myu2 has joined #ocaml
Smerdyakov has joined #ocaml
tnguyen has joined #ocaml
gildor has quit [Ping timeout: 276 seconds]
gildor has joined #ocaml
ftrvxmtrx has joined #ocaml
thieusoai1 has joined #ocaml
thieusoai1 has left #ocaml []
thieusoai1 has joined #ocaml
tnguyen has quit [Remote host closed the connection]
Smerdyakov has quit [Quit: Leaving]
thieusoai1 has left #ocaml []
thieusoai1 has joined #ocaml
thieusoai1 has left #ocaml []
ulfdoz has quit [Ping timeout: 240 seconds]
ymasory_ has joined #ocaml
ymasory_ has quit [Ping timeout: 240 seconds]
eelte has joined #ocaml
coucou747 has quit [Ping timeout: 276 seconds]
ygrek has quit [Ping timeout: 240 seconds]
Yoric has quit [Quit: Yoric]
kani has quit [Remote host closed the connection]
yezariaely has quit [Quit: Leaving.]
edwin has quit [Remote host closed the connection]
ikaros has quit [Quit: Leave the magic to Houdini]