cognominal has quit [Remote closed the connection]
cognominal has joined #ocaml
bzzbzz_ has quit ["leaving"]
<araujo>
What's wrong:
<araujo>
let signum = fun x -> match x with
<araujo>
| x > 0 -> 1
<araujo>
| x < 0 -> -1
<araujo>
| _ -> 0;;
<Nutssh>
match only does destructuring and equality. You can't do predicates like 'x > 0'. You could do ' | x when x> 0 -> 1 | x when x < 0 -> -1 ... '
<araujo>
i see..
<araujo>
thanks
<araujo>
Nutssh, so, patter matching only does equeality?
<Nutssh>
Effectively, yes. It can also do destructuring. You can do predicates by using the 'when' clause.
<araujo>
Good.
<araujo>
stupid q: what is the extension of the ocaml files?
<Nutssh>
.ml for the modules and .mli for the interfaces (signatures)
ulfdoz__ has joined #ocaml
_shawn has joined #ocaml
<araujo>
Nutssh, hah, wait.. and for normal source code...
<Nutssh>
You might want to skim the ocaml manual.
<araujo>
hah, yeah :-)
<araujo>
Nutssh, it is just that ive been working so far with the repl
<Nutssh>
It sounds like you know much of what you're doing, but could use a quick overview of the language features.
<araujo>
yeah, i just got here open the user manul in my web browser
<araujo>
:-)
ulfdoz_ has quit [Read error: 110 (Connection timed out)]
<araujo>
Btw, brief comment, O'Caml rules
shawn_ has quit [Read error: 110 (Connection timed out)]
<Nutssh>
It does!
<Nutssh>
Once you've used higher order functions, it is so painful to go back
<araujo>
haha, yeah, they are very addictives
tintin has joined #ocaml
Herrchen has joined #ocaml
abl has quit [Read error: 104 (Connection reset by peer)]
abl has joined #ocaml
<ulfdoz__>
re
ulfdoz__ is now known as ulfdoz
vezenchio has quit [""Under democracy one party always devotes its chief energies to trying to prove that the other party is unfit to rule—and bot]
<Herrchen>
moin
mlh has joined #ocaml
vodka-goo has joined #ocaml
abl has quit []
Sonarman has quit ["leaving"]
Herrchen has quit ["bye"]
smimou has joined #ocaml
Gueben has joined #ocaml
<araujo>
question here, reading about pattern matching i see i can do something like:
<araujo>
(function x -> match x with | true -> false | false -> true) (3 > 4);;