56 lines · 2.1 KB · Text
RawDownload
Known bugs and peculiarities in Moscow ML 1.40 (1 July 1995) * Under MS DOS and MS Windows, timezone information is missing.  Hence(Date.fmt "%Z" dt) raises an exception under Windows; and returnsnonsense under DOS.  This is a DOS oddity and is unlikely to be fixed. * Under MS DOS, floating point operations use a different precision orrounding mode than under Linux, so 1.0 / ~1E80 <> ~1E~80 under DOS,but not under Linux. * Under MS DOS, the FileSys.readDir family of operations sometimes getconfused if other operations are performed on directory dir betweenthe initial call to FileSys.openDir "dir" and subsequentFileSys.readDir operations.  Hence one should open, read, and closethe entire directory before performing other file operations on thesame directory.  This is a DOS oddity and is unlikely to be fixed. * The evaluation order in curried function applications is wrong,leading to wrong results if the applied function may cause sideeffects `between the arguments' of the application (reported byCarsten Mueller, Berlin).  For example, if     exception Right and Wrong    fun f y = (raise Right; fn x => x) then      f 7 (raise Wrong);  should raise exception Right, since f is applied to 7 before thesecond argument is evaluated, but it raises exception Wrong instead. The bug can be circumvented by splitting the application:     let val f1 = f 7     in f1 (raise Wrong) endor    let fun g f1 = f1 (raise Wrong)    in g (f 7) end The problem is that, in Moscow ML, the expression      f e1 ... en is evaluated by evaluating all argument expressions e1 ... en fromleft to right before f is applied to any of them.  Hence if thefunction bound to f takes m < n arguments, it gets applied too late.This causes a problem *only* if evaluation of f causes a side effect,*and* some of the arguments  e(m+1) ... en  rely on the state or causeside effects themselves. Since (1) fixing this bug in a straightforward manner would impose aconsiderable performance penalty on all curried function applications,and (2) a programming style exhibiting this bug is pretty rare (it hasnot shown up in a real program so far), we have left it in Moscow ML.