<xah_lee>
sorry a basic question. is there something like print_boolean?
<mbishop>
xah_lee: not that I know of, but you can use Printf
<xah_lee>
umm it says unbonud value?
<xah_lee>
Unbound value printf
<mbishop>
Hmm? Printf is a standard module. You'll want Printf.printf
<xah_lee>
oh, k.
<mbishop>
and use %B for printing a boolean
<xah_lee>
sorry, how do i do something basic like Printf.printf 3 < 4;
<xah_lee>
only started ocaml few days ago
<mbishop>
Printf.printf "%B" (3 < 4)
<mbishop>
or something similar
<xah_lee>
Printf.printf "%B" (3 < 4);
<xah_lee>
ah goit it.
<xah_lee>
got it. *
ppsmimou has quit [Read error: 110 (Connection timed out)]
gim has quit [Read error: 110 (Connection timed out)]
jeremiah has quit [Read error: 104 (Connection reset by peer)]
ppsmimou has joined #ocaml
gim has joined #ocaml
jeremiah has joined #ocaml
<xah_lee>
if i have multiple print of simple int or float... but i want a line return in between, do i always just use print_string "\n";; in every other line? is there some simple way?
<AxleLonghorn>
print_endline
<xah_lee>
thx.
<xah_lee>
AxleLonghorn: doesn't seems to have effect
<kig>
add in parsing to deal with "Foo.bar" and presto!
<olegfink>
hm, I wonder how chameleon guys implemented such lookup
<olegfink>
iirc even camelia was able to do that, probably by parsing ocamldoc comments(?)
<kig>
you could adapt ocamldoc sources
<AxleLonghorn>
maybe an ocamldoc parser to write code?
ppsmimou has quit [Read error: 110 (Connection timed out)]
hsuh has quit [Read error: 60 (Operation timed out)]
gim has quit [Read error: 110 (Connection timed out)]
hsuh has joined #ocaml
delamarche has joined #ocaml
Mr_Awesome has joined #ocaml
tar_ has joined #ocaml
AxleLonghorn has quit [Read error: 110 (Connection timed out)]
AxleLonghorn has joined #ocaml
AxleLonghorn has left #ocaml []
<tar_>
Lexing.from_channel ... how can you make it return?
<tar_>
with open_in "file" or stdin, it just hangs at eof
jeddhaberstro has quit []
<thelema>
it's waiting for more input - your lexer needs to finish before EOF (or maybe match EOF as a token)
<tar_>
in my lexer I have "| eof { EOF }" and in my grammar "| input EOF { $1 }" Is that not good enough? Seems like when it gets EOF it's either a syntax error or the end of input and it should return.
<thelema>
It's possible that the one token lookahead is causing problems. Sorry, I'm not so good with the builtin tools to really help.
<tar_>
The action on the rule is now { print_endline "EOF!!!"; $1 } and it prints . . .
<tar_>
as many times as I'd like to press Ctrl+D
<tar_>
ignore me, I have failed at induction.
alexyk has joined #ocaml
jeremiah has quit [Read error: 104 (Connection reset by peer)]
tar_ has quit []
jeremiah has joined #ocaml
tar_ has joined #ocaml
bzzbzz has quit ["leaving"]
sanguinev has quit [Remote closed the connection]
sanguinev has joined #ocaml
|jedai| has quit [Read error: 110 (Connection timed out)]
|jedai| has joined #ocaml
gim has joined #ocaml
ppsmimou has joined #ocaml
schmx is now known as schme
_jedai_ has joined #ocaml
|jedai| has quit [Read error: 110 (Connection timed out)]
pierre- has joined #ocaml
ppsmimou has quit [Read error: 60 (Operation timed out)]
gim has quit [Read error: 110 (Connection timed out)]
_jedai_ has quit [Read error: 60 (Operation timed out)]
|jedai| has joined #ocaml
Snark has joined #ocaml
schmx has joined #ocaml
schme has quit [Read error: 104 (Connection reset by peer)]
l_a_m has joined #ocaml
_zack has joined #ocaml
ygrek has joined #ocaml
ched has joined #ocaml
jeremiah has quit [Read error: 104 (Connection reset by peer)]
_jedai_ has joined #ocaml
|jedai| has quit [Read error: 110 (Connection timed out)]
mishok13 has joined #ocaml
_zack has quit ["Leaving."]
jeremiah has joined #ocaml
_jedai_ has quit [Connection timed out]
|jedai| has joined #ocaml
ched has quit [Remote closed the connection]
jeremiah has quit [Read error: 104 (Connection reset by peer)]
s4tan has joined #ocaml
rwmjones_ has joined #ocaml
holgr has joined #ocaml
jeremiah has joined #ocaml
petchema has joined #ocaml
Yoric[DT] has joined #ocaml
rwmjones_ has quit ["Closed connection"]
ygrek has quit [Remote closed the connection]
gim has joined #ocaml
ppsmimou has joined #ocaml
_zack has joined #ocaml
<Yoric[DT]>
thelema: ping
<Yoric[DT]>
Mmmmhhh....
* Yoric[DT]
wonders why his "assert false" don't print any message.
OChameau has joined #ocaml
rby has joined #ocaml
s4tan is now known as tarabans
tarabans is now known as s4tan
Snark has quit ["Ex-Chat"]
|jedai| has quit [Read error: 110 (Connection timed out)]
|jedai| has joined #ocaml
<Yoric[DT]>
Mmmmhh....
<Yoric[DT]>
It seems that my problems are related to flushing.
<mrvn>
I think it should flush on exit
<Yoric[DT]>
Actually, Batteries does flush on exit.
<Yoric[DT]>
("do"?)
<Yoric[DT]>
At the moment, I have a few difficulties with Unicode transcoding.
<Yoric[DT]>
If I flush manually, the output appears several times.
<Yoric[DT]>
Which leads me to believe that some I/O doesn't remember that it was flushed already.
<mrvn>
how do you flush after an assert false? That ends the code.
<mfp>
xah_lee: you can have ocamldoc generate manpages for you, with cd ocaml-sources/stdlib && ocamldoc -d /dest/dir -man *.mli
Axioplase is now known as Axioplase_
<Yoric[DT]>
mrvn: Well, there's an at_exit hook.
<mrvn>
does that trigger on abort?
<Yoric[DT]>
I'm not 100% sure.
hsuh has quit [Remote closed the connection]
sgnb has joined #ocaml
l_a_m has quit [Read error: 60 (Operation timed out)]
hkBst has joined #ocaml
<rwmjones>
_zack, couple of things
<rwmjones>
Jim Meyering is having a look at the autoconf macros ... I'll CC any comments on to you
<rwmjones>
and .. I don't know how, but can we add a link to the git repo from the ocaml-autoconf web pages?
|jedai| has quit [Read error: 110 (Connection timed out)]
|jedai| has joined #ocaml
_zack has quit [Read error: 110 (Connection timed out)]
_zack has joined #ocaml
ched has joined #ocaml
ygrek has joined #ocaml
l_a_m has joined #ocaml
_zack has quit [Read error: 110 (Connection timed out)]
ppsmimou has quit [Read error: 110 (Connection timed out)]
sgnb has quit [Read error: 110 (Connection timed out)]
gim has quit [Read error: 110 (Connection timed out)]
gim has joined #ocaml
ppsmimou has joined #ocaml
_zack has joined #ocaml
ygrek has quit [Remote closed the connection]
<Yoric[DT]>
Same question as yesterday: has anyone around here experience with Camomile's CharEncoding?
<gildor>
Yoric[DT]: I have some for getext
<gildor>
gettext
<gildor>
ocaml-gettext
<gildor>
but not very deep
<Yoric[DT]>
I have a flushing problem.
<gildor>
flush ?
<Yoric[DT]>
I have a [CharEncoding.convert_output].
<Yoric[DT]>
Whenever I flush it several times, well, it seems to reprint the same contents to the output.
<Yoric[DT]>
Which is a tad annoying.
<gildor>
probably a bug
<gildor>
have you looked at the source
sgnb has joined #ocaml
<Yoric[DT]>
Yeah, but I can't find any problem.
<gildor>
(but I never used [CharEncoding.convert_output])
<gildor>
maybe the bug come from the previous output_channel object
<gildor>
(the one being wrapped by convert_output)
<Yoric[DT]>
Well, it's a simple conversion of stdout to objects.
<Yoric[DT]>
Using ExtLib's corresponding class.
schme has joined #ocaml
delamarche has quit []
schmx has quit [Read error: 110 (Connection timed out)]
<gildor>
Yoric[DT]: no idea
<Yoric[DT]>
thanks
sporkmonger has joined #ocaml
<Yoric[DT]>
Ok, the bug does seem to be in Camomile.
<Yoric[DT]>
(or at least in the interaction between Camomile and IOClasses)
<Yoric[DT]>
Fixed for output.
<Yoric[DT]>
Next step will be to try and get inputs to work as well.
rby has quit [Read error: 131 (Connection reset by peer)]
_zack has quit [Read error: 60 (Operation timed out)]
rby has joined #ocaml
rby has quit [Read error: 104 (Connection reset by peer)]
sgnb has quit [Read error: 110 (Connection timed out)]
ppsmimou has quit [Read error: 110 (Connection timed out)]
gim has quit [Read error: 110 (Connection timed out)]
jeremiah has quit [Read error: 110 (Connection timed out)]
rby has joined #ocaml
<Yoric[DT]>
Ok, transcoding fixed.
<Yoric[DT]>
Probably not fast but it should work.
<Yoric[DT]>
Next step: adding an example of list comprehension.
jeremiah has joined #ocaml
l_a_m has quit [Read error: 54 (Connection reset by peer)]
<gildor>
Yoric[DT]: don't forget to transmit the bug upstream ;-)
<gildor>
(and the way to correct it)
<Yoric[DT]>
I actually haven't fixed it.
<Yoric[DT]>
I've worked around it by reimplementing stuff.
<Yoric[DT]>
It's disappointing but that's the only solution I've found.
l_a_m has joined #ocaml
nuncanada has quit [Read error: 110 (Connection timed out)]
nuncanada has joined #ocaml
xah_lee has quit []
<rwmjones>
grrrrrrr
<rwmjones>
Fatal error: exception Invalid_argument("index out of bounds")
<rwmjones>
Raised by primitive operation at unknown location
<rwmjones>
Called from unknown location
<rwmjones>
escaped exceptions are the bane of ocaml programming
sporkmonger has quit []
gim has joined #ocaml
ppsmimou has joined #ocaml
<Yoric[DT]>
yeah
<gildor>
Yoric[DT]: you can still transmit bug upstream (it is hosted on sourceforge AFAIK)
_zack has joined #ocaml
<gildor>
Yoric[DT]: so upstream will be aware of it
|jedai| has quit [Read error: 104 (Connection reset by peer)]
willb has joined #ocaml
dabd has joined #ocaml
<Yoric[DT]>
gildor: wilco
alexyk has quit []
alexyk has joined #ocaml
alexyk has quit [Client Quit]
pango has quit [Remote closed the connection]
alexyk has joined #ocaml
ikaros has joined #ocaml
vixey has joined #ocaml
pango has joined #ocaml
sgnb has joined #ocaml
Asmadeus_ has joined #ocaml
dabd has quit ["Ex-Chat"]
ikaros has quit [".quit"]
Asmadeus has quit [Read error: 104 (Connection reset by peer)]
rby has quit ["Quitte"]
Asmadeus_ has quit [Read error: 60 (Operation timed out)]
Asmadeus has joined #ocaml
itewsh has joined #ocaml
Asmadeus_ has joined #ocaml
patronus has quit [Client Quit]
patronus has joined #ocaml
patronus has quit [Client Quit]
marmotine has joined #ocaml
s4tan has quit []
Asmadeus has quit [Read error: 110 (Connection timed out)]
patronus has joined #ocaml
Amorphous has quit [Read error: 145 (Connection timed out)]
Chronona1t has joined #ocaml
Amorphous has joined #ocaml
Stefan_vK1 has joined #ocaml
_zack has quit ["Leaving."]
pierre_m has joined #ocaml
Stefan_vK has quit [Read error: 110 (Connection timed out)]
<Yoric[DT]>
thelema: ping
OChameau has quit [Read error: 113 (No route to host)]
rhar has joined #ocaml
psnively has joined #ocaml
Snark has joined #ocaml
thelema has quit [Read error: 110 (Connection timed out)]
<fremo>
'lo, is there any video related softwares written on Ocaml?
<fremo>
(nothing on the hump)
_zack has joined #ocaml
nuncanada has quit [Read error: 113 (No route to host)]
jlouis has joined #ocaml
<Yoric[DT]>
fremo: I don't think I've seen anything along these lines, no.
<Yoric[DT]>
fremo: you should ask ppsmimou, though, he's been known to do multimedia stuff with OCaml.
jeremiah has quit [Read error: 104 (Connection reset by peer)]
<psnively>
Nothing SDL-based?
alexyk has quit [Read error: 110 (Connection timed out)]
<fremo>
Yoric[DT]: ok thanks
<fremo>
psnively: yes, I thought about it
<psnively>
Framebuffer access, all that.
<psnively>
Yeah.
<fremo>
bindings to ffmpeg would do it for me but when I read ffmpeg headers I get lost
alexyk has joined #ocaml
ofaurax has joined #ocaml
jeremiah has joined #ocaml
pierre_m has quit [Read error: 60 (Operation timed out)]
Snark has quit ["Ex-Chat"]
Asmadeus_ is now known as Asmadeus
gim has quit [Read error: 110 (Connection timed out)]
ppsmimou has quit [Read error: 110 (Connection timed out)]
sgnb has quit [Read error: 110 (Connection timed out)]
thelema has joined #ocaml
vpalle has joined #ocaml
nuncanada has joined #ocaml
middayc has joined #ocaml
sporkmonger has joined #ocaml
psnively has quit []
pierre- has quit [Read error: 110 (Connection timed out)]
maciek has joined #ocaml
<tar_>
what's the negation operator for bools?
<maciek>
not
maciek is now known as Guest86753
<tar_>
ah, thanks
<Guest86753>
or bool = false
<Guest86753>
how to change background color in Graphics? I have white, but want black. What to do if I don't want to render screen-size black rectangle?
<kig>
i'd just render a screen-size black rectangle but i'm funny that way
<Guest86753>
there's background variable in Graphics
<Guest86753>
but it's constant. no I was funny.
<Guest86753>
*now
<Guest86753>
rendering big-black is too slow, I have significant slowdown
<kig>
that's weird as internally it does XFillRectangle, just like clear
<kig>
in fact, i'd expect clear to be _slower_ than fill_rect
<kig>
(by a microsecond, but still...)
<Guest86753>
well, I just thought I would be faster to clean with black, guess I was wrong
<Guest86753>
thanks for showing some internals
<kig>
hey, if you have the sources it's usually pretty easy to check out how things are made
<Guest86753>
but walking through them is sometimes painful, especially for beginners
<kig>
yeah, that's true
xah_lee has joined #ocaml
jeddhaberstro has joined #ocaml
Guest86753 has quit ["Ex-Chat"]
marmotine has quit ["mv marmotine Laurie"]
AxleLonghorn has joined #ocaml
sporkmonger_ has joined #ocaml
xah_lee has quit []
sporkmonger_ has quit [Client Quit]
jonasb has joined #ocaml
sporkmonger has quit [Read error: 60 (Operation timed out)]
slash_ has joined #ocaml
vpalle has quit [Read error: 60 (Operation timed out)]
alexyk has quit []
delamarche has joined #ocaml
alexyk has joined #ocaml
xah_lee has joined #ocaml
tar_ has quit []
itewsh has quit ["There are only 10 kinds of people: those who understand binary and those who don't"]
seafood has joined #ocaml
sporkmonger has joined #ocaml
slash_ has quit ["leaving"]
_zack has quit ["Leaving."]
tar_ has joined #ocaml
<tar_>
I'm writing an interpreter. I'm considering creating bytecode in the interpreter-written-in-C sense, or compiling to a (() -> ()) list that I just run through.
<tar_>
Would either be much worse than the other?
<kig>
if you're doing bytecode, maybe could go all the way to llvm?
<kig>
i have zero experience on interpreters and compilers though so beware strangers bearing advice and all that
<tar_>
I... hadn't even thought of that.
<tar_>
No, that is probably what I should have done, considering my target.
<Yoric[DT]>
'night everyone
Yoric[DT] has quit ["Ex-Chat"]
delamarche_ has joined #ocaml
delamarche has quit [Read error: 104 (Connection reset by peer)]
<tar_>
Well, assuming I want to continue the way I am ... heh
<vixey>
tar_, what is the point in this?
<tar_>
I'm writing an interpreter. (seemed like fun)
<vixey>
I mean what sort of language and so on
hkBst has quit [Read error: 54 (Connection reset by peer)]