Transmitting parameters

Jon Fairbairn [email protected]
Fri, 02 Nov 2001 10:21:37 +0000


> At 2001-11-01 22:10, raul sierra alcocer wrote:
> =

> >What mechanism of transmiting parameters does Haskell implement?
> =

> By value.

Yes, though one might equally say that they are passed by
reference, since in

g =3D let f x =3D x+x
        z =3D factorial 1000
     in f z * z

the 'first' instance of x forces z to be evaluated and
updated, the second instance of x uses this updated value,
and so does the final occurrence of z.

-- =

J=F3n Fairbairn                                 [email protected]=
k
31 Chalmers Road                                         [email protected]
Cambridge CB1 3SZ            +44 1223 570179 (after 14:00 only, please!)