Currenttype

From Mesham
Revision as of 13:49, 12 January 2013 by Polas (talk | contribs) (Semantics)
Jump to navigationJump to search

Syntax

currentype varname;

Semantics

Will return the current type of the variable.

Note: If a variable is used within a type context then this is assumed to be shorthand for the current type of that variable
Note: This is a static construct and hence only available during compilation. It must be statically deducible and not used in a manner that is dynamic.

Example

var i: Int;
var q:currentype i;

Will declare q to be an integer the same type as i.