-
Notifications
You must be signed in to change notification settings - Fork 17
Open
Description
This example
functor Foo (val update : RealArray.array * int * real -> unit) =
struct
val foo = update
end
structure Foo = Foo (val update = RealArray.update);
val a = RealArray.array (3, 2.0)
val _ = (Foo.foo (a, 1, 1.0);
if Real.== (RealArray.sub (a, 1), 1.0) then print "OK\n"
else print ("WRONG (" ^ Real.toString (RealArray.sub (a, 1)) ^ ")\n"))
when executed with: mlworks -tty -no-init < test.sml
prints
MLWorks 2.1 Professional Edition
Copyright (C) 1999 Harlequin Group plc. All rights reserved.
MLWorks is a trademark of Harlequin Group plc.
MLWorks> MLWorks>> MLWorks>> MLWorks>> MLWorks>> MLWorks>> functor Foo
structure Foo =
struct
val foo : (RealArray.array * int * real) -> unit = fn
end
MLWorks> MLWorks> MLWorks>> MLWorks>> MLWorks>> MLWorks>> WRONG (7.9892357038E~312)
val a : RealArray.array = #F[2.0, 7.989235704E~312, 2.0]
the expected result is of course #F[2.0, 1.0, 2.0]
Metadata
Metadata
Assignees
Labels
No labels