vezenchio has quit [Read error: 110 (Connection timed out)]
vezenchio has joined #ocaml
kinners has joined #ocaml
m3ga has joined #ocaml
m3ga has quit ["Client exiting"]
monochrom has quit ["hello"]
kinners_ has joined #ocaml
quamaretto has joined #ocaml
gim has quit ["zzz"]
kinners has quit [Read error: 110 (Connection timed out)]
cryptilox has left #ocaml []
kinners_ has quit ["leaving"]
<
judge>
i'm trying to understand how ocamlopt does linking
CosmicRay_ has joined #ocaml
CosmicRay_ has quit [Read error: 104 (Connection reset by peer)]
CosmicRay has quit [Remote closed the connection]
<
judge>
i compiled a file using ocamlopt -output-obj gauss.ml -o gauss
CosmicRay has joined #ocaml
<
judge>
then i did gcc -lm -ldl gauss /usr/lib/ocaml/libasmrun.a /usr/lib/ocaml/libcamlrun.a /usr/lib/ocaml/unix.a -o g
<
judge>
everything links
<
judge>
but when i run ./g it doesnt do anything
<
judge>
where did i go wrong?
<
Smerdyakov>
Why are you running gcc yourself?
<
judge>
i found the docs for this
zzorn has quit ["zzz"]
mrvn_ has joined #ocaml
<
judge>
i'm trying to compile the ocaml linking example
<
judge>
and i cant get it to link
<
judge>
has anyone gotten that example to work?
<
judge>
for some reason /usr/lib/ocaml/libcamlrun.a already defines a main() function
mrvn has quit [Read error: 110 (Connection timed out)]
ne1 has joined #ocaml
<
dan2>
Smerdyakov: how do I assign static type information in a type
<
dan2>
type agicon = CHAN (in : in_channel, out : out_channel)
<
ne1>
can a type constructor begin with a capital letter?
<
ne1>
Yes it has to.
<
dan2>
ne1: ADDR_INET is an example of one that does
<
dan2>
ne1: do you know how to complete the statement
<
ne1>
type agicon = CHAN of in_channel * out_channel
<
ne1>
If you really like to name the fields "in" and "out", you write a record type.
<
ne1>
type agicon = { in : in_channel, out : out_channel }
<
dan2>
ne1: thats the better approach for the situation anyway
<
dan2>
ne1: it doesn't like in
<
ne1>
right, in is a keyword. "let ... in ..."
<
ne1>
you have to innovate another name. :D
<
dan2>
ne1: it needs to be a semicolon, not a comma
mrvn_ is now known as mrvn
CosmicRay has quit [Read error: 113 (No route to host)]
<
dan2>
ne1: whats the syntax for named arguments in functions
<
dan2>
ne1: let foo ?blah:dfasdfasd ...?
<
Smerdyakov>
~blah:dfashas
<
dan2>
Smerdyakov: but I want this to be an optional named argument
<
dan2>
Smerdyakov: ?
<
Smerdyakov>
Oh, I misread.
<
Smerdyakov>
It's ?(blah : type = value) or similar.
<
Smerdyakov>
I don't like optional arguments, though!
<
dan2>
Smerdyakov: the optional argument is a timeout for a function
<
dan2>
Smerdyakov: most people will use the default
<
dan2>
Smerdyakov: btw, how do you hyperlink something in ocamldoc to another functoin
<
dan2>
like, See wait_for_digit ...
<
Smerdyakov>
I've never used ocamldoc.
<
Smerdyakov>
But I'd assume this information (and the last bit of info) is easily found in the manual.
<
ne1>
I used to know. I have forgotten, too.
<
dan2>
Smerdyakov: hmm, what do I put in an interface file for a optional argument
<
dan2>
its not liking this
<
dan2>
val wait_for_digit : ?timeout:"2000" -> agicon -> string
<
Smerdyakov>
dan2, (* the author of this code was too dumb to read the manual *)
<
ne1>
there are four kinds of people
<
dan2>
/home/dan/ocaml/dialer/src/agi.mli : Erreur inconnue lors du parse de see : wait_for_digit
<
ne1>
one kind learns by reading documents in solitude
<
ne1>
another kind claim they learn by interaction with people, i.e., keep asking
<
ne1>
the last kind cannot count.
<
ne1>
how do you get a french error message?
<
Smerdyakov>
ne1, tap your heels together and shout to the French Santa Claus.
<
ne1>
non l'avrei giammai creduto
skylan has quit ["leaving"]
skylan has joined #ocaml
solarwind has quit [Read error: 110 (Connection timed out)]
<
dan2>
ne1: give an invalid argument to a @command in ocamldoc
<
dan2>
in this case, it was @see
ne1 has quit ["To understand recursion, you must first understand recursion."]
mrsolo_ has joined #ocaml
mlh has joined #ocaml
mrsolo has quit [Read error: 113 (No route to host)]
Submarine has joined #ocaml
srv has quit [Read error: 104 (Connection reset by peer)]
srv has joined #ocaml
bisby has joined #ocaml
<
bisby>
how can i sort this list
<
bisby>
let a = [2;3;1];;
<
Submarine>
with List.sort ?
<
bisby>
ok, i've tried that but stumbled on the sort predicate function. can you show me?
<
Submarine>
List.sort ( - ) [5; 3; 2; 87; 14; 1];;
<
bisby>
what's with the ( - ) part?
<
Submarine>
( - ) = fun x y -> x-y
<
Submarine>
you need a function that answers something negative if x<y, 0 if x=y, something positive if x>y
<
bisby>
can you do it with comparison function as well?
<
Submarine>
List.sort compare ...
<
bisby>
can i specify my own "unnamed" function as the predicate?
<
bisby>
something like a lamda
<
bisby>
lets say compare doesn't exist. how would you write that with List.sort as an unnamed function?
<
Submarine>
List.sort (fun x y -> foobar) [1; 6; 2]
mlh has quit [Client Quit]
<
bisby>
foobar? how does that compare?
<
Submarine>
just replace foobar by your own code
<
Submarine>
List.sort (fun x y -> x - y) [1; 6; 2]
<
Submarine>
I recommend you learn the basics of ocaml...
<
bisby>
yes, i'm trying i googled all over to find an example of how to use List.sort...
smimou has joined #ocaml
bisby has quit [Remote closed the connection]
mrsolo_ has quit [Connection timed out]
smimou has quit ["?"]
lus|wats has joined #ocaml
zzorn has joined #ocaml
<
oracle1>
if I have lots of nested pattern matching in my code is it cleaner to put them in brackets or in begin end blocks ?
gim has joined #ocaml
vezenchio has quit [Read error: 110 (Connection timed out)]
mrsolo_ has joined #ocaml
<
pango_>
oracle1: what about avoiding deep nesting in the first place ? (breaking your code in shorter functions)
wam has quit [Read error: 110 (Connection timed out)]
<
oracle1>
pango: yes I know this answer. I'm not talking about deep nesting ..only like two levels
<
pango_>
they're semantically equivalent, so there's no clear winner, it's more a matter of taste
<
pango_>
some hate the pascalish verbosity of begin end, I'm sure you'll find some that don't like nesting ()s...
<
oracle1>
ok. thanks
smimou has joined #ocaml
Riastradh has joined #ocaml
lus|wats has quit ["haibane · renmei"]
cmeme has quit [No route to host]
gim_ has joined #ocaml
gim has quit [Read error: 110 (Connection timed out)]
gim_ is now known as gim
ne1 has joined #ocaml
pango has joined #ocaml
pango_ has quit [Read error: 110 (Connection timed out)]
smimou has quit ["?"]
Submarine has quit ["Leaving"]
ne1 has quit [Read error: 110 (Connection timed out)]
ne1 has joined #ocaml
mattam has joined #ocaml
Kevin_ has joined #ocaml
Godeke has quit [tolkien.freenode.net irc.freenode.net]
Godeke has joined #ocaml
jourdechance has joined #ocaml
<
jourdechance>
hello
<
jourdechance>
I'm triing to compile some stuff under windows and cygwin, but i get this error :"cannont open pervasives.cmi".
<
jourdechance>
I have tried with "-I /cydrive/..../Objective\ Caml/lib/" but that doesn't work.
<
jourdechance>
I have wrote it under linux, and have no problem to compile it under an unix-like system.
Submarine has joined #ocaml
smimou has joined #ocaml
Kevin_ has quit ["Quit"]
mrsolo_ has quit [Read error: 110 (Connection timed out)]
mlh has joined #ocaml
smimou has quit ["?"]