dylan changed the topic of #ocaml to: OCaml 3.09.1 available! Archive of Caml Weekly News: http://sardes.inrialpes.fr/~aschmitt/cwn/ | A free book: http://cristal.inria.fr/~remy/cours/appsem/ | Mailing List: http://caml.inria.fr/bin/wilma/caml-list/ | Cookbook: http://pleac.sourceforge.net/
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?
<flux__> yes
<flux__> pango, "tryopen pattern"?
<flux__> hm, wasn't smerdyakov talking about writing this kind of library: http://merjis.com/developers/pgocaml ?
<flux__> (anyway, interesting - type-checked postgreSQL)
<flux__> but that apparently doesn't support really composing sql-queries
<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 :)
Snark has quit ["Leaving"]
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.
<ketty> hmm... have you looked at godi?
<ulfdoz> Not yet.
<ketty> it is very usefull...
<ketty> that way you wont have to do things manually :)
smimou has quit ["bli"]
<holo> what is the function for lenght of a string?
<pango> guess :)
<pango> String.length :)
<holo> can i have match i++ with?
<holo> pango, that is ocaml, i have suxor camllight
<holo> and worst.. i have to use it
<holo> sorry for these questions? i'm not used of using caml as with explicit iteration, only recursion
<holo> *questions,
<ketty> holo: what is "i++"?
smimou has joined #ocaml
<holo> ketty, for someone used to c like languages it increment
<holo> *is
<holo> ketty, how do i do that in caml?
<ketty> yes, but what is it doing in a match? ^^
<holo> ketty, it increments and matchs
<holo> :D
<holo> or can't i have like match nth_of_string(i++) with ?
<ketty> ehh.... but is there even something like i++ in caml?
<holo> hmm its worth a try
<ketty> but if you do:
<holo> no
<ketty> let inc i = i + 1
<ketty> then you can do:
<ketty> match inc i with
<holo> yeah
<holo> :s
AI_coder has joined #ocaml
<ketty> holo: by the way, how come you are using camllight?
<ketty> forced?
<holo> ketty, yeah
<holo> by school
shawn has joined #ocaml
<ketty> bleh.. ^^
<holo> howcome they want students to like functional programming if we use a play language
<ketty> yes it is very weird...
<ketty> but then again maybe it is because they dont want you to use the oo-features in ocaml...
<ketty> but they could just tell you not to
<ketty> and not give you grades if you do ^^
<holo> how do i inicialize a "variable" without evaluating it?
<sieni> holo: they really want you to use java or c#, so they show the worst they can imagine. (although they could have used emacs lisp)9
<holo> it's hard to believe, but i never needet it
<holo> sieni, lol
<ketty> holo: that is not really possible...
<ketty> not like in c
<holo> ketty, i'll adapt
<ketty> but you can use options instead
<sieni> holo: what do you mean by initializing a variable? In a functional programming language the variable is a name for the value
<holo> sieni, that's why i used ""
<holo> ;s
<holo> i need to use a loop
<holo> while
<ketty> hmm...
<ketty> does the school tell you to make loops?
<holo> ketty, no
<sieni> holo: well, you don't need to evaluate a variable, since you only want to evaluate expressions
<holo> they tell me, oh use your brains to create recursion
<sieni> if you want to mutate variables, you need to use references
<ketty> yes, you can allways do recursion instead of loops...
<holo> sieni, i must start the loop at some place, how do i define someplace?
<holo> ketty, in this situation i don't know how to do it
<holo> i want to get every nth_of_string
<ketty> it would be a good exercise for you :)
<holo> of a string
<holo> oops
<holo> nth_char
<holo> but its the same
<holo> #nth_char;;
<holo> - : string -> int -> char = <fun>
<sieni> holo: use recursion.
<holo> sieni, how do i define beginning of string?
<ketty> begining is at index 0...
<sieni> e.g. let rec foo x = if x = 0 then 1 else x * foo (x - 1)
<sieni> ;;
<holo> let rec foo 0 =
<holo> defined
<holo> :p
<holo> its all functional programming geeks here? i was seeing python, it is really simple to use, and even has some functional programming features
<holo> a little
<holo> like anonymous functions
<ketty> mmm... yes, i think python is nice...
<ketty> but i haven't really used it thou :)
<ketty> except for my SConstruct-file...
<ketty> so because i don't know python it probably looks horrible :)
<holo> ketty, take o look, the learning curve is very fast
<holo> it has object oriented model
<holo> has some nice methods to use with lists
<holo> lists can have differente types
<holo> you can even sort a list with different types
<holo> it has dictionaries
<holo> yet another usefull construct :D
<ketty> except for mixed list ocaml has all that :)
<holo> you can use lists as if they were arrays
<holo> one thing i really like is that a caracter is a particular case of string
<holo> so there isn't char type
<holo> there isn't code delimiters
<holo> identation makes that
<ketty> yes i like that :)
<ketty> makes me type less :)
<holo> so if the program isn't legible there are great chances that it won't work
<holo> and less cluttering too
<ketty> python is definitely on my list of languages i want to learn...
<ketty> but that list is pritty long thou :)
holo has quit [Read error: 104 (Connection reset by peer)]
joshcryer has joined #ocaml
Quinthius has quit ["Leaving"]
Quinthius has joined #ocaml
Quinthius has quit [Client Quit]
Quinthius has joined #ocaml
smimou has quit ["bli"]
<ulfdoz> thx, ketty. Godi is nice.
<ketty> ulfdoz: indeed it is :)
<ketty> now if it could integrate with the debian package system and automaticaly install needed non-ocaml dependencies.... ^^
<ulfdoz> That would be perfect. Unfortunately fink seems to suffer from debian's package update intervals.
<ketty> hmm... is fink based on debian stable?
<ulfdoz> at least on apt. Dunno how close they are to debian itself. But I'm quite sure, that many package are simply copied with small modifications.
<ketty> i use debian unstable and love it :)
holo has joined #ocaml
<holo> hi
<ketty> hello :)
<holo> how do i concatenate a char with a char?
<holo> like ^?
<ketty> hmm...
<holo> of course it would make a string
<ketty> i usualy do a to_string function
<holo> hmm string_of_char
<holo> yeah
<ketty> yes...