Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!wuarchive!udel!haven.umd.edu!socrates.umd.edu!socrates!rockwell From: rockwell@socrates.umd.edu (Raul Rockwell) Newsgroups: comp.lang.functional Subject: Re: Help needed with behaviour of SML Message-ID: Date: 4 May 91 17:48:54 GMT References: <9104262016.AA28063@enuxha.eas.asu.edu> <20644@ogicse.ogi.edu> Sender: rockwell@socrates.umd.edu (Raul Rockwell) Organization: Traveller Lines: 31 In-Reply-To: kers@hplb.hpl.hp.com's message of 2 May 91 07: 48:08 GMT Shail Aditya Gupta writes: > ML's interactive script can be viewed ... with each statement being > defined in the lexical scope of all the previous ones. If you view > it this way ... it is logical and reasonable that the second > definition of "a" shadows the first, but the first had been "closed > over" in the lexical closure environment of the function "b", which > can never be destroyed, only further shadowed... Chris Dollin writes: > 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.] triple pah! (1) dynamic shadowing is just another name for changing values (2) you shouldn't be able to re-assign values in a constant array (can you??) (3) if you want to change a value referred to from a function, you probably ought to use a reference of some sort :-) Raul Rockwell Disclaimer: I'm a J person, not an ML person. I speak with a mild ignorance of the mechanics of ML.