descender has quit [Read error: 110 (Connection timed out)]
krypt1 has quit [Remote closed the connection]
Submarine has joined #ocaml
lakcaj has left #ocaml []
Revision17 has joined #ocaml
Submarine has quit ["Leaving"]
CosmicRay has joined #ocaml
mrsolo__ has quit ["Leaving"]
mrsolo__ has joined #ocaml
CosmicRay has quit ["Client exiting"]
Smerdyakov has quit ["Leaving"]
love-pingoo has joined #ocaml
joshcryer has quit [Read error: 104 (Connection reset by peer)]
pauldia has joined #ocaml
love-pingoo has quit ["Connection reset by by pear"]
pango is now known as pangoafk
pangoafk is now known as pango
mrsolo__ has quit [Read error: 104 (Connection reset by peer)]
mrsolo__ has joined #ocaml
love-pingoo has joined #ocaml
joshcryer has joined #ocaml
Tachyon76 has joined #ocaml
revision17__ has joined #ocaml
andreas__ has joined #ocaml
Revision17 has quit [Read error: 110 (Connection timed out)]
joshcryer has quit [Read error: 104 (Connection reset by peer)]
<andreas__>
is there something like "elsif" in ocaml?
<pango>
else if
<andreas__>
thx
<pango>
with a good editor, it's indented correctly ;)
<sieni>
i.e. exactly like in C ;-)
joshcryer has joined #ocaml
pauldia has quit [Read error: 110 (Connection timed out)]
pauldia has joined #ocaml
andreas__ has quit []
joshcryer has quit [zelazny.freenode.net irc.freenode.net]
Schmurtz has quit [zelazny.freenode.net irc.freenode.net]
Narrenschiff has quit [zelazny.freenode.net irc.freenode.net]
TaXules has quit [zelazny.freenode.net irc.freenode.net]
bohanlon has quit [zelazny.freenode.net irc.freenode.net]
lispy has quit [zelazny.freenode.net irc.freenode.net]
Oatmeat|umn has quit [zelazny.freenode.net irc.freenode.net]
gim has quit [zelazny.freenode.net irc.freenode.net]
cmeme has quit [zelazny.freenode.net irc.freenode.net]
ppsmimou has quit [zelazny.freenode.net irc.freenode.net]
bohanlon has joined #ocaml
TaXules has joined #ocaml
joshcryer has joined #ocaml
Narrenschiff has joined #ocaml
Schmurtz has joined #ocaml
lispy has joined #ocaml
gim has joined #ocaml
ppsmimou has joined #ocaml
cmeme has joined #ocaml
Oatmeat|umn has joined #ocaml
bluestorm has joined #ocaml
andreas__ has joined #ocaml
Skal has joined #ocaml
joshcryer has quit [Client Quit]
<andreas__>
do I really have to add Str.cma to the compile command if I use the Str library?
<zmdkrbou>
yes
<zmdkrbou>
(and str.cmxa if you're compiling with ocamlopt)
<andreas__>
thx
Bigb[a]ng is now known as Bigbang
Schmurtz has quit [zelazny.freenode.net irc.freenode.net]
Oatmeat|umn has quit [zelazny.freenode.net irc.freenode.net]
gim has quit [zelazny.freenode.net irc.freenode.net]
cmeme has quit [zelazny.freenode.net irc.freenode.net]
lispy has quit [zelazny.freenode.net irc.freenode.net]
ppsmimou has quit [zelazny.freenode.net irc.freenode.net]
Narrenschiff has quit [zelazny.freenode.net irc.freenode.net]
Narrenschiff has joined #ocaml
Schmurtz has joined #ocaml
lispy has joined #ocaml
gim has joined #ocaml
ppsmimou has joined #ocaml
cmeme has joined #ocaml
Oatmeat|umn has joined #ocaml
Skal has quit [Remote closed the connection]
<andreas__>
I am confused about the syntax of else clauses in ocaml
<andreas__>
else (
<andreas__>
DynArray.insert display !k false;
<andreas__>
DynArray.insert keep !k true;
<andreas__>
);
<andreas__>
I the debugger tells me that the third line is executed although I want the whole else clause to be skipped
<pango>
code looks correct, it shouldn't happen
<andreas__>
I really don't understand this...
<andreas__>
Time : 1645 - pc : 75080 - module Alignment
<andreas__>
90 DynArray.insert keep !k true;<|a|>
<andreas__>
I rewrote the else clause with 'begin' 'end' but still the same behaviour
zmdkrbou has quit [Read error: 110 (Connection timed out)]
<love-pingoo>
just in case: are you sure the then branch is executed, i.e. are you sure your test is false ?
zmdkrbou has joined #ocaml
<flux__>
also, printf-debugging is cool ;)
<love-pingoo>
I wish I could use it :(
* love-pingoo
had an assert failure in a daemon, and has only logs for guessing what happened
<flux__>
let trace msg f v = try Printf.printf "Enter %s\n%!" msg; let r = f v in Printf.printf "Leave %s\n%!" msg; v with exn -> Printf.printf "Leave %s due to exception %s\n%!" msg (Printfexc.to_string exn); raise exn
<flux__>
OCAMLRUNPARAM=b is your friend ;)
<love-pingoo>
I catch exceptions in order to run cleanup procedures
<love-pingoo>
mmm... I wonder how far the re-raising preserves the stack trace
<love-pingoo>
what happens if I catch an exception, store it into a exception option ref, cleanup, and re-raise later ?
<flux__>
I'm not exactly sure. try it?-)
<love-pingoo>
I could also manage to do every cleanup from the catch clause, but I'm not sure it's that simple
Demitar has joined #ocaml
<love-pingoo>
IT WORKS :)
<love-pingoo>
but actually it won't help me, I know exactly from where the assert failure comes, I just have no idea why my assertion failed..
<flux__>
:)
<love-pingoo>
I'd need an ocamldebug for a threaded program which *needs* to be fast, no hope :&
<andreas__>
love-pingoo: yes I am sure
<flux__>
andreas__, and all files are compiled to be up-to-date etc?-o
<andreas__>
well yes, I use a Makefile
<pango>
my favorite way to handle "cleanup code", for scoped resources, is the "tryopen pattern"
<andreas__>
one more question: !kfirst < 0 would give me true if the content of kfirst is smaller than 0, right?
<love-pingoo>
pango: yeah that's nice.. but doesn't work for me (multithreaded app which fetches temporary files, I have to run a forced cleanup in case of an exit)
zmdkrbou has quit [Read error: 113 (No route to host)]
<flux__>
tryopen is something I occasionally use too
<flux__>
maybe a language extension would be in order here :). let scoped ic = scoped_open_in "filename" in .. ;)
<flux__>
(although the gains would be marginal at best)
<andreas__>
does anybody know the name of the debian package that includes the Str library? thx
<pango>
ocaml-nox
<andreas__>
are you sure? I have ocaml-nox installed but, the compiler complains with "Cannot find file Str.cma"
<flux__>
it should be str.cma
<flux__>
so maybe you're compiling it somehow wrong
<flux__>
ocamlc -c -o foo.cmo str.cma foo.ml ?
<flux__>
actually my str.cma is in package ocaml-interp
<andreas__>
thx
<flux__>
(debian unstable)
<flux__>
(slightly outdated, though)
<pango>
yes, str.cma is in ocaml-interp
<flux__>
try/finally language extension actually also does the same as that tryopen-pattern
<flux__>
(well, not quite, though)
<andreas__>
is there any way to print the contents of a buffer variable from within the debugger?
<pango>
var.buffer (if it sees thru abstract types ?)
<pango>
actually that would only be an approximation; Buffer.contents also truncates the string to b.position chars
<andreas__>
va.buffer?
<flux__>
ocamldebug apparently doesn't support calling functions?
<andreas__>
that's what I meant
zmdkrbou has joined #ocaml
<pango>
you could try your code in the interpreter...
dark_light has joined #ocaml
<andreas__>
it seems as if the debugger always looks at the last line of code in an else block, however the line is not executed
<andreas__>
so everything works fine
<andreas__>
:)
andreas__ has left #ocaml []
bluestorm has quit [Remote closed the connection]
Smerdyakov has joined #ocaml
zmdkrbou has quit [Read error: 113 (No route to host)]
zmdkrbou has joined #ocaml
love-pingoo has quit ["Leaving"]
Tachyon76 has quit [Remote closed the connection]
smimou has joined #ocaml
cricket has joined #ocaml
<cricket>
hey im havin trouble with case statements, anybody alive?
<pango>
with match, you mean ?
<pango>
or is it another sml question ?
<cricket>
sml
<cricket>
nobody in that chan responds though
<cricket>
nm
<cricket>
figured it
<cricket>
thnx anyway
<Demitar>
I wonder if the reason beagle is unbearably slow is that I have 450000 files in my homedir. :)
<Demitar>
Ah, WCE[1]. [1] Wrong Channel Error. :)
pango is now known as pangoafk
love-pingoo has joined #ocaml
pangoafk is now known as pango
dark_light has quit [Read error: 110 (Connection timed out)]
khaladan has joined #ocaml
_JusSx_ has joined #ocaml
Snark has joined #ocaml
Quinthius has joined #ocaml
ketty has joined #ocaml
<ketty>
anyone here on the lablgtk-list?
_JusSx_ has quit ["leaving"]
<lispy>
no, go away! ;)
<ketty>
:(
<ketty>
i can't seem to join, so i am looking for someone to forward a bug-report...
holo has joined #ocaml
<holo>
hi
<ketty>
hello ^^
<holo>
airo
<holo>
can i return two values like bla AND ble in s -> bla and ble?
<holo>
bla and ble are tokens
<ketty>
holo: you mean like "s -> bla * ble" or what am i missinterpreting?
<holo>
ketty, hmm
<holo>
a cartesian product?
<ketty>
no a pair ^^
<holo>
that is the type expression?
<holo>
i was saying the expression itself
<ketty>
hmm...
<holo>
so as you are saying it would be s -> bla , ble
<holo>
its not bad
<ketty>
the type of (1, 2) is int * int
<holo>
yep
<ketty>
mmm... yes, that enables you to return more than one value ^^
<holo>
oh
<holo>
that's what i want
<holo>
ketty, thanks for remind me of tuples
<holo>
hmm
<ketty>
you can do "s -> a * b * c" also ^^
<holo>
but that tuple is to be used in a syntatic analyser
<ketty>
mm?
<holo>
great!
<holo>
that way its always organized
<holo>
so i want INT, ".", IDENT or IDENT, ".", ident
<holo>
to be returned
<holo>
and then use it as argument
<holo>
*IDENT, ".", IDENT
<holo>
can one return a tuple of tokens when the other matches return tokens only?
<holo>
*matches of a "match with"
slipstream-- has joined #ocaml
slipstream has quit [Read error: 104 (Connection reset by peer)]
<ketty>
all matches has to return the same type...
<ketty>
if that was your question.. ^^
<holo>
yes that was the question, but then i have another
<ketty>
yes?
<holo>
can i return a token that is of type tuple?
<holo>
like type expr = token bla, foo , bar
<holo>
oops
<ketty>
i am not sure what you mean by token...
<holo>
wrong syntax
<holo>
type Expr = foo , bar , ble
<holo>
this
<holo>
and
<holo>
type token = Expr | foo | bar | ble
<holo>
no no no
<holo>
sorrp
<holo>
type token = Expr | foo | bar | ble
<holo>
Expr = foo , bar , ble
<holo>
this!
<ketty>
type token = Expr of (foo * bar * ble) | foo | bar | ble
<ketty>
like this?
<holo>
ketty, yest
<holo>
that was very sophisticated
<holo>
ketty, so Expr is of the same type as foo or bar or ble
<holo>
:D
<ketty>
holo: it depends on what types foo bar and ble have
<holo>
foo is of type token
<holo>
and bar and ble
<holo>
they all are of the same type
<holo>
ketty, thank you very much.. i must go back to my program
<ketty>
ok :)
<ketty>
just note that you cant do stuff like:
<ketty>
type token = Expr of (int * int) | int
<ketty>
you'd have to do "type token = Expr of (int * int) | Int of int"
<holo>
ha
<holo>
yes, i don't have terminal symbols in there
<holo>
great! back to work
<ketty>
good luck ^^
khaladan_ has joined #ocaml
khaladan has quit [Read error: 110 (Connection timed out)]
khaladan_ is now known as khaladan
khaladan_ has joined #ocaml
Bigbang is now known as Bigb[a]ng
<holo>
how is the for construct of caml?
<holo>
"for"
<ketty>
for i = 0 to 10 do print_int i;;
<ketty>
^^
<holo>
geez
<holo>
ok ok
<holo>
ketty, thanks
khaladan has quit [Read error: 110 (Connection timed out)]
khaladan_ is now known as khaladan
<dylan>
except, I believe it requires a 'done' somewhere, no?
<ketty>
ops.. yes that is required ^^'
<ketty>
it doesn't seem to be required in "the whitespace thing" thou :)
pauldia has quit [Read error: 110 (Connection timed out)]
love-pingoo has quit [Read error: 145 (Connection timed out)]
<ulfdoz>
Was _loc a special value some versions of ocaml ago? I just tried to compile ledit, but it raises "unknown identifier".
<ulfdoz>
"unbound value" of course.
<ulfdoz>
Wäh, this ocaml is old as debian.
<ketty>
hmm.. i think _loc is used in syntax extensions...
<ketty>
from the camlp4 tutorial: Between the release of OCaml 3.08.2 and 3.08.3, the default identifier for locations used in syntax extensions silently changed from loc to _loc . For compatibility reasons, pass the -loc _loc option (or -loc loc ) to camlp4o as we did in the Makefiles of this tutorial.
<ketty>
ulfdoz: could it be related to your problem?
<ulfdoz>
yes, looks like this one. unfortunately fink only 3.08.0. :( I'm currently upgrading manually.