* [Caml-list] Newbie question about type (and syntax?)
@ 2001-06-25 19:51 Johann Spies
2001-06-25 20:26 ` Remi VANICAT
[not found] ` <0106252250210K.00523@ice>
0 siblings, 2 replies; 3+ messages in thread
From: Johann Spies @ 2001-06-25 19:51 UTC (permalink / raw)
To: caml-list
I am working through a tutorial and typing in the following example
produced an error:
-------------------------------
let rec power i x =
if i = 0 then
1
else
x *. (power (i-1) x);;
This expression has type float but is here used with type int
-------------------------------------------------------
I can not see why it is an error and how to correct the code coming
from the tutorial.
Can somebody help me please?
Johann
--
J.H. Spies - Tel. 082 782 0336. Posbus 4668, Tygervallei 7536
"Honour thy father and mother; which is the first
commandment with promise; That it may be well with
thee, and thou mayest live long on the earth."
Ephesians 6:2,3
-------------------
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [Caml-list] Newbie question about type (and syntax?) 2001-06-25 19:51 [Caml-list] Newbie question about type (and syntax?) Johann Spies @ 2001-06-25 20:26 ` Remi VANICAT [not found] ` <0106252250210K.00523@ice> 1 sibling, 0 replies; 3+ messages in thread From: Remi VANICAT @ 2001-06-25 20:26 UTC (permalink / raw) To: caml-list Johann Spies <jhspies@adept.co.za> writes: > I am working through a tutorial and typing in the following example > produced an error: > > ------------------------------- > let rec power i x = > if i = 0 then > 1 > else > x *. (power (i-1) x);; > This expression has type float but is here used with type int > ------------------------------------------------------- > > I can not see why it is an error and how to correct the code coming > from the tutorial. 1 is an int. it's the problem, you should use 1. (after the then) -- Rémi Vanicat vanicat@labri.u-bordeaux.fr http://dept-info.labri.u-bordeaux.fr/~vanicat ------------------- Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/ To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr ^ permalink raw reply [flat|nested] 3+ messages in thread
[parent not found: <0106252250210K.00523@ice>]
* Re: [Caml-list] Newbie question about type (and syntax?) [not found] ` <0106252250210K.00523@ice> @ 2001-06-27 19:19 ` Johann Spies 0 siblings, 0 replies; 3+ messages in thread From: Johann Spies @ 2001-06-27 19:19 UTC (permalink / raw) To: gerd; +Cc: caml-list Many thanks to everyone answering my newbie question. It seems that the people on this list are a friendly bunch. Johann -- J.H. Spies - Tel. 082 782 0336. Posbus 4668, Tygervallei 7536 "For I am not ashamed of the gospel of Christ; for it is the power of God unto salvation to every one that believeth; to the Jew first, and also to the Greek." Romans 1:16 ------------------- Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/ To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr ^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2001-06-27 19:24 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-06-25 19:51 [Caml-list] Newbie question about type (and syntax?) Johann Spies
2001-06-25 20:26 ` Remi VANICAT
[not found] ` <0106252250210K.00523@ice>
2001-06-27 19:19 ` Johann Spies
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox