Oberon Community Platform Forum
December 14, 2019, 05:54:18 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: Procedure syntax  (Read 12597 times)
dukester
Full Member
***
Posts: 140


On Faceflow I'm dukester


« on: August 20, 2010, 12:30:26 AM »

Sawitzki in his tutorial at:

http://www.statlab.uni-heidelberg.de/projects/oberon/ItO/www/Ch04.html

writes:

Code:
PROCEDURE [*] [target] procedure name ...
Would it not be more correct to say:

Code:
PROCEDURE [* | -] [target] procedure name ...
             ^^^
?
« Last Edit: August 20, 2010, 12:34:13 AM by dukester » Logged

duke
BohdanT
Sr. Member
****
Posts: 271


Life is difficult, but fortunately is short!


WWW
« Reply #1 on: August 20, 2010, 04:35:56 PM »

Inline procedure. Example:
Code:
PROCEDURE -INT3*();
CODE{SYSTEM.i386}
INT 3
END INT3;
such a procedure code is inserted directly into place a call
Logged
dukester
Full Member
***
Posts: 140


On Faceflow I'm dukester


« Reply #2 on: August 20, 2010, 07:59:00 PM »

I thought that appending a minus sign - to any procedure name, made that procedure "read-only". Is that not correct?
Logged

duke
cfbsoftware
Full Member
***
Posts: 107


WWW
« Reply #3 on: August 21, 2010, 01:49:22 AM »

When the read-only export mark "-" was first introduced in Oberon-2 it was described as follows:

"While in Oberon all exported variables and record fields can be modified by a client module, it is possible in Oberon–2 to restrict the use of an exported variable or record field to read–only access. This is expressed by marking its declaration with a "–" instead of a "*"."

Although the syntax definition allows it, no mention was made of its use with procedure declarations. As far as I can see the only concept of readonly that is relevant to procedures in Oberon-2 applies to procedure variables not procedure declarations.

Logged

Chris Burrows
Astrobe v7.0 (Feb 2019): Oberon for ARM Cortex-M3, M4 and M7 Microcontrollers
http://www.astrobe.com
dukester
Full Member
***
Posts: 140


On Faceflow I'm dukester


« Reply #4 on: August 21, 2010, 03:39:04 AM »

It seems to me that Section 4 of "The Programming Language Oberon-2" allows any "identifier" to be exported r/w with *, or "read-only" using -. That would include a procedure name, as implied by Sawitzki, would it not? Or am I reading it wrong?
Logged

duke
cfbsoftware
Full Member
***
Posts: 107


WWW
« Reply #5 on: August 23, 2010, 12:46:09 AM »

You are not reading it wrong, but my question is why would you want to? Are you thinking that it would make a difference?

An Oberon-2 compiler is likely to allow you to mark a procedure name with '-' instead of '*' but the end result would be the same. 'read-only' is meaningless in this context.
Logged

Chris Burrows
Astrobe v7.0 (Feb 2019): Oberon for ARM Cortex-M3, M4 and M7 Microcontrollers
http://www.astrobe.com
dukester
Full Member
***
Posts: 140


On Faceflow I'm dukester


« Reply #6 on: August 23, 2010, 02:05:17 AM »

This is an excerpt from Sawitzki's tutorial:

Quote
In each module objects (types, variables, procedures) can be defined. Each object has a name which identifies it uniqely within the defining module. If access to an object should be permitted, the object has to be exported. An object is marked as exported, if the name definition has a star (*) following next to the name. For example in ItOProg01.Mod, procedure Test is defined and exported. Therefore it is possible to call it using the command ItOProg01.Test. If the name is followed by a minus (-), the information of that object can be read from modules other than the defining module, but it cannot be changed. The "read only" export gives some protection against unintended changes.

Syntax of a name declaration:
  Oberon name [*|-]

Exported objects can be used in other modules. A modification of the implementation of an exported object can hence have far reaching consequences. This can be intended, for example if the modification improves the functionality. But it can also invalidate other modules, for example if condition for calling a procedure have changed. As a safeguard against unintended modifications, changes of the export structure must be explicitly advertised upon compilation. This is done using an option \s for the compilation command. Without this option, the compiler will not generate new code if the export structure has changed. If this option is used, no additional safeguards are given and the programmer proceeds at own risk.

He talks about the "read-only" tag (?) in context of "ItOProg01.Test". I took it to mean then, that nothing within that procedure could be altered - constants, variables, whatever. So when it came to describing the syntax of a procedure using EBNF, I thought that perhaps he might have forgotten to include the "minus" read-only sign. I'm just trying to get a handle on Oberon-2's syntax. Sadly translations of technical docs oftentimes fail to do the author justice, and sometimes mis-lead. Then again, the reader could also be standing on his head while he's reading the text. Wink
Logged

duke
cfbsoftware
Full Member
***
Posts: 107


WWW
« Reply #7 on: August 23, 2010, 04:54:00 AM »

Hmm... I can understand how that description could cause confusion Sad

I recommend that you read Hanspeter Hanspeter Mössenböck's book "Object-Oriented Programming in Oberon-2" instead.
Logged

Chris Burrows
Astrobe v7.0 (Feb 2019): Oberon for ARM Cortex-M3, M4 and M7 Microcontrollers
http://www.astrobe.com
dukester
Full Member
***
Posts: 140


On Faceflow I'm dukester


« Reply #8 on: August 23, 2010, 01:55:33 PM »

Roger! Wilco! Wink

Thanks...
Logged

duke
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!