Static

From Mesham
Revision as of 16:52, 12 January 2013 by Polas (talk | contribs) (Created page with '== Syntax == static[] == Semantics == Instructs the environment to bind the associated variable to static memory. Because it is allocated into static memory, this is the same p…')
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search

Syntax

static[]

Semantics

Instructs the environment to bind the associated variable to static memory. Because it is allocated into static memory, this is the same physical memory per function call and loop iteration (environment binding only occurs once.)

Note: This type, used for function parameters or return type instructs pass by value

Example

var i:Int :: allocated[static];

In this example variable i is declared as an integer and allocated to all processes (by default) and also on static memory. Note how we have omitted the optional braces to the stack type as there are no arguments.