<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 `;\