🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: bit.listserv.simula
Article #294

Re: value change

#294
From: Ron Kerr
Date: Tue, 25 Jun 1996 00:00
37 lines
2211 bytes
Frans Panken writes:
>
> Can anyone give me any comments on the following:
>
> Suppose a procedure activates a PROCESS CLASS with a local ARRAY "A"
> as parameter. When after activation of this process class the array
> "A" is changed within the procedure, the local array in the class
> that was just activated changes as well !
> This does not occur in the case of reals, integers, booleans etc.
>
> So, if a procedure activates a number (say N) of classes and passes
> arrays to these classes, the values in the local arrays of classes 1
> .. N-1 change into the values given to the class which was activated
> last (i.e.  class number N).
>
> This observation worries me a bit; are there any other declarations
> that will change in this manner ??

 If I understand your question correctly, the changes to the arrays
 occur only if they are transmitted to the classes "by reference", the
 default transmission mode for arrays. (Transmission by reference
 merely passes a pointer and so does not give a copy local to the class
 object.) If you specify the array parameters in the class headings as
 "value", the class objects will have local copies in the same manner
 as reals, integers, etc.

 The "value" transmission mode is not available for reference arrays.

 Hope that helps.

 Cheers....Ron

------------------------------------------------------------------------
  Ron Kerr, Computing Service, Newcastle University, NE1 7RU, England.
 Tel. +44 191 222 8187       Fax. +44 191 222 8765  (NOTE new area code)
------------------------------------------------------------------------
Technical Details
Message-ID: <199606250949.KAA19343@carr8.ncl.ac.uk>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 113dd9,1e1335de2485d616
X-Google-Attributes: gid113dd9,public
From: Ron Kerr <R.Kerr@NEWCASTLE.AC.UK>
Subject: Re: value change
Date: 1996/06/25
Message-ID: <199606250949.KAA19343@carr8.ncl.ac.uk>
X-Deja-AN: 162027866
sender: The SIMULA Language List <SIMULA@uga.cc.uga.edu>
comments: Gated by NETNEWS@AUVM.AMERICAN.EDU
content-type: text/plain; charset=US-ASCII
content-length: 1598
              jun 25, 96 11: 25:37 am
mime-version: 1.0
newsgroups: bit.listserv.simula
x-mailer: ELM [version 2.4 PL23]