Special variables: Difference between revisions

m (→‎{{header|Phix}}: phix/basics)
Line 1,372:
<ask>answer</ask>
</pre>
 
=={{header|Nim}}==
 
In Nim, there is only one special variable, named <code>result</code>. It is implicitly declared in procedure which returns a result and is initialized with binary zeroes. Statement <code>return value</code> is in fact a shortcut for:
<lang Nim>result = value
return</lang>
 
There are also variables declared in modules and exported. As some modules are implicitly imported, their exported variables are automatically visible. Modules implicitly imported are: “system” (which imports “iterators”, “assertions”, “dollars”, “io” and “widestr”), “threads” and “channels”, the latter two being activated if option <code>--thread:on</code> is used.
 
These implicit imports add these variables to the list of visible objects:
:– some hooks and handlers used in system programming: <code>globalRaiseHook</code>, <code>localRaiseHook</code>, <code>outOfMemHook</code>, <code>unhandledExceptionHook</code>, <code>errorMessageWriter</code>, <code>onUnhandledException</code>;
:– a read-only variable, <code>nimvm</code> which is true in Nim VM context and false otherwise;
:– the three standard files: <code>stdin</code>, <code>stdout</code>, <code>stderr</code>.
 
=={{header|OASYS}}==
Anonymous user