gildor changed the topic of #ocaml to: Discussions about the OCaml programming language | http://caml.inria.fr/ | OCaml 3.12.0 http://bit.ly/aNZBUp
alexyk has quit [Ping timeout: 240 seconds]
Associ8or has joined #ocaml
Associat0r has quit [Ping timeout: 255 seconds]
alexyk has joined #ocaml
alexyk has quit [Ping timeout: 255 seconds]
Associat0r has joined #ocaml
Associ8or has quit [Ping timeout: 240 seconds]
rgee has quit [Ping timeout: 264 seconds]
<EM03> i think many langs that have type systems people do tests
alexyk has joined #ocaml
<thelema_> EM03: for batteries, we have a testing system, not that it really does much, since old code doesn't get rewritten a lot, but it makes sure we've covered a lot of cases.
lopex has quit []
<EM03> thelema_: you a dev of that?
<thelema_> yes
barismetin has joined #ocaml
barismetin has quit [Changing host]
barismetin has joined #ocaml
barismetin has quit [Remote host closed the connection]
nannto_ has joined #ocaml
philtor has joined #ocaml
boscop_ has joined #ocaml
boscop has quit [Ping timeout: 255 seconds]
dcolish has quit [Ping timeout: 260 seconds]
dcolish has joined #ocaml
alexyk has quit [Quit: alexyk]
dcolish has quit [Quit: Coyote finally caught me]
tommd has quit [Remote host closed the connection]
rgee has joined #ocaml
lamawithonel has quit [Ping timeout: 255 seconds]
nannto_ has quit [Quit: Leaving...]
vivanov has joined #ocaml
ulfdoz has joined #ocaml
lamawithonel has joined #ocaml
dnolen has joined #ocaml
dnolen has quit [Quit: dnolen]
dcolish has joined #ocaml
joewilliams is now known as joewilliams_away
sgnb has quit [Read error: Connection reset by peer]
joewilliams_away is now known as joewilliams
mal`` has quit [Quit: ERC Version 5.3 (IRC client for Emacs)]
ulfdoz has quit [Ping timeout: 250 seconds]
othiym23 has quit [Ping timeout: 255 seconds]
mal`` has joined #ocaml
sgnb has joined #ocaml
axiles has joined #ocaml
othiym23 has joined #ocaml
alexyk has joined #ocaml
Modius_ has quit [Read error: Connection reset by peer]
Modius_ has joined #ocaml
alexyk has quit [Client Quit]
ikaros has joined #ocaml
Associat0r has quit [Read error: Connection reset by peer]
ygrek has joined #ocaml
Associat0r has joined #ocaml
eye-scuzzy has joined #ocaml
ygrek has quit [Ping timeout: 250 seconds]
Modius has joined #ocaml
Modius_ has quit [Ping timeout: 252 seconds]
Cyanure has joined #ocaml
othiym23 has quit [Quit: Linkinus - http://linkinus.com]
edwin has joined #ocaml
joewilliams is now known as joewilliams_away
mcclurmc_home has joined #ocaml
Associat0r has quit [Quit: Associat0r]
Cyanure has quit [Remote host closed the connection]
Associat0r has joined #ocaml
nannto_ has joined #ocaml
thomasga has joined #ocaml
<krktz> thelema_: that librt? http://freshmeat.net/projects/librt/
rgee has quit [Read error: Connection reset by peer]
rgee has joined #ocaml
Cyanure has joined #ocaml
ankit9|zzz has quit [Quit: Leaving]
<krktz> it looks like those functions also are in glibc...
Tommytom has joined #ocaml
ikaros has quit [Quit: Ex-Chat]
philtor has quit [Ping timeout: 276 seconds]
explodus has quit [Read error: No route to host]
Pepe__ has joined #ocaml
explodus has joined #ocaml
enthymeme has quit [Quit: rcirc on GNU Emacs 23.3.1]
ftrvxmtrx has quit [Quit: This computer has gone to sleep]
alfa_y_omega has quit [*.net *.split]
micro has quit [*.net *.split]
milosn has quit [*.net *.split]
caligula_ has quit [*.net *.split]
wagle has quit [*.net *.split]
Pepe_ has quit [*.net *.split]
alfa_y_omega has joined #ocaml
micro has joined #ocaml
milosn has joined #ocaml
caligula_ has joined #ocaml
wagle has joined #ocaml
alfa_y_omega has quit [*.net *.split]
micro has quit [*.net *.split]
milosn has quit [*.net *.split]
caligula_ has quit [*.net *.split]
wagle has quit [*.net *.split]
ankit9 has joined #ocaml
alfa_y_omega has joined #ocaml
micro has joined #ocaml
milosn has joined #ocaml
caligula_ has joined #ocaml
wagle has joined #ocaml
Associat0r has quit [Quit: Associat0r]
munga has joined #ocaml
Tommytom has quit [Remote host closed the connection]
schmrkc has quit [Ping timeout: 250 seconds]
schmrkc has joined #ocaml
Tommytom has joined #ocaml
ftrvxmtrx has joined #ocaml
rgrinberg_ has joined #ocaml
rgee has quit [Ping timeout: 240 seconds]
rgrinberg_ has quit [Ping timeout: 244 seconds]
lopex has joined #ocaml
lopex has quit [Ping timeout: 246 seconds]
lopex has joined #ocaml
rby has quit [Quit: Lost terminal]
lopex has quit []
_andre has joined #ocaml
avsm has quit [Quit: Leaving.]
Cyanure has quit [Remote host closed the connection]
gnuvince|work has joined #ocaml
lamawithonel has quit [Read error: Connection reset by peer]
<edwin> you need -lrt
<edwin> to get them
ankit9 has quit [Remote host closed the connection]
ankit9 has joined #ocaml
<munga> hello. I'm trying to build bindings for rpm5 with the following options : ocamlc.opt -verbose -ccopt -I/usr/include/rpm -ccopt -DRPM5 -c rpm/librpm_stubs.c
<munga> that in turns calls gcc as : gcc -fno-defer-pop -Wall -D_FILE_OFFSET_BITS=64 -D_REENTRANT -O2 -g -frecord-gcc-switches -Wstrict-aliasing=2 -pipe -Wformat -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fstack-protector --param=ssp-buffer-size=4 -fPIC -fPIC -c -I/usr/include/rpm -DRPM5 -I'/usr/lib64/ocaml' 'rpm/librpm_stubs.c'
<munga> my problem is : how to I get rid of -D_FILE_OFFSET_BITS=64 (or in general how can I customize the call to gcc ?)
boscop_ is now known as boscop
<flux> put #undef _FILE_OFFSET_BITS on top of librpm_stubs.c?-)
<flux> but in general, I don't know
lamawithonel has joined #ocaml
<flux> also I'm uncertain why you would want to get rid of that..
<munga> flux, good workaround . because I'm using a header that does like this option ... /usr/include/fts.h
<flux> fun, I don't even know what its functions do
<flux> learn something new every day.
<flux> but, off to home ->
<munga> thx !
<f[x]> caml runtime was built with this option
<f[x]> so I guess in order to maintain some API compatibility all C files should be built with same options
<f[x]> but maybe that doesn't influence your code
avsm has joined #ocaml
rby has joined #ocaml
avsm has quit [Quit: Leaving.]
avsm has joined #ocaml
rgrinberg_ has joined #ocaml
thomasga has quit [Quit: Leaving.]
Tommytom has quit [Remote host closed the connection]
thomasga has joined #ocaml
Cyanure has joined #ocaml
ankit9 has quit [Quit: Leaving]
joewilliams_away is now known as joewilliams
alfa_y_omega has quit [Read error: Operation timed out]
alfa_y_omega has joined #ocaml
rgrinberg_ has quit [Ping timeout: 240 seconds]
dnolen has joined #ocaml
barismetin has joined #ocaml
ulfdoz has joined #ocaml
ikaros has joined #ocaml
philtor has joined #ocaml
ulfdoz has quit [Ping timeout: 260 seconds]
ulfdoz has joined #ocaml
ankit9 has joined #ocaml
SoftTimur has joined #ocaml
<SoftTimur> hello all, I have seen something like this:
<SoftTimur> module IntOrd =
<SoftTimur> struct type t = int
<SoftTimur> let compare = ( - ) end
<SoftTimur> could anyone tell me what "let compare = ( - )" mean here?
<thelema_> it says that to compare integers, just subtract them
<thelema_> this isn't correct, but it works for small integers
<thelema_> (-) is the function to subtract two integers
<SoftTimur> I see, thank you very much
ikaros has quit [Quit: Ex-Chat]
f[x] has quit [Quit: Leaving]
Tommytom has joined #ocaml
philtor has quit [*.net *.split]
micro has quit [*.net *.split]
milosn has quit [*.net *.split]
caligula_ has quit [*.net *.split]
wagle has quit [*.net *.split]
philtor has joined #ocaml
micro has joined #ocaml
milosn has joined #ocaml
caligula_ has joined #ocaml
wagle has joined #ocaml
ftrvxmtrx has quit [Quit: This computer has gone to sleep]
philtor has quit [*.net *.split]
micro has quit [*.net *.split]
milosn has quit [*.net *.split]
caligula_ has quit [*.net *.split]
wagle has quit [*.net *.split]
philtor has joined #ocaml
micro has joined #ocaml
milosn has joined #ocaml
caligula_ has joined #ocaml
wagle has joined #ocaml
Tommytom has left #ocaml []
Pepe__ is now known as Pepe_
ftrvxmtrx has joined #ocaml
ftrvxmtrx has quit [Client Quit]
avsm has quit [Quit: Leaving.]
boscop_ has joined #ocaml
boscop has quit [Ping timeout: 255 seconds]
ftrvxmtrx has joined #ocaml
milosn has quit [Remote host closed the connection]
milosn has joined #ocaml
Xaseron has quit [Ping timeout: 252 seconds]
Xaseron has joined #ocaml
joewilliams is now known as joewilliams_away
alpounet has quit [Ping timeout: 260 seconds]
joewilliams_away is now known as joewilliams
alpounet has joined #ocaml
Associat0r has joined #ocaml
SoftTimur has left #ocaml []
ygrek has joined #ocaml
boscop_ is now known as boscop
barismetin has quit [Remote host closed the connection]
gnuvince|work has quit [Quit: eod]
axiles has quit [Remote host closed the connection]
thomasga has quit [Quit: Leaving.]
<EM03> - : string -> int = <fun> what does the fun mean?
<EM03> just the return?
<thelema_> it means its' function and can't just be printed
<thelema_> it's a function
<EM03> ah I get it
<EM03> is there a name for things that can be printed?
<thelema_> no
<EM03> thelema_: I see
vivanov has quit [Ping timeout: 240 seconds]
<EM03> thelema_: there is usually some language terminology for that kind of stuff
<gildor> anonymous function
<thelema_> even named functions give <fun> at the toplevel, and there's other things that can't be printed like abstract and custom values
<EM03> how can I get the type of a given value?
<thelema_> at the toplevel, just look at the beginning of what's printed. within emacs, compile with -annot and use C-c C-t (and something similar for vi). Otherwise not so much.
<thelema_> ocaml erases types at compile time, which means with few exceptions, the runtime doesn't know what type things are.
<_andre> \t for vim
<EM03> ah
<EM03> just thought there might be like type "dsfsdf" and return string or something
<thelema_> nope.
<thelema_> ocaml's support for reflection is very slim.
<thelema_> If you want to dispatch on the type of something, use a variant to tag the values and match on the variant
rgrinberg_ has joined #ocaml
<thelema_> type v = String of string | Int of int | Float of float | ...
<thelema_> let do_stuff = function String s -> do_stuff_string s | ...
rgrinberg_ has quit [Client Quit]
rgee has joined #ocaml
<EM03> thelema_: yea, crazy there is no way at least at the top level to not try and give the type of something though isn't it ?
<thelema_> the toplevel cheats and integrates with the compiler tightly so it knows the types of things and can print things properly.
<thelema_> afaik, there's still no hooks for to get the types from the toplevel.
<EM03> ah
<EM03> makes sense
ygrek has quit [Ping timeout: 250 seconds]
<EM03> how does ocaml know what to infer for the returned type of a function?
<Lor> You want to know how type inference works?
<thelema_> [let f x = 3] is obvious, as 3 is an int.
<thelema_> [let f x = x+3] is still obvious, as the return type of + is int
<thelema_> there's more strategies like this for all other cases.
<EM03> =
<EM03> (a +. b) /. 2.0;;
<EM03> val average : float -> float -> float = <fun>
<EM03> er
<EM03> let average a b =
<EM03> how does it know its going to return a float?
<thelema_> because /. returns a float
<EM03> yes but is there any point in time where it does not know what it will be?
<Lor> Not in this case.
<EM03> in any case
<Lor> In some other languages arithmetic operators might be polymorphic.
<thelema_> ? before it parses your program...
<EM03> before it runs
<EM03> i guess thats stupid to think nevermind
<EM03> if it does not know the type of the return of the function then it wouldn't be statically typed
lamawithonel has quit [Read error: Connection reset by peer]
<Lor> let f a = a (a 1)
<thelema_> well, interesting things happen with polymorphic types.
<EM03> i haven't got that deep yet
<thelema_> no problem. can you figure out the type of lor's f?
<Lor> the inferer finds out that the domain of a is int, then it unifies the domain and codomain of a
<EM03> i've been using scheme for a while so type systems right now is not a strong point :P
Plazma has joined #ocaml
_andre has quit [Quit: leaving]
edwin has quit [Remote host closed the connection]
lamawithonel has joined #ocaml
Cyanure has quit [Remote host closed the connection]
<EM03> anyone here used ocamlnet2 and netcgi to create a fcgi powered app?
<EM03> this library has no docs and its a bit hard to see how much of an abstraction they added
<EM03> ok found the docs hehe
avsm has joined #ocaml
lopex has joined #ocaml
barismetin has joined #ocaml
barismetin has quit [Remote host closed the connection]
Morphous_ has quit [Ping timeout: 255 seconds]
<EM03> what other languages besides haskell provide pattern matching like ocaml, i think its called tree matching?
Morphous_ has joined #ocaml
munga has quit [Ping timeout: 246 seconds]