Edward_ has quit [Read error: Connection reset by peer]
joewilliams is now known as joewilliams_away
xcthulhu has quit [Quit: Ex-Chat]
hto has joined #ocaml
ulfdoz has joined #ocaml
bzzbzz has joined #ocaml
mattam has quit [Ping timeout: 260 seconds]
mattam has joined #ocaml
flux has quit [Remote host closed the connection]
flx_ has joined #ocaml
Galadan has joined #ocaml
flx_ has quit [*.net *.split]
Tianon has quit [*.net *.split]
willb has quit [*.net *.split]
brendan has quit [*.net *.split]
flx_ has joined #ocaml
Tianon has joined #ocaml
willb has joined #ocaml
brendan has joined #ocaml
ASpiwack has quit [Ping timeout: 276 seconds]
flx_ is now known as Guest5983
a_m0d has joined #ocaml
<a_m0d>
Hi all
<a_m0d>
Is it possible to use ocamlyacc with a camlp4-stream based lexer?
<thelema>
afaik, ocamlyacc only works with ocamllex - other lexers don't provide the same interface
<a_m0d>
So there is no way to fake it?
<a_m0d>
I tried adding a parameter that wasn't used, but has the Lexing.lexbuf type
<a_m0d>
but it seems as if the lexer doesn
<a_m0d>
't return a Token but rather a lexbuf
<thelema>
yes, I think the lexbuf returned by the lexer is a record with just the right info and functions to finish the parsing on demand by the parser
<a_m0d>
oh :(
<a_m0d>
I presume that menhir also demands a Lexing.lexbuf return type then
<thelema>
actually, it takes the lexer itself and the lexbuf
<thelema>
the lexbuf keeps track of position and input
<thelema>
and buffering
jakedouglas has quit [Quit: Leaving.]
<thelema>
the lexer reads the lexbuf
<thelema>
try parser combinators in batteries, they're an interedsting way to parse
Guest5983 is now known as flux
<flux>
maybe you could make-do by having a thread use camlp4 streams and provide a lexing function terms of that?
<a_m0d>
thelema: thanks for the suggestion
<flux>
infact, you could use caml-shift if threads feel too heavy-weight :-)
<a_m0d>
I have also looked at using streams only, which doesn't seem to bad,
<a_m0d>
but using a LR(1) parser I get warnings about shift / reduce conflicts, which is quite useful and which I won't get otherwise
<flux>
yes, it is quite nice
<flux>
a_m0d, btw, I've found batteries ParserCo parser combinator library quite nice as well
<flux>
but it isn't fast and I wouldn't write certain kinds of parsers with it, atleast not with my level of experice..
<flux>
s/ice/tise/
<a_m0d>
What about using a pure camlp4 based parser? Is that fairly fast?
<flux>
no idea. should be atleast decent.
<a_m0d>
I'm thinking of something similar to the lexer / parser in the Kaleidoscope example from LLVM
<flux>
I'd expect that the ocaml code it generates wouldn't be that complicated.
<flux>
infact, it should be on par with a hand-written parser..
<flux>
so do you need performance?
<a_m0d>
It's not - it's basically just a bit of syntactic sugar on top of standard ocaml code
<a_m0d>
No, I don't really need the performance, but I'm really just curious
ygrek has quit [Remote host closed the connection]
ygrek has joined #ocaml
ulfdoz has quit [Ping timeout: 258 seconds]
Amorphous has quit [Ping timeout: 264 seconds]
ttamttam has joined #ocaml
ikaros has joined #ocaml
Amorphous has joined #ocaml
ikaros has quit [Quit: Leave the magic to Houdini]
a_m0d has quit [Quit: Rejected :-/]
|marius| has joined #ocaml
|marius| has quit [Remote host closed the connection]
svenl has joined #ocaml
Yoric has joined #ocaml
avsm has joined #ocaml
valross has quit [Quit: Ex-Chat]
jsk-away is now known as jsk
verte has joined #ocaml
Edward_ has joined #ocaml
pikachuyann has joined #ocaml
Associat0r has joined #ocaml
det has quit [Ping timeout: 240 seconds]
hto has quit [*.net *.split]
caligula__ has quit [*.net *.split]
theDroggl_ has quit [*.net *.split]
nimred has quit [*.net *.split]
Pepe_ has quit [*.net *.split]
hto has joined #ocaml
caligula__ has joined #ocaml
theDroggl_ has joined #ocaml
nimred has joined #ocaml
Pepe_ has joined #ocaml
det has joined #ocaml
asmanur has joined #ocaml
asmanur_ has quit [Ping timeout: 240 seconds]
Edward_ has quit []
Galadan has left #ocaml []
ASpiwack has joined #ocaml
Yoric has quit [Quit: Yoric]
Yoric has joined #ocaml
ygrek has quit [Remote host closed the connection]
ygrek has joined #ocaml
th5 has joined #ocaml
oc13 has joined #ocaml
_andre has joined #ocaml
boscop_ has quit [Ping timeout: 252 seconds]
oriba has joined #ocaml
_unK has joined #ocaml
hyperboreean has quit [Ping timeout: 245 seconds]
dark has joined #ocaml
<dark>
is there a way for a 'a class represent an "unfinished" object? an object with <methods; ..>
<dark>
i want to make a "virtual" class, to serve as interface
<adrien>
well, you can declare some methods as virtual
<dark>
but i want to make an ; .. type
<dark>
if a function receives a class, it is not compatible with the ; .. type
<adrien>
my experience with objects is quite limited but maybe that the ':>' operator will help: you can use it to "reduce" the object to a more basic type, however I've mostly used that to put objects of different classes (but an identical base class) into a data structure (like a list)
<dark>
but what i want is to have a syntax sugar for <methods; ..>
<adrien>
but I'm a bit surprised, I think it should work: are you sure the types of the methods are right? maybe a typo
<dark>
i already have this type on my functions, and i want to kind of "abstract" this
<dark>
hmm
<rossberg_>
dark: try the #classname syntax
<dark>
is this a type?
<rossberg_>
yes
<dark>
unrelated: how can i start the interpreter at tuareg with ocaml running? i use C-x C-e for this. M-x tuareg-interactive-mode switch the mode of current buffer to this, but it says i have no ocaml process running
<thomasga>
you need to specify the right path to the ocaml binary in the emacs settings
<dark>
#x works for what i intend!=)
<thomasga>
or you can choose which binary to want to run I think (and you have to write the fullpath there)
<dark>
thomasga: hmm but C-x C-e asks for it, without asking for full path.. a convenience not available for those wanting to run the interpreter without evaluating some bit as initial input?
<thomasga>
ha sorry, I rode your question too quickly ... I am afraid I don't know the answer then
hyperboreean has joined #ocaml
slunk has quit [Remote host closed the connection]
slunk has joined #ocaml
<dark>
class x = object method a = 1 end class y = object method a = 2 method b = 7 end let f (k : #x) = k let _ = print_int (f (new y))#b
<dark>
this works
<dark>
k : x would not
<dark>
class x = object method a = 1 end class y = object method a = 2 method b = 7 end let f (k : <a : int; ..> as 'a) = k let _ = print_int (f (new y))#b
<rossberg_>
right, because x = <a : int> and #x = <a : int; ..>
<dark>
and this too (but is ugly)
<rossberg_>
you wouldn't need the "as 'a" there, though
<dark>
actually... in the type, it still is pretty-printed in an ugly way =(
<dark>
to the toplevel, f has type (< a : int; .. > as 'a) -> 'a
<rossberg_>
but there you need it
<dark>
i suppose i can have, at least, ocamldoc output the type signature as #x?
<rossberg_>
it expresses that the result of f has the _same_ type as its argument
<dark>
hmm well the big win ocaml had with row types, as people say, is the ability to pretty-print a lot of types using the aliases the user prefer
<dark>
i mean: it pretty prints "first-order" object types very well..
<rossberg_>
well, it should print (#x as 'a) -> 'a if you enter it like that
<rossberg_>
what would you like to see instead?
<dark>
yes, (f : (#x as 'a) -> 'a) is pretty printed as you way
<dark>
i would like to see let f (k : #x) = k being pretty-printed like that as well, but..
<dark>
i suppose i can do let f k : (#x as 'a) -> 'a = k or something
<rossberg_>
hm...
<dark>
no, this has the wrong type
<rossberg_>
# let f (x : #c) = x;;
<dark>
but is pretty-printed well
<rossberg_>
val f : (#c as 'a) -> 'a = <fun>
<dark>
hm o.o
<dark>
oh you are right
<dark>
i was looking at the <a : .. output
<dark>
well it is a lot better now
<dark>
(i know it is asking too much, but let a = object end class q = a does not work)
<dark>
i expected it to work because class a = let .. in object .. end works
pikachuyann has quit [Quit: Quitte]
drunK has joined #ocaml
_unK has quit [Ping timeout: 264 seconds]
dark has quit [Remote host closed the connection]
drunK is now known as _unK
boscop has joined #ocaml
fraggle_ has quit [Quit: -ENOBRAIN]
joewilliams_away is now known as joewilliams
fraggle_ has joined #ocaml
jakedouglas has joined #ocaml
verte has quit [Quit: ~~~ Crash in JIT!]
ccasin has quit [Ping timeout: 258 seconds]
fraggle_ has quit [Quit: -ENOBRAIN]
rwmjones is now known as rwmjones_afk
fraggle_ has joined #ocaml
ccasin has joined #ocaml
ikaros has joined #ocaml
<tab>
gildor: is that possible to have .h files along with .c in an oasis conf file ?
<gildor>
tab: you don't have to declare it in _oasis
<gildor>
tab: and it should work, except that dependencies is not declared
<tab>
hm, my problem is that the .h is not copied to _build
<gildor>
yes, this is the dependencies problem
<tab>
so when you reach the .c file that depends on the .h file, it doesn't find it
rwmjones_afk is now known as rwmjones
<tab>
is there a way to just tell oasis to copy the file to the _build anyway ?
<tab>
i don't need any dependencies checking, just need all the files to be there in the build
<gildor>
tab: the best is to add a dispatch After_rules -> dep ["compile"; "c"] ["toto.h"]; in myocamlbuild.ml
<tab>
typically in cabal that's what "extra-source-files" is for
<tab>
hm :\
oc13 has quit [Ping timeout: 240 seconds]
<gildor>
tab: still there ?
<gildor>
tab: maybe I have a fix
<tab>
i am
<gildor>
can you provide me with an example ?
th5 has quit [Ping timeout: 240 seconds]
jsk is now known as jsk-away
Yoric has quit [Quit: Yoric]
ttamttam has left #ocaml []
pikachuyann has joined #ocaml
Yoric has joined #ocaml
avsm has quit [Quit: Leaving.]
ulfdoz has joined #ocaml
oc13 has joined #ocaml
* adrien
pops
<hcarty>
Exception: Stack.Empty.
<adrien>
now I only hope someone's there to catch my failure =/
<bitbckt>
There's a life lesson in there, somewhere.
<adrien>
always have a safety net? ;-)
<bitbckt>
Perhaps. :-)
<bitbckt>
"Once you pop, you don't stop."
<bitbckt>
Oh, it's "Once you pop, you can't stop."
<adrien>
heh
<adrien>
actually I have the problem as tab, now I only need to make a small example
Associat0r has quit [Quit: Associat0r]
ikaros has quit [Quit: Leave the magic to Houdini]
<tab>
adrien: anything i can help with ?
<adrien>
tab: well, did you send gildor an example? if not, I will (well, right after I've bought some food, ok, I admit it, I'm buying beer)
<adrien>
tab: btw, because of ocamlbuild, you can't have both 'somename.c' and 'somename.h' copied into the _build/ dir (ocamlbuild chops the extension, one work-around it not to copy to _build/ but -I the original folder, I have no idea what gildor's fix would do however)
Edward_ has joined #ocaml
Anarchos has joined #ocaml
jonafan has joined #ocaml
ccasin has quit [Quit: Leaving]
sepp2k has joined #ocaml
<adrien>
"The position begins with a 6-month contract starting NOW (September 1st)" <- vous vous y prenez à l'avance chez mlstate ^^
<adrien>
ergh, somehow, I knew it was the wrong channel ><
oc13 has quit [Ping timeout: 240 seconds]
oriba has quit [Quit: Verlassend]
Anarchos has quit [Quit: Vision[0.9.7-H-090423]: i've been blurred!]
<tab>
adrien: i did sent him an example, and he fixed it
<adrien>
ok, good :-)
Smerdyakov has joined #ocaml
<adrien>
means I'll add back support for _oasis for the webkit-gtk bindings :-)
<adrien>
Smerdyakov: hi, it seems guests still can't post on the channel, any idea why? (I though only +r would do that but it isn't on)
<Smerdyakov>
The first order of business is to get more people channel privileges. The second order is to get ChanServ to stop opping them. :P
<Smerdyakov>
I can't help you with that question. It doesn't seem specific to this channel. I'm happy to implement any solution you find, if lame permissions issues require it.
<adrien>
hmmm, +r actually prevents joins, not messages
metasyntax has joined #ocaml
rfg has joined #ocaml
sepp2k1 has joined #ocaml
sepp2k has quit [Ping timeout: 240 seconds]
_andre has quit [Quit: *puff*]
avsm has joined #ocaml
avsm has quit [Client Quit]
ygrek has quit [Remote host closed the connection]
ygrek has joined #ocaml
Yoric has quit [Quit: Yoric]
ygrek has quit [Remote host closed the connection]
srcerer has joined #ocaml
ASpiwack has quit [Ping timeout: 272 seconds]
ASpiwack has joined #ocaml
oc13 has joined #ocaml
Smerdyakov has quit [Quit: Leaving]
<gildor>
adrien: with the latest patch I send to tab, you just have to add a .h file in CSources and it gets copied into the _build directory
<gildor>
adrien: but it needs more testing and probably a better design, this was a 10 minute fix
<adrien>
gildor: that sounds good, how did you do it? (I can probably test tomorrow)
boscop has quit [Ping timeout: 264 seconds]
boscop has joined #ocaml
<gildor>
adrien: data dumped between _oasis and myocamlbuild.ml was lib. name + path
<gildor>
adrien: I added headers + a dep ["compile"; "c"] headers
<gildor>
just as in the ocamlbuild examples you mention in your feature request