<sgillespie>
is it possible to evaluate that twice?
<Smerdyakov>
The question is too vague.
pantsd has quit ["Leaving."]
<sgillespie>
okay lets say I have
<sgillespie>
let a = lazy (print_string "Hello World";;
shekmalhen has joined #ocaml
<sgillespie>
Lazy.force a;;
<sgillespie>
Lazy.force a;;
<sgillespie>
the string is only printed once
<sgillespie>
how can I make it so that it is printed twice
<sgillespie>
...and I realize my syntax error
<Smerdyakov>
Not use Lazy, that's how. I guess that's its semantics. (Though I'm generally unfamiliar with it.
<mbishop>
)
<sgillespie>
so then I have
<sgillespie>
let a = print_string "Hello";;
<sgillespie>
it immediately prints "Hello"
<sgillespie>
if I call
<sgillespie>
a;;
<sgillespie>
it does not print "Hello" again
<Smerdyakov>
Yes. You haven't defined 'a' as a function.
<sgillespie>
well, how would I define a function with no arguments?
<mbishop>
let a () = print_string "Hello\n";;
<Smerdyakov>
The tutorial has examples..
<sgillespie>
yeah, i just found that too...
<sgillespie>
but I surely appreciate your help
<sgillespie>
which tutorial?
<Smerdyakov>
In the manual
ulfdoz has quit [Read error: 54 (Connection reset by peer)]
ulfdoz has joined #ocaml
holo has quit ["Leaving"]
jeffs has joined #ocaml
<jeffs>
/whoami
<jeffs>
hm
pantsd has joined #ocaml
jeffs has quit ["Leaving."]
sgillespie has quit [Read error: 110 (Connection timed out)]
Smerdyakov has quit ["Leaving"]
m3ga has joined #ocaml
sgillespie has joined #ocaml
m3ga has quit ["disappearing into the sunset"]
G_ has joined #ocaml
love-pingoo has joined #ocaml
G has quit [Read error: 110 (Connection timed out)]
G_ is now known as G
kelaouchi has quit ["leaving"]
mnemonic has joined #ocaml
<mnemonic>
hi
SooW has joined #ocaml
<flux>
hello
<SooW>
hi, I'm getting an undefined reference to "alloc_bigarray" while linking my objects with bigarray.cma :s
<SooW>
in 3.10... I wasn't with 3.09
G is now known as Nigel
<SooW>
nobody aware of this ?
SooW has quit ["Quitte"]
<flux>
no idea, sorry
<flux>
perhaps it's a bug
<flux>
or perhaps you should try compiling some other software that uses bigarray, to see if you're doing something differently
Submarine has quit [Remote closed the connection]
G has joined #ocaml
Nigel has quit [Read error: 110 (Connection timed out)]
mikeX has joined #ocaml
love-pingoo has quit ["Connection reset by pear"]
noteventime has joined #ocaml
kelaouchi has joined #ocaml
ygrek has joined #ocaml
cjeris has joined #ocaml
ita|zzz is now known as ita
ita is now known as ita|afk
bluestorm has joined #ocaml
noteventime has quit [Remote closed the connection]
noteventime has joined #ocaml
_JusSx_ has joined #ocaml
postalchris has joined #ocaml
pango- has joined #ocaml
pango has quit [Remote closed the connection]
pango- is now known as pango
malc_ has joined #ocaml
Smerdyakov has joined #ocaml
ulfdoz has quit ["router pimpen"]
smithzv has joined #ocaml
smithzv has left #ocaml []
gim_ has joined #ocaml
bluestorm has quit [Remote closed the connection]
bluestorm has joined #ocaml
Demitar has quit [Read error: 113 (No route to host)]
bluestorm has quit [Remote closed the connection]
bluestorm has joined #ocaml
EliasAmaral has joined #ocaml
JeffSmac has joined #ocaml
smimou has joined #ocaml
ulfdoz has joined #ocaml
benny_ has joined #ocaml
JeffSmac has quit []
benny__ has quit [Read error: 110 (Connection timed out)]
postalchris has quit [Read error: 110 (Connection timed out)]
_JusSx__ has joined #ocaml
olegfink has joined #ocaml
<olegfink>
hi
<olegfink>
I have some strange behaviour here:
<olegfink>
List.sort (fun (_,c) (_,d) -> min c d) list
<olegfink>
I have a list of pairs, and the above line returns the identical list instead of sorted
<olegfink>
ehm
<flux>
min c d doesn't look like a comparison function to me
<olegfink>
sorry
<pango>
reread the expectations of List.sort about compare function
<flux>
don't you mean compare c d?
<olegfink>
yay, thanks
<flux>
hm, how would an efficient algorithm for detecting a broken comparison function (with an input list) look like..
<pango>
if it should be a total ordering comparison function, it should check compare a a = 0, compare a b > 0 <=> compare b a < 0 and compare a b > 0 && compare b c > 0 => compare a c > 0 for all a, b, c
malc_ has quit ["leaving"]
<flux>
considering the case where the comparison function actually works, you could first sort by it, and then \forall x = [1..n] \forall y = [x+1..n] compare x y <= 0 should be true
<flux>
which makes it O(n^2)
_JusSx_ has quit [Read error: 110 (Connection timed out)]
<pango>
if you goal is to check whether it's a correct comparison function, you can't put "the comparison function actually works" in the hypothesis :)
morten has joined #ocaml
morten has left #ocaml []
the_dormant has joined #ocaml
pango has quit [Remote closed the connection]
ygrek has quit [Remote closed the connection]
pango has joined #ocaml
ygrek has joined #ocaml
the_dormant_ has joined #ocaml
the_dormant has quit [Read error: 110 (Connection timed out)]
G has quit [Remote closed the connection]
G has joined #ocaml
ita|afk is now known as ita
ygrek has quit [Remote closed the connection]
the_dormant has joined #ocaml
the_dormant_ has quit [Read error: 110 (Connection timed out)]
pantsd has quit ["Leaving."]
ita is now known as ita|afk
olegfink has quit [Read error: 54 (Connection reset by peer)]
ita|afk has left #ocaml []
olegfink has joined #ocaml
the_dormant_ has joined #ocaml
the_dormant has quit [Connection timed out]
JeffSmac has joined #ocaml
Mr_Awesome has joined #ocaml
JeffSmac has quit []
JeffSmac has joined #ocaml
cjeris has quit [Read error: 104 (Connection reset by peer)]
malc_ has joined #ocaml
JeffSmac has quit []
Riesz has joined #ocaml
JeffSmac has joined #ocaml
Submarine has joined #ocaml
_JusSx__ has quit ["leaving"]
Demitar has joined #ocaml
malc_ has quit ["leaving"]
sourcerror has quit ["Quit"]
<JeffSmac>
if you use labltk, I just posted a useful function for tabbed interfaces to my blog