__DL__ changed the topic of #ocaml to: OCaml 3.09.0 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/
batdog|gone is now known as batdog
vezenchio has quit [Read error: 110 (Connection timed out)]
batdog is now known as batdog|gone
_exa has joined #ocaml
_exa has quit [Remote closed the connection]
exa has quit [Read error: 113 (No route to host)]
kmagdsick has quit ["Download Gaim: http://gaim.sourceforge.net/"]
pango_ has joined #ocaml
pango has quit [Read error: 110 (Connection timed out)]
TaXules has quit [Read error: 104 (Connection reset by peer)]
TaXules has joined #ocaml
rq has quit ["Leaving"]
shirogane has joined #ocaml
ulfdoz has quit [Read error: 113 (No route to host)]
ulfdoz has joined #ocaml
ski_ has joined #ocaml
ski has quit [Read error: 110 (Connection timed out)]
ski_ is now known as ski
Bigb[a]ng is now known as Bigbang
Bigbang is now known as Bigb[a]ng
<ski> Schmurtz : isn't it better to always swap the element at index i with a later or same element (i.e. 'let j = Random.int (len - i) + i') ?
shirogane has quit [Remote closed the connection]
thedracle has joined #ocaml
thedracle has left #ocaml []
thedracle has joined #ocaml
vodka-goo has joined #ocaml
vodka-goo has quit []
thedracle has quit [Read error: 113 (No route to host)]
Smerdy has joined #ocaml
Smerdyakov has quit [Read error: 101 (Network is unreachable)]
m3ga has joined #ocaml
pango_ has quit ["Client exiting"]
pango has joined #ocaml
Skal has joined #ocaml
joshcryer has joined #ocaml
ski has quit [Read error: 110 (Connection timed out)]
ski has joined #ocaml
_fab has joined #ocaml
ppsmimou has joined #ocaml
CLxyz has quit [Connection timed out]
Revision17 has joined #ocaml
revision17_ has quit [Read error: 110 (Connection timed out)]
FabMatt has joined #ocaml
<FabMatt> sorry to bother:)
<FabMatt> an english question
<FabMatt> what does " blow the roof off " means?
FabMatt has quit ["Sto andando via"]
<Schmurtz> good question...
<ski> Schmurtz : wouldn't 'let j = Int.random (len - i) + i' be better, for your shuffle ?
ramkrsna has joined #ocaml
<Schmurtz> no idea
<Schmurtz> I took the algorithm from a web site, and don't know exactly why it is good shuffling algorithm
<pango> fisher yates shuffle ?
<Schmurtz> for(i=1 to n) swap(i,rand(n))
<Schmurtz> I don't know its name
<ski> that looks same as your, yes
<pango> also, interesting:
<Schmurtz> it's the same complexity, but is it better ?
<Schmurtz> pango, in C rand() is not a good random generator
<Schmurtz> on a unix system, reading the content of /dev/(u)random is far from better
<pango> I just cared about finding an authoritative implementation of the algorithm, rather than an approximation
<Schmurtz> and you're right
<ski> pango : interesting ..
<Schmurtz> in C, "sranddev(); int i = rand()" is a good choice
<Schmurtz> (sranddev often use /dev/random to set the seed)
<pango> it seems that what matters is the size of the seed, and not only its quality
<Schmurtz> it's its length
<Schmurtz> if you reset the seed with good random data before every rand(), if should be ok
<pango> gonna be expensive however
<Schmurtz> yes, it depends on what you need ;)
<pango> right
<pango> rand() alone is probably ok to shuffle a mp3 playlist ;)
<Schmurtz> or for games
CLxyz has joined #ocaml
_JusSx_ has joined #ocaml
__DL__ has joined #ocaml
vezenchio has joined #ocaml
pnou_ has quit [Read error: 104 (Connection reset by peer)]
TaXules has quit [Success]
TaXules has joined #ocaml
pnou has joined #ocaml
pnou has quit [Read error: 104 (Connection reset by peer)]
pnou has joined #ocaml
raziel_ has joined #ocaml
raziel_ has quit [Read error: 104 (Connection reset by peer)]
ramkrsna has quit [Remote closed the connection]
yangsx has joined #ocaml
Saulzar has joined #ocaml
yangsx has quit [Read error: 101 (Network is unreachable)]
mercurylala has joined #ocaml
Raziel has quit ["Yo soy goma. Tú eres cola."]
batdog|gone is now known as batdog
gim has quit [Remote closed the connection]
gim has joined #ocaml
descender has quit [Read error: 104 (Connection reset by peer)]
ski has quit ["later"]
kubano has quit [Read error: 104 (Connection reset by peer)]
ppsmimou has quit ["Leaving"]
Snark has joined #ocaml
shirogane has joined #ocaml
qknight has joined #ocaml
<qknight> hey
<qknight> let rec print_foo l = match l with
<qknight> i of int -> print_formal i
<qknight> | i of list -> print_field i;;
<qknight> why does this not work?
<qknight> i want to use print_formal i if i is int
<qknight> and the other function if i is a list
<dylan> It makes no sense.
<Snark> something can't be an int and a list
<qknight> type clash =
<qknight> Clash_formals of formal list
<qknight> | Clash_fields of field list
<qknight> it can (but my example is different
<dylan> In that case, something is only a clash
<dylan> A variant must have a name.
<qknight> ?
<dylan> type foo = Foo of t1 | Bar of t2 makes sense
<qknight> the problem is that clash can be a "formal list" and a "field list"
exa has joined #ocaml
<qknight> dylan: yes ok
<dylan> And each variant needs a name.
<dylan> so, you probably want:
<dylan> match c with
<dylan> Clash_formals l -> List.iter print_formal l
<dylan> | ...
<dylan> er, but a format is an int. n/m the List.iter
<dylan> *formal
<qknight> ?
<qknight> didn't understand your example
<dylan> What type of data are you trying to match?
<dylan> type clash = ..., as you stated?
<qknight> type clash =
<qknight> Clash_formals of formal list
<qknight> | Clash_fields of field list
<qknight> yes
<qknight> now i have to write a function: val print_clashes : calsh list -> unit
<pango> you'll have list of lists then
<qknight> yes
<qknight> i supose
<qknight> suppose so
<dylan> I could just spit out a working function...
<dylan> given print_formal and print_field are defined...
<qknight> yes
<dylan> but I'm quite unsure of how to understand what you're pondering. :-/
<qknight> print_formal and print_field
<qknight> dylan: yes
<qknight> dylan: it's to unclear what i really want
<qknight> better don't answer anything
<dylan> yes! Of course, that makes it so clear.
<qknight> i try to think about it
<dylan> :)
<qknight> sorry & tnx
<dylan> Ningún problema. :)
pango has quit ["brb"]
pango has joined #ocaml
vodka-goo has joined #ocaml
ofranja has joined #ocaml
Snark has quit ["Parti"]
smimou has joined #ocaml
m3ga has quit [Remote closed the connection]
shirogane has quit [Remote closed the connection]
Raziel has joined #ocaml
ski__ is now known as ski_
__DL__ has quit [Remote closed the connection]
exa has quit [Remote closed the connection]
_JusSx_ has quit ["leaving"]
vodka-goo has quit ["Connection reset by by pear"]
vodka-goo has joined #ocaml
Schmurtz has quit ["Plouf !"]
vodka-goo has quit ["Connection reset by by pear"]
Schmurtz has joined #ocaml
smimou has quit ["bli"]
_fab has quit []
Skal has quit [Remote closed the connection]
dmn has joined #ocaml
<dmn> hello
<dmn> is it possible, to have a type 'a t = 'a list * 'a list (without a named constructor) and satisfy a signature that requires using the type 'a t ?
<dmn> guess the time is too early/late to get an answer `;\