, 2008 at 7:27 AM
Subject: Re: [Caml-list] is there a switch or cond-statement? + type-problem
To: circ ular <[EMAIL PROTECTED]>
On Wed, Sep 03, 2008 at 06:55:22AM +0200, circ ular wrote:
> thanks, not it compiles but I get this error instead:
> # powerx(5.0,2.0);;
> Cha
how can I do like this or use cond or case?
def power(nbr, po):
if po > 0:
return nbr * power(nbr, po-1)
if po < 0:
return 1 / power(nbr, -1 * po)
if po == 0:
return 1
and ofc make it tailrecursive but that I know how.
also, how do I get it to be a float-funct
how do I compile a program? what suffix does ocaml files have?
when evaling the below program I get:
# Characters 9-10:
for y = n - 1 downto 0 do
^
Unbound value n
#
let delta = sqrt epsilon_float
type vec = {x:float; y:float; z:float}
let zero
I have tried a lot of languages but never really felt 100% satisfied.
I really like Python, it makes me very productive but Iwant something
a little more functionally oriented plus a static(optionally declared)
typesystem.
I tried Haskell and I really like it but I find it hard to get used to
some
what is the difference between "let rec" and just "let"? what does rec
stand for?
are the following defintions exactly the same? at least they seem to
give the same results...
# let rec cube x = x*x*x;;
val cube : int -> int =
# cube 12;;
- : int = 1728
# let cubex x = x*x*x;;
val cubex : int -
What are the advantages/disadvantages when comparing OCaml to Haskell?
___
Caml-list mailing list. Subscription management:
http://yquem.inria.fr/cgi-bin/mailman/listinfo/caml-list
Archives: http://caml.inria.fr
Beginner's list: http://groups.yahoo.com/g