Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!sdd.hp.com!hplabs!otter.hpl.hp.com!hpltoad!cdollin!kers From: kers@hplb.hpl.hp.com (Chris Dollin) Newsgroups: comp.lang.functional Subject: Re: Help needed with behaviour of SML Message-ID: Date: 2 May 91 07:48:08 GMT References: <9104262016.AA28063@enuxha.eas.asu.edu> <20644@ogicse.ogi.edu> Sender: news@hplb.hpl.hp.com (Usenet News Administrator) Organization: Hewlett-Packard Laboratories, Bristol, UK. Lines: 37 In-Reply-To: bennet@ogicse.ogi.edu's message of 27 Apr 91 04:28:33 GMT Nntp-Posting-Host: cdollin.hpl.hp.com Someone writes: > ...[I] find the behavior of SML quite confusing in the following case. > > > val a = 1; > > a ; > | 1 : int ; > > fun b c = c * a ; > > b 2 ; > | 2 : int ; > > val a = 3; > > b 2 ; > | 2 : int ; > ^^^^^^^^^^ Why does it do it like this.. Why doesn't it look up at the current > value of the variable 'a'...? > Here's another one. SML is an interactive incremental development language. This means that when you find an error in a function definition, all you need to do is to redefine the function and .... 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. [*Why* is ML like this? Because it's a functional language, ie, it has no assignment, so values don't change. Apart, of course, from arrays, and references. Pah.] -- Regards, Kers. | "You're better off not dreaming of the things to come; Caravan: | Dreams are always ending far too soon."