🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.misc
Article #4768

Simula Question

#4768
From: pabuhr
Date: Fri, 03 Jul 1987 20:03
24 lines
1306 bytes
Could someone please help me with the following Simula question.
It has to do with the scope rule in Simula. I do have the SIMULA
BEGIN book but I can't find the answer after an hour of looking.
(The index in that book leaves much to be desired.) Anyway here
is the problem. I have the following definitions:

   CLASS a
      ...
   END CLASS

   CLASS b
      a CLASS c
           x   <- reference
      END CLASS
   END CLASS

The question is: if the name "x" is not defined in "c" where does
Simula look next and so on until it finally reports an undeclared
variable.  The scope search start in "c" then most likely moves to "a"
then it either goes back to "b" and then to the scope around "b" or
directly out of "a" to the scope around "a" (which is the same as the
scope around "b"). If someone knows please let me know too.

Peter Buhr
Technical Details
Message-ID: <1024@water.UUCP>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!water!pabuhr

Show Full Headers
Complete Article Headers
Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Path: arc1-ca.pugleaf.net!utzoo!utgpu!water!pabuhr
From: pabuhr@water.UUCP
Newsgroups: comp.lang.misc
Subject: Simula Question
Message-ID: <1024@water.UUCP>
Date: Fri, 3-Jul-87 16:03:49 EDT
Article-I.D.: water.1024
Posted: Fri Jul  3 16:03:49 1987
Date-Received: Sat, 4-Jul-87 16:50:24 EDT
Reply-To: pabuhr@water.UUCP ()
Distribution: world
Organization: U. of Waterloo, Ontario
Lines: 24