<thelema>
hmm, the oldest dates on these files are from Feb 2004, but I know the project is much older than that.
* thelema
loves the type we ended up with:
<thelema>
val parse :
<thelema>
keywords:(switch * spec list * (spec * (unit -> unit)) list *string) list ->
<thelema>
others:(string -> unit) ->
<thelema>
usage:string ->
<thelema>
descr:string ->
<thelema>
notes:string ->
<thelema>
unit
<thelema>
no mainstream language even comes close to (switch * spec list * (spec * (unit -> unit)) list * string ) list
<thelema>
I'll admit that gnuarg has a nice usage creator...
<thelema>
but ours wins
<thelema>
example usage in testgraph.ml
<alexyk>
thelema: awesome! going to clone...
<thelema>
I'm glad you enjoy the code. I've not touched it in years, and would probably find tons of things needing rewriting.
<alexyk>
so is it s graph library?
<thelema>
only bipartite graphs, I'm afraid.
<thelema>
that was all I needed.
<alexyk>
yeah -- I am learning how to use ocamlgraph now
<thelema>
I looked into that once, but had already written my own library, so...
Demitar has quit [Read error: 110 (Connection timed out)]
<thelema>
I tried a bunch of implementations, and spent way too much time functorizing everything.
<thelema>
otoh, I learned a bunch about functors that way.
seafood has quit [Read error: 60 (Operation timed out)]
alexyk has quit []
seafood has joined #ocaml
<kaustuv>
I've finally come across a non-trivial use case for private type abbreviations: http://pastebin.com/d7a7010aa
seafood has quit [Read error: 104 (Connection reset by peer)]
seafood has joined #ocaml
<thelema>
kaustuv: sometime you'll have to explain the big deal with that code. It seems to just look up old values by hashtbl. Maybe a blog post - I sleep now. bye
petchema_ has joined #ocaml
petchema has quit [Read error: 110 (Connection timed out)]
infoe|wk has quit [Read error: 110 (Connection timed out)]
kaustuv_ has joined #ocaml
kaustuv has quit [Read error: 104 (Connection reset by peer)]
Yoric[DT] has joined #ocaml
Camarade_Tux has joined #ocaml
wsmith84 has quit [Read error: 110 (Connection timed out)]
chicco has quit [Read error: 111 (Connection refused)]
m3ga has quit ["disappearing into the sunset"]
seafood has quit [Read error: 104 (Connection reset by peer)]
seafood has joined #ocaml
kaustuv_ is now known as kaustuv
seafood_ has joined #ocaml
|jedai| has quit [Read error: 110 (Connection timed out)]
|jedai| has joined #ocaml
seafood has quit [Read error: 110 (Connection timed out)]
Yoric[DT] has quit ["Ex-Chat"]
Alpounet has joined #ocaml
ttamttam has joined #ocaml
s4tan has joined #ocaml
filp has joined #ocaml
ilor_ has joined #ocaml
OChameau has joined #ocaml
ilor has quit [Read error: 110 (Connection timed out)]
_zack has joined #ocaml
angerman has quit [Read error: 110 (Connection timed out)]
hkBst has joined #ocaml
ilor_ has quit [Read error: 113 (No route to host)]
det has quit [Read error: 110 (Connection timed out)]
Yoric[DT] has joined #ocaml
seafood_ has quit []
seafood has joined #ocaml
angerman has joined #ocaml
jlouis has joined #ocaml
angerman has quit [Client Quit]
jlouis__ has joined #ocaml
jlouis has quit [Read error: 104 (Connection reset by peer)]
Stefan_vK1 has joined #ocaml
hkBst has quit [Read error: 104 (Connection reset by peer)]
Yoric[DT] has quit ["Ex-Chat"]
Stefan_vK has quit [Read error: 110 (Connection timed out)]
peper has quit [Read error: 60 (Operation timed out)]
jlouis__ has quit [Read error: 60 (Operation timed out)]
angerman has joined #ocaml
sporkmonger has joined #ocaml
angerman has quit [Client Quit]
seafood has quit []
infoe|wk has joined #ocaml
hcarty_ is now known as hcarty
<thelema>
yor: global_replace didn't come through right on your side?
<thelema>
drat, gone.
Alpounet has quit [Read error: 110 (Connection timed out)]
angerman has joined #ocaml
filp has quit ["Bye"]
Alpounet has joined #ocaml
Waleee has joined #ocaml
jlouis has joined #ocaml
NYnix has joined #ocaml
NYnix has quit [Client Quit]
wsmith84 has joined #ocaml
<hcarty>
thelema: Could you look at the Bigarray patch I submitted for Batteries?
det has joined #ocaml
love-pingoo has joined #ocaml
willb has quit [Read error: 110 (Connection timed out)]
slash_ has joined #ocaml
det has quit [Read error: 104 (Connection reset by peer)]
det_ has joined #ocaml
jlouis has quit [Remote closed the connection]
jlouis has joined #ocaml
gim has quit [Remote closed the connection]
th5 has joined #ocaml
gim has joined #ocaml
wsmith84 has quit [Read error: 110 (Connection timed out)]
Walee has joined #ocaml
alexyk has joined #ocaml
jlouis has quit [Connection timed out]
Waleee has quit [Read error: 110 (Connection timed out)]
Walee has quit [Read error: 104 (Connection reset by peer)]
orionr has joined #ocaml
<orionr>
Hello. I'm having a problem with a function. I'm getting the error This expression is not a function, it cannot be applied. Would anyone mind taking a look?
<mrvn>
orionr: "%s" is not a function, you can not apply the argument (List.hd(Z)) to it.
<mrvn>
orionr: you don't write f(x,y,z), just f x y z in ocaml.
<Waleee>
that's completly optional, if there haven't been some fundamental changes to ocaml since 3.10 (haven't tried 3.11 yet) ... you just have to remember that if you use f(x,..,z) in the decleration you have to use it in the function calls
<mrvn>
Waleee: not optional at all. f (x,y,z) calls f with one argument, the triple (x,y,z).
<mrvn>
f x y z is 3 arguments x, y and z.
Camarade_Tux has quit ["Leaving"]
<orionr>
mrvn: why doesn't Printf.printf("%s" "hello world"); work? Thats pretty much the same reason why I'm having this problem.
<mrvn>
orionr: because ("%s" "hello world") means passing the argument "hello world" to the function "%s" and that is not one.
<mrvn>
Loose the () and it works
th5 has quit []
funebre has joined #ocaml
robocop has joined #ocaml
<robocop>
hello.
<robocop>
when i "read" my code with : "ocaml nums.cma code.ml"; how I can compile it with ocamlopt ?
<mrvn>
Prime directives: Protect the innocent. Uphoald the law. Write more ocaml programs.
<robocop>
"/usr/bin/ocamlopt: don't know what to do with types.cmo."
<mrvn>
and you did use the cmxa?
<robocop>
I create types.cmo with : "ocamlc -c types.ml"
<robocop>
I have got file cmxa
<mrvn>
you can not mix bytecode and binary
<mrvn>
ocamlopt -c types.ml gives you types.cmx
<robocop>
Ho, okey
<robocop>
thanks, i'm going to test.
Waleee has quit [Read error: 145 (Connection timed out)]
<orionr>
mrvn: what does Exception: Failure "tl". generally mean?
angerman has quit []
Waleee has joined #ocaml
<orionr>
If i run List.tl on an empty list?
<mrvn>
orionr: that the list was too short
<mrvn>
An empty list has no tail
<orionr>
If i did that on an empty list that would cause that to occur?
<mrvn>
the _ -> raise (Failure "tl")
<mrvn>
You know what exceptions are, right=
<mrvn>
?
s4tan has quit []
<orionr>
Not really lol. Errors?
<orionr>
like it threw an exception.
<mrvn>
not 100% but usualy.
slash_ has quit ["leaving"]
<mrvn>
If you do something wrong with the standard lib it will raise an exception.
<orionr>
I'm trying to go through a list and print each element.
<totom>
use List.iter
<mrvn>
don't use hd/tl for that. Use pattern matching.
<mrvn>
let loop list = match list with [] -> () (* all done *) | x::xs -> Printf.printf "%s " x; loop xs
<orionr>
totom: I would but this program has to be done completely recursively lol
<mrvn>
List.iter is tail recursive
<mrvn>
let loop = function [] -> () (* all done *) | x::xs -> Printf.printf "%s " x; loop xs
<mrvn>
let loop = List.iter (Printf.printf "%s ")
<mrvn>
(to give3 forms of the same thing)
<orionr>
we can't use loops. It have to be completely recursive. but i guess i could have List.iter being called recursivly
<mrvn>
orionr: loop is just a name. It is called recursive
<mrvn>
let print_string_list = List.iter (Printf.printf "%s ")
<mrvn>
oh, s/let/let rec/ abov. sorry.
<robocop>
And, if I've got a function in types.ml; to use the function with code.ml, how i can do with ocamlopt ?
<mrvn>
Types.foo
<robocop>
what ?
<mrvn>
if you want it nice: let print_string_list list = List.fold_left (fun sep x -> Printf.printf "%s\"%s\"" sep x; "; ") "[" list; Printf.printf "]"
<mrvn>
robocop: To use function foo from types.ml use Types.foo
<hcarty>
Not at all a problem. They have been here as well.
<hcarty>
Thank you for taking the time to look at it
<Yoric[DT]>
I'll try and review this this evening.
<Yoric[DT]>
Thanks for writing it.
<hcarty>
I am happy to do so
<Yoric[DT]>
Well, time to go and eat something, though.
<Yoric[DT]>
Talk to you later.
wsmith84 has joined #ocaml
Amorphous has joined #ocaml
Stefan_vK1 has quit [Read error: 110 (Connection timed out)]
ttamttam has joined #ocaml
ttamttam has quit [Read error: 104 (Connection reset by peer)]
ttamttam has joined #ocaml
<hcarty>
Yoric[DT]: Enjoy your meal
robocop has joined #ocaml
<robocop>
re
<robocop>
Do you know if thre is a implementation of ocaml for mathematic ?
<robocop>
Whithout type int and float but with a type "num" for exemple
wsmith84 has quit [Read error: 113 (No route to host)]
<Yoric[DT]>
robocop: er, probably yes, depends on what you mean.
<robocop>
infiny arythmetic precision ?
<robocop>
*arithmetic
<Yoric[DT]>
Infinite is not possible.
<Yoric[DT]>
Arbitrary is possible, though.
<robocop>
yes
<robocop>
sorry :)
<Yoric[DT]>
So, yes, there's at least one library.
<Yoric[DT]>
At the moment, I can't remember the name but I've used it once.
<robocop>
module nums ?
ppsmimou has quit [Read error: 110 (Connection timed out)]
<Yoric[DT]>
No, it's not part of the standard distribution.
<robocop>
yes.
Walee has quit []
<love-pingoo>
Bignum
<love-pingoo>
Big_int
<love-pingoo>
you'd need to define your own syntactic sugar, but if you use only big_ints (and don't mix with int and float) it should be fairly simple
<love-pingoo>
oh, I see Nat also (arbitrary positive integers)
itewsh has quit [Remote closed the connection]
<Yoric[DT]>
Nah, it's something else.
<Yoric[DT]>
Sorry, can't remember the name for the moment.
<Yoric[DT]>
Maybe libmp, or something such.
<love-pingoo>
what's wrong with big_num?
itewsh has joined #ocaml
jft has joined #ocaml
<jft>
hi
<jft>
can anyone help me with an error i am receiving?
<jft>
i have a comparison expression that will not return an int, but i want it to return an int
<jft>
if(5>3) then (5+1);;
<totom>
you have to put an "else"
<jft>
This expression has type int but is here used with type unit
<totom>
if 5<3 (even if that won't happen) you happen to return unit since you don't have a else clause
<totom>
so your "then" and your "else" don't return the same type
<totom>
you have to unify them
<jft>
ok, i will try that, thank you
robocop has quit ["Leaving."]
<jft>
ok, thank you that worked, i was testing a bigger function that had that statement in it
Demitar has joined #ocaml
<mrvn>
jft: think of it as "if" having an implicit "else ()"
seafood has joined #ocaml
sporkmonger has quit []
ilor has joined #ocaml
Snark has quit ["Ex-Chat"]
wsmith84 has joined #ocaml
seafood has quit [Connection timed out]
<gildor>
ertai_: I have some question (and proposal for ocamlbuild on windows)
<gildor>
ertai_: Is this normal that it is so slow (or do you have an idea how to speed up things)
sporkmonger has joined #ocaml
ttamttam has left #ocaml []
prime2 has quit ["leaving"]
sitaktif has quit [Read error: 104 (Connection reset by peer)]
hkBst has joined #ocaml
sitaktif has joined #ocaml
sporkmonger has quit []
love-pingoo has quit ["Connection reset by pear"]
Alpounet has quit ["Ex-Chat"]
anryx has joined #ocaml
<wsmith84>
Has anybody here had a look at F#?
<wsmith84>
How does it compare to OCaml?
<wsmith84>
thelema: How do you find F#'s libraries compared to what you want to build with Batteries?