Yurik changed the topic of #ocaml to: http://icfpcontest.cse.ogi.edu/ -- OCaml wins | http://www.ocaml.org/ | http://caml.inria.fr/oreilly-book/ | http://icfp2002.cs.brown.edu/ | SWIG now supports OCaml| Early releases of OCamlBDB and OCamlGettext are available
lament has quit ["Did you know that God's name is ERIS, and that He is a girl?"]
skylan has quit [Read error: 54 (Connection reset by peer)]
skylan has joined #ocaml
polin8 has quit ["Lost terminal"]
mattam_ has quit ["leaving"]
docelic is now known as docelic|away
polin8 has joined #ocaml
mattam has joined #ocaml
mqbs has joined #ocaml
<mqbs> hello
<mqbs> today's my first day o'camling, so excuse this question if it seems niave: I'm writing a function to bring x to the y power, and I want to use recursion, but how do I make it stop doing (x *. x) when it hits (y - 1) times without a for loop?
<mqbs> oh shit ** is expoential function isnt it?
<mqbs> fack
asqui has quit [Read error: 110 (Connection timed out)]
<gl> let rec pow x = function y when y > 0 -> x *. pow x (y-1) | _ -> 1.0
<gl> mqbs
asqui has joined #ocaml
Torquemada has joined #ocaml
asquii has joined #ocaml
asqui has quit [Read error: 110 (Connection timed out)]
asquii has quit [Read error: 110 (Connection timed out)]
asqui has joined #ocaml
asquii has joined #ocaml
docelic|away is now known as docelic
mattam_ has joined #ocaml
mattam has quit [Read error: 60 (Operation timed out)]
asqui has quit [Read error: 110 (Connection timed out)]
asquii is now known as asqui
mattam_ has quit ["coupure..."]
mattam has joined #ocaml
TachYon26 has joined #ocaml
<mqbs> thank you gl
TachYon26 has quit [Read error: 54 (Connection reset by peer)]
<mqbs> gl: I think I understand this snippet, only I'm wondering why it takes two values when 'let rec pow x' only has one... does the 'function y' part of it enable it to take more values? also, is a value such as y always mutable without a flag when it is a function within a function?
<gl> mqbs: 'pow' takes 2 arguments.. let rec pow x = function y ... say that i match the second (function y -> blah | _ -> blablah)
<gl> mqbs: i could write it: let rec pow x y = if y < 1 then 1.0 else x *. pow x (y-1)
<gl> in fact, "let f x1 x2 ... xN = expr" is equivalent to "let f = function x1 -> function x2 -> ... -> function xN -> expr"
systems has joined #ocaml
systems has left #ocaml []
lament has joined #ocaml
merriam has quit [leguin.freenode.net irc.freenode.net]
mattam has quit [leguin.freenode.net irc.freenode.net]
asqui has quit [leguin.freenode.net irc.freenode.net]
mqbs has quit [leguin.freenode.net irc.freenode.net]
Zadeh_ has quit [leguin.freenode.net irc.freenode.net]
steele has quit [leguin.freenode.net irc.freenode.net]
smkl has quit [leguin.freenode.net irc.freenode.net]
gl has quit [leguin.freenode.net irc.freenode.net]
lament has quit [leguin.freenode.net irc.freenode.net]
mrvn has quit [leguin.freenode.net irc.freenode.net]
docelic has quit [leguin.freenode.net irc.freenode.net]
lindril has quit [leguin.freenode.net irc.freenode.net]
nkoza has quit [leguin.freenode.net irc.freenode.net]
lament has joined #ocaml
mrvn has joined #ocaml
docelic has joined #ocaml
lindril has joined #ocaml
nkoza has joined #ocaml
mattam has joined #ocaml
asqui has joined #ocaml
mqbs has joined #ocaml
Zadeh_ has joined #ocaml
steele has joined #ocaml
smkl has joined #ocaml
gl has joined #ocaml
merriam has joined #ocaml
whee has quit [Remote closed the connection]
whee has joined #ocaml
gl has left #ocaml []
gl has joined #ocaml
mqbs has quit [Read error: 104 (Connection reset by peer)]
TachYon26 has joined #ocaml
skylan has quit [Read error: 104 (Connection reset by peer)]
skylan has joined #ocaml
TachYon26 has quit [Remote closed the connection]
lament has quit [Remote closed the connection]
systems has joined #ocaml
systems has quit ["Client Exiting"]
polin8 has quit [Read error: 104 (Connection reset by peer)]
mrvn_ has joined #ocaml
Kinners has joined #ocaml
mrvn has quit [Read error: 60 (Operation timed out)]
polin8 has joined #ocaml