Difference between pages "Multiple" and "Directref"

From Mesham
(Difference between pages)
Jump to navigationJump to search
m (5 revisions imported)
 
 
Line 1: Line 1:
 
== Syntax ==
 
== Syntax ==
  
multiple[type]
+
directref[ ]
 
 
Where ''type'' is optional
 
  
 
== Semantics ==
 
== Semantics ==
  
Included in allocated will (with no arguments) set the specific variable to have memory allocated to all processes within current scope. This sets the variable to be private (i.e. no other processes can view it) to its allocated process.
+
This tells the compiler that the programmer might use this variable outside of the language (e.g. Via embedded C code) and not to perform certain optimisations which might not allow for this.
  
 
== Example ==
 
== Example ==
  
  function void main() {
+
  var pid:Int :: allocated[multiple[]] :: directref[];
    var i: Int :: allocated[multiple[]];
 
};
 
 
 
In this example the variable ''i'' is an integer, allocated to all processes.
 
 
 
''Since: Version 0.41b''
 
  
 
[[Category:Type Library]]
 
[[Category:Type Library]]
[[Category:Compound Types]]
+
[[Category:Composite Types]]
[[Category:Allocation Types]]
+
[[Category:Attribute Types]]

Revision as of 16:37, 12 January 2013

Syntax

directref[ ]

Semantics

This tells the compiler that the programmer might use this variable outside of the language (e.g. Via embedded C code) and not to perform certain optimisations which might not allow for this.

Example

var pid:Int :: allocated[multiple[]] :: directref[];