List Info

Thread: "ocaml_beginners"::[] How to use module Num?




"ocaml_beginners"::[] How to use module Num?
user name
2007-01-06 12:22:25

I tried to use the module Num as describeb in

http://caml.inria.fr/pub/docs/manual-ocaml/libref/Num.html

But I wasn't successful.

# Num.ratio_of_num;;
Reference to undefined global `Num'
# open Num;;
# ratio_of_num;;
Reference to undefined global `Num'
# Int 0;;
- : Num.num = Int 0
# ratio_of_num (Int 0);;
Reference to undefined global `Num'
# int_of_num (Int 0);;
Reference to undefined global `Num'
#

What do I have to do to use this module?

Thanks.

hs

__._,_.___
.

__,_._,___
"ocaml_beginners"::[] How to use module Num?
user name
2007-01-06 17:03:40

On Jan 6, 2007, at 5:22 AM, Holger Schulz wrote:

> What do I have to do to use this module?

You need to load it first. From the manual:

Programs that use the num library must be linked as follows:
ocamlc [other options nums.cma other files
ocamlopt other options nums.cmxa other files
For interactive use of the nums library, do:
ocamlmktop -o mytop nums.cma
./mytop
or (if dynamic linking of C libraries is supported on your platform),
start ocaml and type #load "nums.cma";;.

William D. Neumann

"I eat T-bone steaks, I lift barbell plates, I'm sweeter than a
German chocolate cake. I'm the reflection of perfection, the number
one selection. I'm the man of the hour, the man with the power, too
sweet to be sour. The ladies' pet, the men's regret, where what you
see is what you get, and what you don't see, is better yet."

--Superstar Billy Graham

__._,_.___
.

__,_._,___
[1-2]

about | contact  Other archives ( Real Estate discussion Medical topics )