gildor changed the topic of #ocaml to: Discussions about the OCaml programming language | http://caml.inria.fr/ | OCaml 3.12.1 http://bit.ly/nNVIVH
lamawithonel_ has quit [Ping timeout: 255 seconds]
sebz has joined #ocaml
ulfdoz_ has joined #ocaml
ulfdoz has quit [Ping timeout: 240 seconds]
ulfdoz_ is now known as ulfdoz
lopex has quit []
sebz has quit [Quit: Computer has gone to sleep.]
betta_y_omega has quit [Ping timeout: 258 seconds]
betta_y_omega has joined #ocaml
sebz has joined #ocaml
sebz has quit [Quit: Computer has gone to sleep.]
dnolen has joined #ocaml
Associat0r has joined #ocaml
chrissbx has quit [Read error: Operation timed out]
arubin has quit [Quit: arubin]
Anarchos has quit [Ping timeout: 255 seconds]
sebz has joined #ocaml
Associat0r has quit [Quit: Associat0r]
chrissbx has joined #ocaml
StepanKuzmin has joined #ocaml
ygrek has joined #ocaml
srcerer_ is now known as srcerer
dnolen has quit [Quit: dnolen]
betta_y_omega has quit [Read error: Operation timed out]
betta_y_omega has joined #ocaml
mcclurmc has joined #ocaml
sebz has quit [Quit: Computer has gone to sleep.]
mcclurmc has quit [Client Quit]
mcclurmc has joined #ocaml
mcclurmc has quit [Quit: ZNC - http://znc.in]
mcclurmc has joined #ocaml
lpereira has joined #ocaml
betta_y_omega has quit [Read error: Operation timed out]
mcclurmc has quit [Remote host closed the connection]
betta_y_omega has joined #ocaml
sebz has joined #ocaml
junsuijin has quit [Quit: Leaving.]
quackv2 has joined #ocaml
edwin has joined #ocaml
mcclurmc has joined #ocaml
mcclurmc has quit [Client Quit]
mcclurmc has joined #ocaml
ankit9 has joined #ocaml
ftrvxmtrx has joined #ocaml
Amorphous has quit [Ping timeout: 240 seconds]
Amorphous has joined #ocaml
sebz has quit [Quit: Computer has gone to sleep.]
Anarchos has joined #ocaml
lopex has joined #ocaml
ftrvxmtrx has quit [Read error: Connection reset by peer]
ftrvxmtrx has joined #ocaml
mcclurmc has quit [Ping timeout: 255 seconds]
mcclurmc- has joined #ocaml
BiDOrD_ has quit [Ping timeout: 250 seconds]
BiDOrD has joined #ocaml
Ptival has quit [Quit: Quat]
mcclurmc- has quit [Quit: ZNC - http://znc.in]
mcclurmc has joined #ocaml
mcclurmc has quit [Quit: ZNC - http://znc.in]
Anarchos has quit [Ping timeout: 250 seconds]
Anarchos has joined #ocaml
Ptival has joined #ocaml
lopex has quit []
hcarty has joined #ocaml
<adrien> ygrek: oh, thanks a lot for the poor man's allocation profiler :-)
<hcarty> Informal API opinion poll: Given a function with lots of optional configuration options, is it better to have a large number of optional parameters or one (or a few) lists of configuration options?
<hcarty> For example: foo ?color ?length ?width vs foo [`color `red; `length 1; `width 2]
<adrien> hcarty: do you want to be able to copy the parameters? like storing them on disk and loading them, or using it in several places?
<Anarchos> hcarty i had this problem and i prefer passing lots of optional options with named parameters
<Anarchos> hcarty cause grouping them in a list is not logical most of the time
<hcarty> adrien: Probably not - they are more likely to be specified directly in the code
<adrien> hcarty: I prefer optional arguments then
<hcarty> Anarchos: That's a good point. Lots of optional parameters also make the available categories of options a bit more discoverable
<hcarty> Thank you both!
<hcarty> This is for the OCaml more OCaml-y, higher level bindings for PLplot's legend and colorbar functions
<adrien> I might have been influenced by lablgtk too ;-)
<hcarty> Each has 20+ arguments in the C API, so I'm trying to consolidate and provide sane defaults where possible.
<hcarty> adrien: Now... is that a good or a bad thing? :-)
<adrien> hcarty: as long as your arguments fit on two lines or less usually... :P
<adrien> hcarty: otoh, if you have sane defaults unlike gtk, it's going to be easier and shorter
<adrien> (~hpolicy:`AUTOMATIC ~vpolicy:̀€AUTOMATIC)
<adrien> dead keys + network lag = bad
<hcarty> My hope is that most cases will require 1 - 3 arguments, with more available when further customization is wanted
dnolen has joined #ocaml
ftrvxmtrx has quit [Read error: Connection reset by peer]
ftrvxmtrx has joined #ocaml
The_third_man has quit [Ping timeout: 264 seconds]
The_third_man has joined #ocaml
The_third_bug has joined #ocaml
The_third_man has quit [Disconnected by services]
The_third_bug has quit [Client Quit]
iratsu has quit [Ping timeout: 255 seconds]
The_third_man has joined #ocaml
ftrvxmtrx has quit [Quit: Leaving]
iratsu has joined #ocaml
<ygrek> adrien, you are welcome
Anarchos has quit [Quit: Vision[0.9.7-H-090423]: i've been blurred!]
vext01_ has quit [Quit: brb]
iratsu has quit [Ping timeout: 255 seconds]
iratsu has joined #ocaml
sepp2k has joined #ocaml
sepp2k has quit [Client Quit]
yezariaely has joined #ocaml
yezariaely has left #ocaml []
avsm has joined #ocaml
dnolen has quit [Quit: dnolen]
dnolen has joined #ocaml
sebz has joined #ocaml
* NaCl wonders why Str is so... limited
<flux> nacl, well, I guess maybe implementing Coq doesn't need more than that :)
* NaCl grumbles
<flux> but seriously, avoid Str, if you ever think of using the same code in threaded environment.. it will die, even if the interface you use looks like it would be thread safe. it isn't.
<flux> personally I think Str-module should fail to link with threads.
<NaCl> personally, I think that Pcre should be in the standard library. xD
<flux> nacl, yes, batteries + pcre should be enough for all practical uses :)
* NaCl was fiddling with the Facebook puzzle thing
<flux> btw, assembly is finished, videos of demos are out ;)
<NaCl> the bot is down, but wonderfully, the blasted thing doesn't tell me what I can and cannot use
<NaCl> unless scanf can match something like "string\s+number"
<NaCl> where \s+ is any number of spaces or tabs
<flux> I think it does that be default with just maybe %[^ ]s %d ?
<NaCl> hmmm
<NaCl> flux: "%s%[ \t]%d" did it
* NaCl apparently can't use input_line and fscanf at the same time
* NaCl just uses read_line and sscanf
<NaCl> *input_line
eb4890 has joined #ocaml
lopex has joined #ocaml
sebz has quit []
sebz has joined #ocaml
<NaCl> A space does not match a single space character, but any amount of ``whitespace'' in the input.
<NaCl> FFFFFFFFFFFFFFFFFFFFFFF
sebz has quit [Quit: Computer has gone to sleep.]
<flux> yeah, documentation is for wussies :)
* NaCl sucks at programming puzzles
ygrek has quit [Ping timeout: 250 seconds]
zorun has quit [Quit: leaving]
alpounet has quit [Ping timeout: 255 seconds]
alpounet has joined #ocaml
zorun has joined #ocaml
chrissbx has quit [Ping timeout: 240 seconds]
chrissbx has joined #ocaml
junsuijin has joined #ocaml
junsuijin has quit [Client Quit]
drake01 has joined #ocaml
junsuijin has joined #ocaml
Obfuscate has quit [Read error: Connection reset by peer]
Obfuscate has joined #ocaml
edwin has quit [Remote host closed the connection]
lopexx has joined #ocaml
lopex has quit [Ping timeout: 240 seconds]
lpereira has quit [Quit: Leaving.]
lopexx has quit []
lopex has joined #ocaml
flapjackery has joined #ocaml
<flapjackery> could someone explain how this derivative function works? I'm learning via the ocaml book by Hickey
<flapjackery> let deriv f = (fun x -> (f (x +. dx) -. f x) /. dx);;
* NaCl wonders hy universities can't make their DNS less capitalized
<zorun> 'deriv' is a high-order function (that it, it takes a function 'f' as argument)
<NaCl> dx is probably defined somewhere else
<zorun> and the result of a call (like 'deriv sin') is itself a function (because of the 'fun x -> ...')
<zorun> beyond that, it shouldn't be very hard to understand
<flapjackery> what should the 'x' after fun represent?
<NaCl> f(X)
<NaCl> independent variable of function "f"
<zorun> not really of function f ;)
* NaCl didn't like Hickey's book too much
<zorun> it's the argument (or "independent variable") of the function "derive f"
<NaCl> deriv (f (x))
<zorun> I would have written "(deriv f) x"
<flapjackery> oh i see, so whatever variable is in function f will be passed through as x to this derivative function
<zorun> not really
* NaCl never liked liebnitz notation
<zorun> NaCl: your "derive (f (x))" doesn't work
<zorun> flapjackery: you have to see that "(deriv f)" is itself a function
<zorun> so you can call it with an argument, that will be bound to "x" for calculating the result
<zorun> # (deriv sin) 0.5;;
<zorun> - : float = 0.877342702877315084
<zorun> # cos 0.5;;
<zorun> - : float = 0.877582561890372759
<NaCl> that function doesn't even compile because dx isn't defined anywhere
<flapjackery> i see
<zorun> yeah, you have to define dx before
* NaCl thinks more along the lines of "let deriv f x = (f (x +. dx) -. f x) /. dx ;;"
<flapjackery> the notation in the book is a little confusing
<flapjackery> let deriv f x... seems to be more intuitive
<zorun> yeah, it depends
<NaCl> you can still make "deriv sin" into a function with that as well
<zorun> with "fun x -> ..." you really see that the result of "deriv foo" is itself a function
<NaCl> ocaml rule number one: put stuff on separate lines
drake01 has quit [Quit: Ex-Chat]
Anarchos has joined #ocaml
Jeff_123 has joined #ocaml
jamii has joined #ocaml
Jeff_123 has quit [Ping timeout: 258 seconds]
Anarchos has quit [Quit: Vision[0.9.7-H-090423]: i've been blurred!]
<flapjackery> hey thanks a lot NaCl and zorun
<flapjackery> I'm glad I found this channel
<NaCl> got a class with ocaml next semester?
<zorun> flapjackery: np :)
<flapjackery> nope i am actually working at my universities bioinformatics lab
<NaCl> mmmm
<NaCl> cool
<flapjackery> and the head computer scientist uses ocaml
<flapjackery> I'm learning so i ca contribute to the library hes putting together
<NaCl> because s/he is awesome, obviously. :P
<flapjackery> yea i'm really digging functional programming
<flapjackery> cheers guys
flapjackery has quit [Quit: Leaving]
quackv2 has quit [Read error: Connection reset by peer]
quackv2 has joined #ocaml
lamawithonel has joined #ocaml
sebz has joined #ocaml
eb4890 has quit [Ping timeout: 260 seconds]
* NaCl stares at an algorithm
<NaCl> everything looks simpler iteratively for some reason
<NaCl> is Array dymically resizable?
<hcarty> NaCl: No
<NaCl> fantastic
<hcarty> NaCl: But a few libraries provide dynamically growing arrays
<NaCl> woohoo
lopex has quit [Ping timeout: 252 seconds]
lopex has joined #ocaml
zorun has quit [Ping timeout: 240 seconds]
sebz has quit [Quit: Computer has gone to sleep.]
sebz has joined #ocaml
zorun has joined #ocaml