Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!uunet!world!iecc!compilers-sender From: surendar@enuxva.eas.asu.edu (Surendar Chandra) Newsgroups: comp.compilers Subject: Help needed with behaviour of SML.. Keywords: ML, question Message-ID: <9104262025.AA21840@enuxva.eas.asu.edu> Date: 26 Apr 91 20:24:57 GMT Sender: compilers-sender@iecc.cambridge.ma.us Reply-To: Surendar Chandra Organization: Compilers Central Lines: 30 Approved: compilers@iecc.cambridge.ma.us 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 -- Send compilers articles to compilers@iecc.cambridge.ma.us or {ima | spdcc | world}!iecc!compilers. Meta-mail to compilers-request.