Help needed with behaviour of SML..

Surendar Chandra <surendar@enuxva.eas.asu.edu>
Fri, 26 Apr 91 13:24:57 MST

          From comp.compilers

Related articles
Help needed with behaviour of SML.. surendar@enuxva.eas.asu.edu (Surendar Chandra) (1991-04-26)
Re: Help needed with behaviour of SML.. igl@ecs.soton.ac.uk (1991-04-29)
| List of all articles for this month |
Newsgroups: comp.compilers
From: Surendar Chandra <surendar@enuxva.eas.asu.edu>
Keywords: ML, question
Organization: Compilers Central
Date: Fri, 26 Apr 91 13:24:57 MST

Hi,
I need some help with the behaviour of a SML system.. I am trying to
implement a subset as part of my course project .


The following code sequence behaves as following
> 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'. Why does it store the current value of 'a' in the
function during compilation itself? Is this a spec or a implementation spec?
WHat is the logic behind this? How can you access global variables within
functions??


Thanks for any help,
surendar


--
Surendar Chandra (602) 894-2614
surendar@enuxva.eas.asu.edu
--


Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.