[MLton-user] Re: [polyml] Order of evaluation of arguments to a function

Alex Merry alex.merry at cs.ox.ac.uk
Thu Aug 18 09:02:35 PDT 2011


On 18/08/11 16:08, Ramana Kumar wrote:
> what about evaluating f?

More testing required.  In Poly/ML, the following test produces the 
output "14253":
(print "1"; (fn () => (print "2"; fn x => (print "3"; x)))) (print "4") 
(print "5");

So the order of evaluation of (f x y) is
f
x
(f x)
y
((f x) y)

This seems like a natural evaluation order for an eager functional language.

Alex

-- 
Alexander Merry
DPhil Computer Science
Department of Computer Science
University of Oxford





More information about the MLton-user mailing list