Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!sdd.hp.com!hplabs!otter.hpl.hp.com!otter!sfk From: sfk@otter.hpl.hp.com (Steve Knight) Newsgroups: comp.lang.functional Subject: Re: Help needed with behaviour of SML Message-ID: <33330003@otter.hpl.hp.com> Date: 30 Apr 91 11:02:20 GMT References: <9104262016.AA28063@enuxha.eas.asu.edu> Organization: Hewlett-Packard Laboratories, Bristol, UK. Lines: 14 surendar asks about the top-level environment in SML: > Why doesn't it look up at the current > value of the variable 'a'. Why does it store the current value of 'a' in the > function during compilation itself? WHat is the logic behind this? Folks coming from other interactive environments are usually surprised by this unfortunate behaviour. Roughly speaking, being able to redefine existing top-level identifiers allows the possibility of introducing type-errors in previously type-checked functions. There are other arguments which are based on the uniformity of top-level and all other levels. I regard these as spurious. Steve