Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!think.com!spool.mu.edu!uunet!mcsun!hp4nl!alchemy!nico From: nico@cs.ruu.nl (Nico Verwer) Newsgroups: comp.lang.functional Subject: Re: Help needed with behaviour of SML Message-ID: <1991May06.141643.17634@cs.ruu.nl> Date: 6 May 91 14:16:43 GMT Article-I.D.: cs.1991May06.141643.17634 References: <9104262016.AA28063@enuxha.eas.asu.edu> <20644@ogicse.ogi.edu> Organization: Utrecht University, Dept. of Computer Science Lines: 38 In kers@hplb.hpl.hp.com (Chris Dollin) writes: > > Why does it do it like this.. Why doesn't it look up at the current > > value of the variable 'a'...? > >Funny, this useful feature of interactive langauges seems to have gone wrong. >I'll just have to load all the code I've compiled since then. I wonder what >modules that covers? >The ML definition is fine for batch use, but for incremental development it's a >pigs trotter. No, it is very fortunate that ML does NOT have "dynamic scope rules". One point has been made before, i.e. type safety. But even if the system would enforce some form of type safety, then still the ML way of top level definitions is preferable, and I wished TeX would work this way! To illustrate this, I shall not give an example in TeX, but in functional language style. Suppose we have a functional language with a "standard prelude", which groups several useful functions, like sin, cos, tan, etcetera. I am writing a 3-D space invader game, using a function library which maps 3-D objects onto the 2-D display. This library uses functions like sin and cos. Somewhere in this program I define functions sin (for "show invader number") and cos (for "crash orbital ship"). My program will not work, because the math library will now use these functions instead of the well-known trigonometric functions. Probably, in this case I will soon find the error, but similar errors can be very hard to find. I think this `feature' is one of the worst of TeX. It won't allow me to define my own \ifx or \def, because the old definitions will be superseded by these. (Try \renewcommand{\def}{...} in LaTeX. It generates an error which is not easy to understand for the LaTeX novice.) -- Nico Verwer | nico@cs.ruu.nl Dept. of Computer Science, University of Utrecht | phone: +31 30 533921 p.o. box 80.089, 3508 TB Utrecht, The Netherlands | fax: +31 30 513791