dark_light changed the topic of #ocaml to: OCaml 3.09.2 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/
_fab has quit []
_fab has joined #ocaml
_fab has quit [Client Quit]
mpc has joined #ocaml
<pango> something's weird in weak hashtables... instead of using a constant load of 200%, like normal hash tables, they use a variable factor t.limit (load = 100% * limit), that starts at 3, and that gets increased by 2 each time the weak hash table is resized (by +50%)
<pango> that explains the poor performance if you start with a too small weak hash table... t.limit gets larger with each resize, leading to larger load than if you start with a "correctly sized" table
<pango> I think the t.limit <- t.limit + 2; line in weak.ml is broken
<pango> or maybe that's to take into account that weak hashtables do some over-allocation in each bucket (since they're weak arrays, instead of lists) ?
<fremo> I cannot help but is load different than load factor in http://en.wikipedia.org/wiki/Hash_table ?
<fremo> load factor is the inverse of load ?
danly has quit ["Leaving"]
bzzbzz has joined #ocaml
cardmagic has quit []
khaladan_ has joined #ocaml
<pango> I meant load factor then
khaladan- has joined #ocaml
khaladan has quit [Read error: 145 (Connection timed out)]
bmiller has quit []
khaladan_ has quit [Read error: 145 (Connection timed out)]
trrkkkkk has joined #ocaml
yondalf has joined #ocaml
sponge45 has joined #ocaml
trrkkkkkk has quit [Read error: 145 (Connection timed out)]
dibblego has joined #ocaml
Roughest has joined #ocaml
<Roughest> ok this is driving me nuts...
<Roughest> how do i close a block after a with Exception ->
<pango> enclose the whole try with with either parens or begin/end
<Roughest> ok that's what i thought, but when i have:
<Roughest> ... with Invalid_argument a -> begin print_string "test" end; print_string "done";;
<Roughest> print_string "done";; never gets executed
<Roughest> or it gets executed, but only when the exception is raised...
<Roughest> so ocaml thinks it's part of the block still?
<Roughest> the with block, i mean
<pango> yes
<pango> correct
<pango> put the begin before try
<pango> that's what I meant
<Roughest> ah
<Roughest> ok makes sense, thank you
<pango> actually I prefer parens, but that's a matter of taste
<Roughest> man the error messages ocaml spits out aren't really english...
falconair has joined #ocaml
khaladan has joined #ocaml
<Roughest> okay i'm still confused about exceptions....
pango is now known as pangon8
<Roughest> is the "with" expression roughly equivalent to "catch" in java?
<yondalf> hmm...nobody answering? i'll try...yes, it is but it has better pattern-matching capability
<Roughest> hmm
<Roughest> ah... incorrectly placed brackets
<Roughest> :w
<Roughest> blah
khaladan- has quit [Read error: 145 (Connection timed out)]
llamaman has joined #ocaml
llamaman has left #ocaml []
revision17 has joined #ocaml
<Roughest> is there such a thing as a static variable in ocaml?
danly has joined #ocaml
danly has quit [Client Quit]
<sponge45> static variables: yes. Let me give you an example.
<sponge45> let count = (let counter = ref 0 in (fun () -> incr counter; !counter))
<sponge45> I put more parentheses than needed.
<Roughest> what does ! signify?
<sponge45> count is a function that will increment the counter each time you call it, and return the new value.
<sponge45> If you understand this, you understand everything about OCaml.
<Roughest> :)
<Roughest> i'm also not sure what ref does
<sponge45> it creates a variable.
<Roughest> ah
<sponge45> initialized with 0
<sponge45> it's called a reference
<Roughest> same sense as in C++?
<sponge45> my C++ is rusty. Basically you would pass it around like an address/pointer. So it always points to the same memory cell.
<Roughest> okay yeah
<Roughest> so how about the !?
<Roughest> er
<Roughest> !
<Roughest> i can't find where that's documented in the manual...
<sponge45> it lets you read its contents.
danly has joined #ocaml
<Roughest> aha
<sponge45> It's a shortcut for counter.contents
<Roughest> returns the contents of the reference
<Roughest> ok
<Roughest> thank you
danly has quit [Read error: 54 (Connection reset by peer)]
<sponge45> actually the ref type is a record with only one field, which is mutable.
<sponge45> and there is a ref function which could be written as: let ref x = { content = x }
danly has joined #ocaml
postalchris has joined #ocaml
<Roughest> Warning X: this optional argument cannot be erased.
<Roughest> wtf??
<Roughest> oh nevermind
<Roughest> .... talk about crypting error message sthough
gunark has quit [Nick collision from services.]
Roughest is now known as gunark
roughest has joined #ocaml
danly has quit [Remote closed the connection]
pingu has quit [Read error: 54 (Connection reset by peer)]
pingu has joined #ocaml
unfo- has joined #ocaml
danly has joined #ocaml
danly_ has joined #ocaml
cmeme has quit [Excess Flood]
danly_ has quit [Client Quit]
cmeme has joined #ocaml
Smerdyakov has quit ["Leaving"]
trrkkkkkk has joined #ocaml
trrkkkkk has quit [Read error: 113 (No route to host)]
dibblego has quit ["Leaving"]
pango_ has joined #ocaml
sponge45 has quit ["zzzzzzzzzz"]
yondalf has quit ["leaving"]
falconair has quit [Client Quit]
pangon8 has quit [Remote closed the connection]
postalchris has quit [Read error: 148 (No route to host)]
ikaros has quit [Read error: 60 (Operation timed out)]
Snark_ has joined #ocaml
ikaros has joined #ocaml
_velco has joined #ocaml
jajs has joined #ocaml
pango_ has quit ["brb"]
pango has joined #ocaml
unfo- has quit [Read error: 110 (Connection timed out)]
mellum has joined #ocaml
yondalf has joined #ocaml
love-pingoo has joined #ocaml
velco has joined #ocaml
trrkkkkk has joined #ocaml
yondalf has quit [Read error: 110 (Connection timed out)]
trrkkkkkk has quit [Read error: 145 (Connection timed out)]
pinupgeek has joined #ocaml
<pinupgeek> hey there
<flux__> well hi
<pinupgeek> is Practical Ocaml from Apress the book to get ?
<pinupgeek> i know nothing about ocaml
<flux__> I don't know
<pinupgeek> the online documentation looks good too
<flux__> the reviews don't seem to appraise it (infact the opposite), but there was an ocaml-new-comer who appreciated it
<flux__> the documentation and tutorials have worked for me
<pinupgeek> ah ok
<flux__> what languages do you already know?
<love-pingoo> let l = 1::2::l << uh ? that works.. cool :)
<pinupgeek> ruby, bit of Io , perl etc that sort a thing
<haelix> love-pingoo: or rather, let rec l = ... ?
<love-pingoo> yes, with a rec
<love-pingoo> it makes it possible to represent graphs in an immediate way
<flux__> pinupgeek, oh.. well ocaml can be somewhat of a culture shock then, I imagine :)
<flux__> pinupgeek, but try browsing through some tutorials (ocaml-tutorial.org is a nice one) first
<haelix> love-pingoo: not sure about that
<pinupgeek> k
<haelix> last time I tried to make graphs of values,
<haelix> I ended up resorting to mutable fields
<love-pingoo> can you think of an example I could try ?
<flux__> I wonder if you can convert a mutable graph (with cycles) into a non-mutable one
<love-pingoo> cyclicity test ?
<haelix> (or to have an external representation, such as ( int *int ) list
<flux__> love-pingoo, how about that problem :)
<flux__> but that wasn't what you were after, I suppose
<love-pingoo> I was after nothing, just realized that after reading a random post on SML...
<love-pingoo> flux__: give me your mutable graph type and I'll try that
* love-pingoo feels like hacking a little bit
<flux__> type 'a t = { value : 'a; mutable conns : 'a t list }
revision17 has quit [Read error: 110 (Connection timed out)]
kral has joined #ocaml
_fab has joined #ocaml
slipstream-- has quit [Read error: 104 (Connection reset by peer)]
slipstream has joined #ocaml
<love-pingoo> flux__: in the end I still think that it's possible to create arbitrary graphs, but not in a dynamic way
<love-pingoo> I can define one by hand, but not convert from your immutable structure
yondalf has joined #ocaml
<love-pingoo> problem is that I need a side-effect using the being-defined value in the let-rec (to mark seen vertices) and that's forbidden
<flux__> I suppose one could write a c-module to do that
<flux__> hmm
<flux__> I wonder..
<flux__> would this be legal? type 'a t' = { value' : 'a; conns : 'a t' list } let constify (t : t) = (Obj.magic t : t')
jajs has quit [Remote closed the connection]
<love-pingoo> caml may be forbidding any non-constructor thing using the begin-rec-defined values, so C functions might be impossible too
<love-pingoo> flux__: I wouldn't bet on that :D
<flux__> atleast it works on my simple graph :-)
<flux__> ah
<flux__> it actually wouldn't 'really' work
<flux__> because the underlying values might change
<flux__> even if you can't change them
<flux__> the original graph could be still changed
<flux__> sort of like c++ const :)
<flux__> (const reference)
trrkkkkkk has joined #ocaml
shawn__ has quit ["This computer has gone to sleep"]
shawn__ has joined #ocaml
trrkkkkk has quit [Read error: 148 (No route to host)]
yondalf has quit ["leaving"]
ramkrsna has joined #ocaml
piggybox has joined #ocaml
falconair has joined #ocaml
khaladan_ has joined #ocaml
<flux__> hmm.. the Format-module doesn't appear to provide any alignment operations?
<flux__> like if I have a (string * string) list and I wanted to output it neatly so that the first and second string are always beneath the previous one, the Format-module won't help me do that?
khaladan has quit [Read error: 145 (Connection timed out)]
pango has quit [Remote closed the connection]
pango has joined #ocaml
gene9 has joined #ocaml
khaladan has joined #ocaml
gene9 has quit ["leaving"]
khaladan_ has quit [Read error: 145 (Connection timed out)]
pango is now known as pangoafk
_fab has quit []
Smerdyakov has joined #ocaml
Ugarte has quit [Read error: 104 (Connection reset by peer)]
Leonidas has joined #ocaml
gunark has quit [Nick collision from services.]
roughest has quit [Read error: 104 (Connection reset by peer)]
Roughest has joined #ocaml
postalchris has joined #ocaml
gunark has joined #ocaml
trrkkkkk has joined #ocaml
kral has quit [Remote closed the connection]
trrkkkkkk has quit [Read error: 113 (No route to host)]
holdenk has joined #ocaml
<holdenk> hello
<holdenk> Are there any good examples of how to do DB work in/with Ocaml?
<love-pingoo> there used to be a jeremy around, who worked on that
<love-pingoo> unfortunately, he disappeared
<buluc1> there are libraries, e.g. for postgresql
<holdenk> buluc1: I was looking at perhaps using the mysql module or the dbi module from mod_caml , but I was wondering if there were any example programs that used them [I'm extremely new]
swater has joined #ocaml
<gunark> argh
<gunark> is anyone using the fft bindings?
<gunark> why am i getting "The external function `fftw_import_wisdom_iter' is not available" :(
trrkkkkkk has joined #ocaml
falconair has quit [Client Quit]
Demitar__ has quit [zelazny.freenode.net irc.freenode.net]
Demitar__ has joined #ocaml
<gunark> do i need to do anything special when i'm loading a library with native bindings into a toplevel session?
Smerdyakov has quit [zelazny.freenode.net irc.freenode.net]
love-pingoo has quit [zelazny.freenode.net irc.freenode.net]
mellum has quit [zelazny.freenode.net irc.freenode.net]
lde has quit [zelazny.freenode.net irc.freenode.net]
zamez has quit [zelazny.freenode.net irc.freenode.net]
fremo has quit [zelazny.freenode.net irc.freenode.net]
l_a_m has quit [zelazny.freenode.net irc.freenode.net]
Hadaka has quit [zelazny.freenode.net irc.freenode.net]
swater has quit [zelazny.freenode.net irc.freenode.net]
slipstream has quit [zelazny.freenode.net irc.freenode.net]
_velco has quit [zelazny.freenode.net irc.freenode.net]
pinupgeek has quit [zelazny.freenode.net irc.freenode.net]
Snark_ has quit [zelazny.freenode.net irc.freenode.net]
seafood_ has quit [zelazny.freenode.net irc.freenode.net]
tsuyoshi has quit [zelazny.freenode.net irc.freenode.net]
ozzloy has quit [zelazny.freenode.net irc.freenode.net]
gim has quit [zelazny.freenode.net irc.freenode.net]
Amorphous has quit [zelazny.freenode.net irc.freenode.net]
Shimei has quit [zelazny.freenode.net irc.freenode.net]
Smerdyakov has joined #ocaml
love-pingoo has joined #ocaml
mellum has joined #ocaml
lde has joined #ocaml
zamez has joined #ocaml
l_a_m has joined #ocaml
fremo has joined #ocaml
Hadaka has joined #ocaml
trrkkkkkk has quit [zelazny.freenode.net irc.freenode.net]
trrkkkkk has quit [zelazny.freenode.net irc.freenode.net]
postalchris has quit [zelazny.freenode.net irc.freenode.net]
khaladan has quit [zelazny.freenode.net irc.freenode.net]
ramkrsna has quit [zelazny.freenode.net irc.freenode.net]
cmeme has quit [zelazny.freenode.net irc.freenode.net]
holdenk has quit [zelazny.freenode.net irc.freenode.net]
pattern has quit [zelazny.freenode.net irc.freenode.net]
mattam has quit [zelazny.freenode.net irc.freenode.net]
TaXules has quit [zelazny.freenode.net irc.freenode.net]
swater has joined #ocaml
slipstream has joined #ocaml
pinupgeek has joined #ocaml
_velco has joined #ocaml
Snark_ has joined #ocaml
tsuyoshi has joined #ocaml
seafood_ has joined #ocaml
ozzloy has joined #ocaml
gim has joined #ocaml
Amorphous has joined #ocaml
Shimei has joined #ocaml
ulfdoz has quit [zelazny.freenode.net irc.freenode.net]
gunark has quit [zelazny.freenode.net irc.freenode.net]
Roughest has quit [zelazny.freenode.net irc.freenode.net]
Leonidas has quit [zelazny.freenode.net irc.freenode.net]
shawn__ has quit [zelazny.freenode.net irc.freenode.net]
velco has quit [zelazny.freenode.net irc.freenode.net]
ikaros has quit [zelazny.freenode.net irc.freenode.net]
pingu has quit [zelazny.freenode.net irc.freenode.net]
bzzbzz has quit [zelazny.freenode.net irc.freenode.net]
haelix has quit [zelazny.freenode.net irc.freenode.net]
bebui has quit [zelazny.freenode.net irc.freenode.net]
zmdkrbou has quit [zelazny.freenode.net irc.freenode.net]
Norgg has quit [zelazny.freenode.net irc.freenode.net]
trrkkkkkk has joined #ocaml
holdenk has joined #ocaml
trrkkkkk has joined #ocaml
postalchris has joined #ocaml
khaladan has joined #ocaml
ramkrsna has joined #ocaml
cmeme has joined #ocaml
pattern has joined #ocaml
TaXules has joined #ocaml
mattam has joined #ocaml
gunark has joined #ocaml
Roughest has joined #ocaml
Leonidas has joined #ocaml
shawn__ has joined #ocaml
velco has joined #ocaml
ikaros has joined #ocaml
pingu has joined #ocaml
bzzbzz has joined #ocaml
ulfdoz has joined #ocaml
haelix has joined #ocaml
Norgg has joined #ocaml
zmdkrbou has joined #ocaml
bebui has joined #ocaml
buluc1 has quit [zelazny.freenode.net irc.freenode.net]
flux__ has quit [zelazny.freenode.net irc.freenode.net]
Foxyloxy has quit [zelazny.freenode.net irc.freenode.net]
buluc1 has joined #ocaml
flux__ has joined #ocaml
Foxyloxy has joined #ocaml
trrkkkkk has quit [Connection timed out]
<love-pingoo> blam
postalchris has quit [Remote closed the connection]
<gunark> ok yeah so the code compiles fine
<gunark> but when i try to run it in toplevel i get
<gunark> The external function `fftw_import_wisdom_iter' is not available
<mellum> maybe you are not wise enough?
<gunark> har har
<gunark> ... probably true though :(
trrkkkkk has joined #ocaml
love-pingoo has quit ["Leaving"]
trrkkkkkk has quit [Read error: 148 (No route to host)]
trrkkkkkk has joined #ocaml
Ugarte has joined #ocaml
bluestorm has joined #ocaml
trrkkkkk has quit [Read error: 145 (Connection timed out)]
trrkkkk has joined #ocaml
velco has quit ["Ex-Chat"]
ikaros has quit ["Leaving"]
trrkkkkk has joined #ocaml
trrkkkkkk has quit [Read error: 145 (Connection timed out)]
ikaros has joined #ocaml
trrkkkkkk has joined #ocaml
<gunark> what's Array1?
<gunark> or rather, where is it documented?
<gunark> oh nvm found it
<flux__> gunark, maybe you want to build your own toplevel with ocamlmktop?
trrkkkk has quit [Read error: 113 (No route to host)]
<gunark> yup just did that...
<gunark> ok another question.... how do I create a bigarray of signed 16-bit ints?
<gunark> Array1.create int16_signed_elt c_layout n
<gunark> unbound value int16_signed_elt
<gunark> same if i do Bigarray.int16_signed_elt, Array1.int16_signed_elt
<gunark> etc.
<gunark> eh... int16_signed, apparently... no _elt
<bluestorm> hm
_velco has quit ["I'm outta here ..."]
trrkkkkk has quit [Read error: 113 (No route to host)]
kwak_ has joined #ocaml
trrkkkkkk has quit [Read error: 113 (No route to host)]
ikaros has quit ["Leaving"]
<lde> gunark: Array1.create int16_signed c_layout n;;
<lde> oh, you already figured. :-)
ikaros has joined #ocaml
Snark_ has quit ["Leaving"]
smimou has joined #ocaml
danly has quit ["Leaving"]
_JusSx_ has joined #ocaml
Skal has joined #ocaml
asbradbury has left #ocaml []
trrkkkk has joined #ocaml
postalchris has joined #ocaml
bluestorm has quit ["Konversation terminated!"]
bluestorm has joined #ocaml
gim_ has joined #ocaml
love-pingoo has joined #ocaml
gim__ has joined #ocaml
gim_ has quit [Read error: 60 (Operation timed out)]
gim_ has joined #ocaml
gim__ has quit [Read error: 54 (Connection reset by peer)]
khaladan_ has joined #ocaml
jajs has joined #ocaml
gim_ has quit [Read error: 60 (Operation timed out)]
khaladan has quit [Read error: 145 (Connection timed out)]
mpc has quit [Read error: 110 (Connection timed out)]
trrkkkkk has joined #ocaml
mpc has joined #ocaml
trrkkkkkk has joined #ocaml
trrkkkk has quit [Read error: 113 (No route to host)]
trrkkkk has joined #ocaml
trrkkkkk has quit [Read error: 145 (Connection timed out)]
Skal has quit [Read error: 54 (Connection reset by peer)]
trrkkkkkk has quit [Read error: 145 (Connection timed out)]
rillig has joined #ocaml
trrkkkkk has joined #ocaml
trrkkkk has quit [Read error: 113 (No route to host)]
swater has quit ["Quat"]
swater has joined #ocaml
cmeme has quit [Remote closed the connection]
cmeme has joined #ocaml
joshcryer has joined #ocaml
love-pingoo has quit ["Connection reset by pear"]
buluc1 is now known as buluca
pangoafk has quit ["Leaving"]
pango has joined #ocaml
pinupgeek has left #ocaml []
trrkkkkkk has joined #ocaml
mpc has quit [Read error: 110 (Connection timed out)]
trrkkkkk has quit [Read error: 113 (No route to host)]
trrkkkkk has joined #ocaml
trrkkkk has joined #ocaml
jajs has quit [Remote closed the connection]
trrkkkkkk has quit [Read error: 113 (No route to host)]
mpc has joined #ocaml
_JusSx_ has quit [Read error: 113 (No route to host)]
joshcryer has quit [Read error: 104 (Connection reset by peer)]
smimou has quit ["bli"]
kwak__ has joined #ocaml
trrkkkkk has quit [Read error: 113 (No route to host)]
kwak_ has quit [Read error: 145 (Connection timed out)]
trrkkkkk has joined #ocaml
joshcryer has joined #ocaml
kwak__ has quit []
trrkkkkkk has joined #ocaml
swater_ has joined #ocaml
jajs has joined #ocaml
trrkkkk has quit [Read error: 110 (Connection timed out)]
bluestorm has quit ["Konversation terminated!"]
trrkkkkk has quit [Read error: 110 (Connection timed out)]
swater has quit [Read error: 60 (Operation timed out)]
trrkkkkk has joined #ocaml
trrkkkk has joined #ocaml
rillig has quit ["exit(EXIT_SUCCESS)"]
trrkkkkkk has quit [Read error: 110 (Connection timed out)]
DRMacIver has joined #ocaml
Foxyloxy has quit [Connection timed out]
<DRMacIver> Hi. I'm being an idiot, and am hoping for some rescue. :) I'm trying to define the function f : 'a list -> 'a list list -> 'a list list given by taking all pairs (x, y) where x is in the first argument and y is in the second, forming x::y from this and returning the list of all such values.
<DRMacIver> But this needs to run fast and on large lists, so I'm trying to make it tail recursive.
<DRMacIver> And I'm somehow having a total failure of brain in doing so.
<DRMacIver> (The order of the output does not matter)
trrkkkkk has quit [Read error: 110 (Connection timed out)]
<ulfdoz> Do you mean a cross product?
<DRMacIver> I don't think so...
<DRMacIver> The first argument is an 'a list. The second is an 'a list list. The output should be an 'a list list where each element is an element of the second argument with an element of the first consed onto the front.
<DRMacIver> (And all such elements are contained within the list exactly once)
<DRMacIver> This hsould be easy, but I'm being dim. :)
<ulfdoz> For haskell I'd say, zip/zipWith. ;)
trrkkkkk has joined #ocaml
<DRMacIver> Yeah, but my end result is going to involve messing around with hash tables in complicated ways, so I don't want to use haskell. :)
<DRMacIver> Also the key point is tail recursive. zip implementations tend not to be.
<DRMacIver> Anyway, I think I've got it now...
trrkkkk has quit [Read error: 145 (Connection timed out)]
swater_ has quit ["Quat"]
<DRMacIver> Phew. Got it.
<DRMacIver> As usual it's easy as hell once you see it. :)
<DRMacIver> He says, only to find his code gives the wrong answer. Balls.