Oberon Community Platform Forum
December 15, 2017, 12:53:55 AM *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News:
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: Zonnon 1.3.0.0 access modifier question  (Read 1586 times)
ceekay73
Newbie
*
Posts: 2


« on: August 27, 2013, 01:50:25 PM »

while this works fine under Oberon-2 (with records), i have a problem understanding Zonnon's behavior.
small module:
>>>
module RecTst;

type {public} innerst = object
   var {public}
      one : integer{32};
end innerst;

type {public} inner = object
   var {public}
      inrst : innerst;
      two : integer{32};
end inner;

type {public} outer = object
   var {public}
      inr : inner;
      three : integer{32};
end outer;

var {public, immutable}
   otr : outer;

begin
end RecTst.
<<<

even though otr is exported as immutable, the following compiles and executes in a Main module:
>>>
module Main;

import RecTst;

begin;
   RecTst.otr.three := 3;
   RecTst.otr.inr.two := 2;
   RecTst.otr.inr.inrst.one := 1;
end Main.
<<<

shouldn't the write access be prevented by exporting otr as immutable?

thanks a lot and with kind regards,
Christian.
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.21 | SMF © 2015, Simple Machines Valid XHTML 1.0! Valid CSS!