typeandcast
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © moebius1977

//@version=5

// @description Contains the following methods:
// _type()          - Returns the type of the variable in the forms "int", "array<int>", "matrix<linefill>"
// _type_item()     - Returns the type of the variable or of the element (for array/matrix).
// _type_struct()   - Returns the type of the structure only (i.e. "array" or "matrix"), for simple types (like e.g. `int`) returns "simple"
// tona()           - Casts na to the type of the parent object. (e.g. `intVariable.tona()` returns `int(na)` 
// cast()             - Casts int to float if sampleVar is float. Does nothing otherwise.  (May be used to cast const int literals to float in the overloaded functions based on the tyoe of other arguments, e.g. if overloaded function adds a row filled with `1` to a float or int matrix.)
library("typeandcast")


// ====== ======== ====== ======== ====== ======= ======= 
// ----    _type() / _type_item() / _type_struct() ----- {


//----------- _type () -----------{

// @function Returns type of variable in the forms "int", "array<int>", "matrix\<linefill\>"
// ```
// int n = 0
// n._type_item()           // returns "int"
// arr = array.new<int>()
// arr._type()              // returns "array<int>" 
// ```
export method _type(int                _temp)=> na(_temp) ? 'int'               : 'int'     

// @function Returns type of variable in the forms "int", "array<int>", "matrix\<linefill\>"
// ```
// int n = 0
// n._type_item()           // returns "int"
// arr = array.new<int>()
// arr._type()              // returns "array<int>" 
// ```
export method _type(float              _temp)=> na(_temp) ? 'float'             : 'float'   

// @function Returns type of variable in the forms "int", "array<int>", "matrix\<linefill\>"
// ```
// int n = 0
// n._type_item()           // returns "int"
// arr = array.new<int>()
// arr._type()              // returns "array<int>" 
// ```
export method _type(bool               _temp)=> na(_temp) ? 'bool'              : 'bool'    

// @function Returns type of variable in the forms "int", "array<int>", "matrix\<linefill\>"
// ```
// int n = 0
// n._type_item()           // returns "int"
// arr = array.new<int>()
// arr._type()              // returns "array<int>" 
// ```
export method _type(string             _temp)=> na(_temp) ? 'string'            : 'string'  

// @function Returns type of variable in the forms "int", "array<int>", "matrix\<linefill\>"
// ```
// int n = 0
// n._type_item()           // returns "int"
// arr = array.new<int>()
// arr._type()              // returns "array<int>" 
// ```
export method _type(color              _temp)=> na(_temp) ? 'color'             : 'color'   

// @function Returns type of variable in the forms "int", "array<int>", "matrix\<linefill\>"
// ```
// int n = 0
// n._type_item()           // returns "int"
// arr = array.new<int>()
// arr._type()              // returns "array<int>" 
// ```
export method _type(line               _temp)=> na(_temp) ? 'line'              : 'line'    

// @function Returns type of variable in the forms "int", "array<int>", "matrix\<linefill\>"
// ```
// int n = 0
// n._type_item()           // returns "int"
// arr = array.new<int>()
// arr._type()              // returns "array<int>" 
// ```
export method _type(label              _temp)=> na(_temp) ? 'label'             : 'label'   

// @function Returns type of variable in the forms "int", "array<int>", "matrix\<linefill\>"
// ```
// int n = 0
// n._type_item()           // returns "int"
// arr = array.new<int>()
// arr._type()              // returns "array<int>" 
// ```
export method _type(box                _temp)=> na(_temp) ? 'box'               : 'box'     

// @function Returns type of variable in the forms "int", "array<int>", "matrix\<linefill\>"
// ```
// int n = 0
// n._type_item()           // returns "int"
// arr = array.new<int>()
// arr._type()              // returns "array<int>" 
// ```
export method _type(table              _temp)=> na(_temp) ? 'table'             : 'table'   

// @function Returns type of variable in the forms "int", "array<int>", "matrix\<linefill\>"
// ```
// int n = 0
// n._type_item()           // returns "int"
// arr = array.new<int>()
// arr._type()              // returns "array<int>" 
// ```
export method _type(linefill           _temp)=> na(_temp) ? 'linefill'          : 'linefill'

// @function Returns type of variable in the forms "int", "array<int>", "matrix\<linefill\>"
// ```
// int n = 0
// n._type_item()           // returns "int"
// arr = array.new<int>()
// arr._type()              // returns "array<int>" 
// ```
export method _type(int      []        _temp)=> na(_temp) ? 'array<int>'        : 'array<int>'     

// @function Returns type of variable in the forms "int", "array<int>", "matrix\<linefill\>"
// ```
// int n = 0
// n._type_item()           // returns "int"
// arr = array.new<int>()
// arr._type()              // returns "array<int>" 
// ```
export method _type(float    []        _temp)=> na(_temp) ? 'array<float>'      : 'array<float>'   

// @function Returns type of variable in the forms "int", "array<int>", "matrix\<linefill\>"
// ```
// int n = 0
// n._type_item()           // returns "int"
// arr = array.new<int>()
// arr._type()              // returns "array<int>" 
// ```
export method _type(bool     []        _temp)=> na(_temp) ? 'array<bool>'       : 'array<bool>'    

// @function Returns type of variable in the forms "int", "array<int>", "matrix\<linefill\>"
// ```
// int n = 0
// n._type_item()           // returns "int"
// arr = array.new<int>()
// arr._type()              // returns "array<int>" 
// ```
export method _type(string   []        _temp)=> na(_temp) ? 'array<string>'     : 'array<string>'  

// @function Returns type of variable in the forms "int", "array<int>", "matrix\<linefill\>"
// ```
// int n = 0
// n._type_item()           // returns "int"
// arr = array.new<int>()
// arr._type()              // returns "array<int>" 
// ```
export method _type(color    []        _temp)=> na(_temp) ? 'array<color>'      : 'array<color>'   

// @function Returns type of variable in the forms "int", "array<int>", "matrix\<linefill\>"
// ```
// int n = 0
// n._type_item()           // returns "int"
// arr = array.new<int>()
// arr._type()              // returns "array<int>" 
// ```
export method _type(line     []        _temp)=> na(_temp) ? 'array<line>'       : 'array<line>'    

// @function Returns type of variable in the forms "int", "array<int>", "matrix\<linefill\>"
// ```
// int n = 0
// n._type_item()           // returns "int"
// arr = array.new<int>()
// arr._type()              // returns "array<int>" 
// ```
export method _type(label    []        _temp)=> na(_temp) ? 'array<label>'      : 'array<label>'   

// @function Returns type of variable in the forms "int", "array<int>", "matrix\<linefill\>"
// ```
// int n = 0
// n._type_item()           // returns "int"
// arr = array.new<int>()
// arr._type()              // returns "array<int>" 
// ```
export method _type(box      []        _temp)=> na(_temp) ? 'array<box>'        : 'array<box>'     

// @function Returns type of variable in the forms "int", "array<int>", "matrix\<linefill\>"
// ```
// int n = 0
// n._type_item()           // returns "int"
// arr = array.new<int>()
// arr._type()              // returns "array<int>" 
// ```
export method _type(table    []        _temp)=> na(_temp) ? 'array<table>'      : 'array<table>'   

// @function Returns type of variable in the forms "int", "array<int>", "matrix\<linefill\>"
// ```
// int n = 0
// n._type_item()           // returns "int"
// arr = array.new<int>()
// arr._type()              // returns "array<int>" 
// ```
export method _type(linefill []        _temp)=> na(_temp) ? 'array<linefill>'   : 'array<linefill>'

// @function Returns type of variable in the forms "int", "array<int>", "matrix\<linefill\>"
// ```
// int n = 0
// n._type_item()           // returns "int"
// arr = array.new<int>()
// arr._type()              // returns "array<int>" 
// ```
export method _type(matrix   <int>     _temp)=> na(_temp) ? 'matrix<int>'       : 'matrix<int>'                   

// @function Returns type of variable in the forms "int", "array<int>", "matrix\<linefill\>"
// ```
// int n = 0
// n._type_item()           // returns "int"
// arr = array.new<int>()
// arr._type()              // returns "array<int>" 
// ```
export method _type(matrix   <float>   _temp)=> na(_temp) ? 'matrix<float>'     : 'matrix<float>'                 

// @function Returns type of variable in the forms "int", "array<int>", "matrix\<linefill\>"
// ```
// int n = 0
// n._type_item()           // returns "int"
// arr = array.new<int>()
// arr._type()              // returns "array<int>" 
// ```
export method _type(matrix   <bool>    _temp)=> na(_temp) ? 'matrix<bool>'      : 'matrix<bool>'                  

// @function Returns type of variable in the forms "int", "array<int>", "matrix\<linefill\>"
// ```
// int n = 0
// n._type_item()           // returns "int"
// arr = array.new<int>()
// arr._type()              // returns "array<int>" 
// ```
export method _type(matrix   <string>  _temp)=> na(_temp) ? 'matrix<string>'    : 'matrix<string>'                

// @function Returns type of variable in the forms "int", "array<int>", "matrix\<linefill\>"
// ```
// int n = 0
// n._type_item()           // returns "int"
// arr = array.new<int>()
// arr._type()              // returns "array<int>" 
// ```
export method _type(matrix   <color>   _temp)=> na(_temp) ? 'matrix<color>'     : 'matrix<color>'                 

// @function Returns type of variable in the forms "int", "array<int>", "matrix\<linefill\>"
// ```
// int n = 0
// n._type_item()           // returns "int"
// arr = array.new<int>()
// arr._type()              // returns "array<int>" 
// ```
export method _type(matrix   <line>    _temp)=> na(_temp) ? 'matrix<line>'      : 'matrix<line>'                  

// @function Returns type of variable in the forms "int", "array<int>", "matrix\<linefill\>"
// ```
// int n = 0
// n._type_item()           // returns "int"
// arr = array.new<int>()
// arr._type()              // returns "array<int>" 
// ```
export method _type(matrix   <label>   _temp)=> na(_temp) ? 'matrix<label>'     : 'matrix<label>'                 

// @function Returns type of variable in the forms "int", "array<int>", "matrix\<linefill\>"
// ```
// int n = 0
// n._type_item()           // returns "int"
// arr = array.new<int>()
// arr._type()              // returns "array<int>" 
// ```
export method _type(matrix   <box>     _temp)=> na(_temp) ? 'matrix<box>'       : 'matrix<box>'                   

// @function Returns type of variable in the forms "int", "array<int>", "matrix\<linefill\>"
// ```
// int n = 0
// n._type_item()           // returns "int"
// arr = array.new<int>()
// arr._type()              // returns "array<int>" 
// ```
export method _type(matrix   <table>   _temp)=> na(_temp) ? 'matrix<table>'     : 'matrix<table>'                 

// @function Returns type of variable in the forms "int", "array<int>", "matrix\<linefill\>"
// ```
// int n = 0
// n._type_item()           // returns "int"
// arr = array.new<int>()
// arr._type()              // returns "array<int>" 
// ```
export method _type(matrix   <linefill>_temp)=> na(_temp) ? 'matrix<linefill>'  : 'matrix<linefill>'                  
// END OF _type }

//----------- _type_item () -----------{
// @function Returns type of the variable or of the element (for array/matrix).
// ```
// int n = 0
// n._type_item()    // returns "int"
// arr = array.new<int>()
// arr._type_item()  // returns "int" 
// ```
export method _type_item(int                _temp)=> na(_temp) ? 'int'               : 'int'     

// @function Returns type of the variable or of the element (for array/matrix).
// ```
// int n = 0
// n._type_item()    // returns "int"
// arr = array.new<int>()
// arr._type_item()  // returns "int" 
// ```
export method _type_item(float              _temp)=> na(_temp) ? 'float'             : 'float'   

// @function Returns type of the variable or of the element (for array/matrix).
// ```
// int n = 0
// n._type_item()    // returns "int"
// arr = array.new<int>()
// arr._type_item()  // returns "int" 
// ```
export method _type_item(bool               _temp)=> na(_temp) ? 'bool'              : 'bool'    

// @function Returns type of the variable or of the element (for array/matrix).
// ```
// int n = 0
// n._type_item()    // returns "int"
// arr = array.new<int>()
// arr._type_item()  // returns "int" 
// ```
export method _type_item(string             _temp)=> na(_temp) ? 'string'            : 'string'  

// @function Returns type of the variable or of the element (for array/matrix).
// ```
// int n = 0
// n._type_item()    // returns "int"
// arr = array.new<int>()
// arr._type_item()  // returns "int" 
// ```
export method _type_item(color              _temp)=> na(_temp) ? 'color'             : 'color'   

// @function Returns type of the variable or of the element (for array/matrix).
// ```
// int n = 0
// n._type_item()    // returns "int"
// arr = array.new<int>()
// arr._type_item()  // returns "int" 
// ```
export method _type_item(line               _temp)=> na(_temp) ? 'line'              : 'line'    

// @function Returns type of the variable or of the element (for array/matrix).
// ```
// int n = 0
// n._type_item()    // returns "int"
// arr = array.new<int>()
// arr._type_item()  // returns "int" 
// ```
export method _type_item(label              _temp)=> na(_temp) ? 'label'             : 'label'   

// @function Returns type of the variable or of the element (for array/matrix).
// ```
// int n = 0
// n._type_item()    // returns "int"
// arr = array.new<int>()
// arr._type_item()  // returns "int" 
// ```
export method _type_item(box                _temp)=> na(_temp) ? 'box'               : 'box'     

// @function Returns type of the variable or of the element (for array/matrix).
// ```
// int n = 0
// n._type_item()    // returns "int"
// arr = array.new<int>()
// arr._type_item()  // returns "int" 
// ```
export method _type_item(table              _temp)=> na(_temp) ? 'table'             : 'table'   

// @function Returns type of the variable or of the element (for array/matrix).
// ```
// int n = 0
// n._type_item()    // returns "int"
// arr = array.new<int>()
// arr._type_item()  // returns "int" 
// ```
export method _type_item(linefill           _temp)=> na(_temp) ? 'linefill'          : 'linefill'

// @function Returns type of the variable or of the element (for array/matrix).
// ```
// int n = 0
// n._type_item()    // returns "int"
// arr = array.new<int>()
// arr._type_item()  // returns "int" 
// ```
export method _type_item(int      []        _temp)=> na(_temp) ? 'int'               : 'int'     

// @function Returns type of the variable or of the element (for array/matrix).
// ```
// int n = 0
// n._type_item()    // returns "int"
// arr = array.new<int>()
// arr._type_item()  // returns "int" 
// ```
export method _type_item(float    []        _temp)=> na(_temp) ? 'float'             : 'float'   

// @function Returns type of the variable or of the element (for array/matrix).
// ```
// int n = 0
// n._type_item()    // returns "int"
// arr = array.new<int>()
// arr._type_item()  // returns "int" 
// ```
export method _type_item(bool     []        _temp)=> na(_temp) ? 'bool'              : 'bool'    

// @function Returns type of the variable or of the element (for array/matrix).
// ```
// int n = 0
// n._type_item()    // returns "int"
// arr = array.new<int>()
// arr._type_item()  // returns "int" 
// ```
export method _type_item(string   []        _temp)=> na(_temp) ? 'string'            : 'string'  

// @function Returns type of the variable or of the element (for array/matrix).
// ```
// int n = 0
// n._type_item()    // returns "int"
// arr = array.new<int>()
// arr._type_item()  // returns "int" 
// ```
export method _type_item(color    []        _temp)=> na(_temp) ? 'color'             : 'color'   

// @function Returns type of the variable or of the element (for array/matrix).
// ```
// int n = 0
// n._type_item()    // returns "int"
// arr = array.new<int>()
// arr._type_item()  // returns "int" 
// ```
export method _type_item(line     []        _temp)=> na(_temp) ? 'line'              : 'line'    

// @function Returns type of the variable or of the element (for array/matrix).
// ```
// int n = 0
// n._type_item()    // returns "int"
// arr = array.new<int>()
// arr._type_item()  // returns "int" 
// ```
export method _type_item(label    []        _temp)=> na(_temp) ? 'label'             : 'label'   

// @function Returns type of the variable or of the element (for array/matrix).
// ```
// int n = 0
// n._type_item()    // returns "int"
// arr = array.new<int>()
// arr._type_item()  // returns "int" 
// ```
export method _type_item(box      []        _temp)=> na(_temp) ? 'box'               : 'box'     

// @function Returns type of the variable or of the element (for array/matrix).
// ```
// int n = 0
// n._type_item()    // returns "int"
// arr = array.new<int>()
// arr._type_item()  // returns "int" 
// ```
export method _type_item(table    []        _temp)=> na(_temp) ? 'table'             : 'table'   

// @function Returns type of the variable or of the element (for array/matrix).
// ```
// int n = 0
// n._type_item()    // returns "int"
// arr = array.new<int>()
// arr._type_item()  // returns "int" 
// ```
export method _type_item(linefill []        _temp)=> na(_temp) ? 'linefill'          : 'linefill'

// @function Returns type of the variable or of the element (for array/matrix).
// ```
// int n = 0
// n._type_item()    // returns "int"
// arr = array.new<int>()
// arr._type_item()  // returns "int" 
// ```
export method _type_item(matrix   <int>     _temp)=> na(_temp) ? 'int'               : 'int'                 

// @function Returns type of the variable or of the element (for array/matrix).
// ```
// int n = 0
// n._type_item()    // returns "int"
// arr = array.new<int>()
// arr._type_item()  // returns "int" 
// ```
export method _type_item(matrix   <float>   _temp)=> na(_temp) ? 'float'             : 'float'               

// @function Returns type of the variable or of the element (for array/matrix).
// ```
// int n = 0
// n._type_item()    // returns "int"
// arr = array.new<int>()
// arr._type_item()  // returns "int" 
// ```
export method _type_item(matrix   <bool>    _temp)=> na(_temp) ? 'bool'              : 'bool'                

// @function Returns type of the variable or of the element (for array/matrix).
// ```
// int n = 0
// n._type_item()    // returns "int"
// arr = array.new<int>()
// arr._type_item()  // returns "int" 
// ```
export method _type_item(matrix   <string>  _temp)=> na(_temp) ? 'string'            : 'string'              

// @function Returns type of the variable or of the element (for array/matrix).
// ```
// int n = 0
// n._type_item()    // returns "int"
// arr = array.new<int>()
// arr._type_item()  // returns "int" 
// ```
export method _type_item(matrix   <color>   _temp)=> na(_temp) ? 'color'             : 'color'               

// @function Returns type of the variable or of the element (for array/matrix).
// ```
// int n = 0
// n._type_item()    // returns "int"
// arr = array.new<int>()
// arr._type_item()  // returns "int" 
// ```
export method _type_item(matrix   <line>    _temp)=> na(_temp) ? 'line'              : 'line'                

// @function Returns type of the variable or of the element (for array/matrix).
// ```
// int n = 0
// n._type_item()    // returns "int"
// arr = array.new<int>()
// arr._type_item()  // returns "int" 
// ```
export method _type_item(matrix   <label>   _temp)=> na(_temp) ? 'label'             : 'label'               

// @function Returns type of the variable or of the element (for array/matrix).
// ```
// int n = 0
// n._type_item()    // returns "int"
// arr = array.new<int>()
// arr._type_item()  // returns "int" 
// ```
export method _type_item(matrix   <box>     _temp)=> na(_temp) ? 'box'               : 'box'                 

// @function Returns type of the variable or of the element (for array/matrix).
// ```
// int n = 0
// n._type_item()    // returns "int"
// arr = array.new<int>()
// arr._type_item()  // returns "int" 
// ```
export method _type_item(matrix   <table>   _temp)=> na(_temp) ? 'table'             : 'table'               

// @function Returns type of the variable or of the element (for array/matrix).
// ```
// int n = 0
// n._type_item()    // returns "int"
// arr = array.new<int>()
// arr._type_item()  // returns "int" 
// ```
export method _type_item(matrix   <linefill>_temp)=> na(_temp) ? 'linefill'          : 'linefill'                
// END OF _type_item }


//----------- _type_struct () -----------{
// @function Returns type of the structure only ("array" or "matrix"), for simple types (like e.g. `int`) returns "simple"
// ```
// int n = 0
// n._type_struct()    // returns "simple"
// arr = array.new<int>()
// arr._type_struct()  // returns "array" 
// ```
export method _type_struct(int                _temp)=> na(_temp) ? 'simple'  : 'simple'     

// @function Returns type of the structure only ("array" or "matrix"), for simple types (like e.g. `int`) returns "simple"
// ```
// int n = 0
// n._type_struct()    // returns "simple"
// arr = array.new<int>()
// arr._type_struct()  // returns "array" 
// ```
export method _type_struct(float              _temp)=> na(_temp) ? 'simple'  : 'simple'   

// @function Returns type of the structure only ("array" or "matrix"), for simple types (like e.g. `int`) returns "simple"
// ```
// int n = 0
// n._type_struct()    // returns "simple"
// arr = array.new<int>()
// arr._type_struct()  // returns "array" 
// ```
export method _type_struct(bool               _temp)=> na(_temp) ? 'simple'  : 'simple'    

// @function Returns type of the structure only ("array" or "matrix"), for simple types (like e.g. `int`) returns "simple"
// ```
// int n = 0
// n._type_struct()    // returns "simple"
// arr = array.new<int>()
// arr._type_struct()  // returns "array" 
// ```
export method _type_struct(string             _temp)=> na(_temp) ? 'simple'  : 'simple'  

// @function Returns type of the structure only ("array" or "matrix"), for simple types (like e.g. `int`) returns "simple"
// ```
// int n = 0
// n._type_struct()    // returns "simple"
// arr = array.new<int>()
// arr._type_struct()  // returns "array" 
// ```
export method _type_struct(color              _temp)=> na(_temp) ? 'simple'  : 'simple'   

// @function Returns type of the structure only ("array" or "matrix"), for simple types (like e.g. `int`) returns "simple"
// ```
// int n = 0
// n._type_struct()    // returns "simple"
// arr = array.new<int>()
// arr._type_struct()  // returns "array" 
// ```
export method _type_struct(line               _temp)=> na(_temp) ? 'simple'  : 'simple'    

// @function Returns type of the structure only ("array" or "matrix"), for simple types (like e.g. `int`) returns "simple"
// ```
// int n = 0
// n._type_struct()    // returns "simple"
// arr = array.new<int>()
// arr._type_struct()  // returns "array" 
// ```
export method _type_struct(label              _temp)=> na(_temp) ? 'simple'  : 'simple'   

// @function Returns type of the structure only ("array" or "matrix"), for simple types (like e.g. `int`) returns "simple"
// ```
// int n = 0
// n._type_struct()    // returns "simple"
// arr = array.new<int>()
// arr._type_struct()  // returns "array" 
// ```
export method _type_struct(box                _temp)=> na(_temp) ? 'simple'  : 'simple'     

// @function Returns type of the structure only ("array" or "matrix"), for simple types (like e.g. `int`) returns "simple"
// ```
// int n = 0
// n._type_struct()    // returns "simple"
// arr = array.new<int>()
// arr._type_struct()  // returns "array" 
// ```
export method _type_struct(table              _temp)=> na(_temp) ? 'simple'  : 'simple'   

// @function Returns type of the structure only ("array" or "matrix"), for simple types (like e.g. `int`) returns "simple"
// ```
// int n = 0
// n._type_struct()    // returns "simple"
// arr = array.new<int>()
// arr._type_struct()  // returns "array" 
// ```
export method _type_struct(linefill           _temp)=> na(_temp) ? 'simple'  : 'simple'

// @function Returns type of the structure only ("array" or "matrix"), for simple types (like e.g. `int`) returns "simple"
// ```
// int n = 0
// n._type_struct()    // returns "simple"
// arr = array.new<int>()
// arr._type_struct()  // returns "array" 
// ```
export method _type_struct(int      []        _temp)=> na(_temp) ? 'array'   : 'array'

// @function Returns type of the structure only ("array" or "matrix"), for simple types (like e.g. `int`) returns "simple"
// ```
// int n = 0
// n._type_struct()    // returns "simple"
// arr = array.new<int>()
// arr._type_struct()  // returns "array" 
// ```
export method _type_struct(float    []        _temp)=> na(_temp) ? 'array'   : 'array'

// @function Returns type of the structure only ("array" or "matrix"), for simple types (like e.g. `int`) returns "simple"
// ```
// int n = 0
// n._type_struct()    // returns "simple"
// arr = array.new<int>()
// arr._type_struct()  // returns "array" 
// ```
export method _type_struct(bool     []        _temp)=> na(_temp) ? 'array'   : 'array'

// @function Returns type of the structure only ("array" or "matrix"), for simple types (like e.g. `int`) returns "simple"
// ```
// int n = 0
// n._type_struct()    // returns "simple"
// arr = array.new<int>()
// arr._type_struct()  // returns "array" 
// ```
export method _type_struct(string   []        _temp)=> na(_temp) ? 'array'   : 'array'

// @function Returns type of the structure only ("array" or "matrix"), for simple types (like e.g. `int`) returns "simple"
// ```
// int n = 0
// n._type_struct()    // returns "simple"
// arr = array.new<int>()
// arr._type_struct()  // returns "array" 
// ```
export method _type_struct(color    []        _temp)=> na(_temp) ? 'array'   : 'array'

// @function Returns type of the structure only ("array" or "matrix"), for simple types (like e.g. `int`) returns "simple"
// ```
// int n = 0
// n._type_struct()    // returns "simple"
// arr = array.new<int>()
// arr._type_struct()  // returns "array" 
// ```
export method _type_struct(line     []        _temp)=> na(_temp) ? 'array'   : 'array'

// @function Returns type of the structure only ("array" or "matrix"), for simple types (like e.g. `int`) returns "simple"
// ```
// int n = 0
// n._type_struct()    // returns "simple"
// arr = array.new<int>()
// arr._type_struct()  // returns "array" 
// ```
export method _type_struct(label    []        _temp)=> na(_temp) ? 'array'   : 'array'

// @function Returns type of the structure only ("array" or "matrix"), for simple types (like e.g. `int`) returns "simple"
// ```
// int n = 0
// n._type_struct()    // returns "simple"
// arr = array.new<int>()
// arr._type_struct()  // returns "array" 
// ```
export method _type_struct(box      []        _temp)=> na(_temp) ? 'array'   : 'array'

// @function Returns type of the structure only ("array" or "matrix"), for simple types (like e.g. `int`) returns "simple"
// ```
// int n = 0
// n._type_struct()    // returns "simple"
// arr = array.new<int>()
// arr._type_struct()  // returns "array" 
// ```
export method _type_struct(table    []        _temp)=> na(_temp) ? 'array'   : 'array'

// @function Returns type of the structure only ("array" or "matrix"), for simple types (like e.g. `int`) returns "simple"
// ```
// int n = 0
// n._type_struct()    // returns "simple"
// arr = array.new<int>()
// arr._type_struct()  // returns "array" 
// ```
export method _type_struct(linefill []        _temp)=> na(_temp) ? 'array'   : 'array'

// @function Returns type of the structure only ("array" or "matrix"), for simple types (like e.g. `int`) returns "simple"
// ```
// int n = 0
// n._type_struct()    // returns "simple"
// arr = array.new<int>()
// arr._type_struct()  // returns "array" 
// ```
export method _type_struct(matrix   <int>     _temp)=> na(_temp) ? 'matrix'  : 'matrix'

// @function Returns type of the structure only ("array" or "matrix"), for simple types (like e.g. `int`) returns "simple"
// ```
// int n = 0
// n._type_struct()    // returns "simple"
// arr = array.new<int>()
// arr._type_struct()  // returns "array" 
// ```
export method _type_struct(matrix   <float>   _temp)=> na(_temp) ? 'matrix'  : 'matrix'

// @function Returns type of the structure only ("array" or "matrix"), for simple types (like e.g. `int`) returns "simple"
// ```
// int n = 0
// n._type_struct()    // returns "simple"
// arr = array.new<int>()
// arr._type_struct()  // returns "array" 
// ```
export method _type_struct(matrix   <bool>    _temp)=> na(_temp) ? 'matrix'  : 'matrix'

// @function Returns type of the structure only ("array" or "matrix"), for simple types (like e.g. `int`) returns "simple"
// ```
// int n = 0
// n._type_struct()    // returns "simple"
// arr = array.new<int>()
// arr._type_struct()  // returns "array" 
// ```
export method _type_struct(matrix   <string>  _temp)=> na(_temp) ? 'matrix'  : 'matrix'

// @function Returns type of the structure only ("array" or "matrix"), for simple types (like e.g. `int`) returns "simple"
// ```
// int n = 0
// n._type_struct()    // returns "simple"
// arr = array.new<int>()
// arr._type_struct()  // returns "array" 
// ```
export method _type_struct(matrix   <color>   _temp)=> na(_temp) ? 'matrix'  : 'matrix'

// @function Returns type of the structure only ("array" or "matrix"), for simple types (like e.g. `int`) returns "simple"
// ```
// int n = 0
// n._type_struct()    // returns "simple"
// arr = array.new<int>()
// arr._type_struct()  // returns "array" 
// ```
export method _type_struct(matrix   <line>    _temp)=> na(_temp) ? 'matrix'  : 'matrix'

// @function Returns type of the structure only ("array" or "matrix"), for simple types (like e.g. `int`) returns "simple"
// ```
// int n = 0
// n._type_struct()    // returns "simple"
// arr = array.new<int>()
// arr._type_struct()  // returns "array" 
// ```
export method _type_struct(matrix   <label>   _temp)=> na(_temp) ? 'matrix'  : 'matrix'

// @function Returns type of the structure only ("array" or "matrix"), for simple types (like e.g. `int`) returns "simple"
// ```
// int n = 0
// n._type_struct()    // returns "simple"
// arr = array.new<int>()
// arr._type_struct()  // returns "array" 
// ```
export method _type_struct(matrix   <box>     _temp)=> na(_temp) ? 'matrix'  : 'matrix'

// @function Returns type of the structure only ("array" or "matrix"), for simple types (like e.g. `int`) returns "simple"
// ```
// int n = 0
// n._type_struct()    // returns "simple"
// arr = array.new<int>()
// arr._type_struct()  // returns "array" 
// ```
export method _type_struct(matrix   <table>   _temp)=> na(_temp) ? 'matrix'  : 'matrix'

// @function Returns type of the structure only ("array" or "matrix"), for simple types (like e.g. `int`) returns "simple"
// ```
// int n = 0
// n._type_struct()    // returns "simple"
// arr = array.new<int>()
// arr._type_struct()  // returns "array" 
// ```
export method _type_struct(matrix   <linefill>_temp)=> na(_temp) ? 'matrix'  : 'matrix'
// END OF _type_struct }

// END OF _type }
// ====== ======== ====== ======== ====== ======= ======= 


// ====== ======== ====== ======== ====== ======= 
// ---------------     tona()      -------------- {
// @function Returns na of the same type. 
//```
// int n = 0
// n.tona() // returns int(na)
//```
export method tona(int                _temp)=> na(_temp) ? int       (na)     :  int       (na)  

// @function Returns na value of the same type. (e.g. `intVariable.tona()` returns `int(na)` 
//```
// int n = 0
// n.tona() // returns int(na)
//```
export method tona(float              _temp)=> na(_temp) ? float     (na)     :  float     (na)  

// @function Returns na value of the same type. (e.g. `intVariable.tona()` returns `int(na)` 
//```
// int n = 0
// n.tona() // returns int(na)
//```
export method tona(bool               _temp)=> na(_temp) ? bool      (na)     :  bool      (na)  

// @function Returns na value of the same type. (e.g. `intVariable.tona()` returns `int(na)` 
//```
// int n = 0
// n.tona() // returns int(na)
//```
export method tona(string             _temp)=> na(_temp) ? string    (na)     :  string    (na)  

// @function Returns na value of the same type. (e.g. `intVariable.tona()` returns `int(na)` 
//```
// int n = 0
// n.tona() // returns int(na)
//```
export method tona(color              _temp)=> na(_temp) ? color     (na)     :  color     (na)  

// @function Returns na value of the same type. (e.g. `intVariable.tona()` returns `int(na)` 
//```
// int n = 0
// n.tona() // returns int(na)
//```
export method tona(line               _temp)=> na(_temp) ? line      (na)     :  line      (na)  

// @function Returns na value of the same type. (e.g. `intVariable.tona()` returns `int(na)` 
//```
// int n = 0
// n.tona() // returns int(na)
//```
export method tona(label              _temp)=> na(_temp) ? label     (na)     :  label     (na)  

// @function Returns na value of the same type. (e.g. `intVariable.tona()` returns `int(na)` 
//```
// int n = 0
// n.tona() // returns int(na)
//```
export method tona(box                _temp)=> na(_temp) ? box       (na)     :  box       (na)  

// @function Returns na value of the same type. (e.g. `intVariable.tona()` returns `int(na)` 
//```
// int n = 0
// n.tona() // returns int(na)
//```
export method tona(table              _temp)=> na(_temp) ? table     (na)     :  table     (na)  

// somehow does not work for linefill.....
//export method tona(linefill           _temp)=> na(_temp) ? linefill  (na)     :  linefill  (na)  



// @function Returns na value of the same type. (e.g. `intVariable.tona()` returns `int(na)` 
//```
// int n = 0
// n.tona() // returns int(na)
//```
_n(linefill i)=> [i, linefill (na)] // thanks to ©kaigouthro
export method tona(linefill           _temp)=> [_tmp, _na] = _n(_temp), _na








// @function Returns na value of the same type as the elements of the parent array. E.g. `arrayFloat.tona()` returns `float(na)`.
//```
// int n = 0
// n.tona() // returns int(na)
//```
export method tona(int      [] _temp)=> na(_temp) ? int      (na)     :  int      (na)  

// @function Returns na value of the same type as the elements of the parent array. E.g. `arrayFloat.tona()` returns `float(na)`.
export method tona(float    [] _temp)=> na(_temp) ? float    (na)     :  float    (na)  

// @function Returns na value of the same type as the elements of the parent array. E.g. `arrayFloat.tona()` returns `float(na)`.
export method tona(bool     [] _temp)=> na(_temp) ? bool     (na)     :  bool     (na)  

// @function Returns na value of the same type as the elements of the parent array. E.g. `arrayFloat.tona()` returns `float(na)`.
export method tona(string   [] _temp)=> na(_temp) ? string   (na)     :  string   (na)  

// @function Returns na value of the same type as the elements of the parent array. E.g. `arrayFloat.tona()` returns `float(na)`.
export method tona(color    [] _temp)=> na(_temp) ? color    (na)     :  color    (na)  

// @function Returns na value of the same type as the elements of the parent array. E.g. `arrayFloat.tona()` returns `float(na)`.
export method tona(line     [] _temp)=> na(_temp) ? line     (na)     :  line     (na)  

// @function Returns na value of the same type as the elements of the parent array. E.g. `arrayFloat.tona()` returns `float(na)`.
export method tona(label    [] _temp)=> na(_temp) ? label    (na)     :  label    (na)  

// @function Returns na value of the same type as the elements of the parent array. E.g. `arrayFloat.tona()` returns `float(na)`.
export method tona(box      [] _temp)=> na(_temp) ? box      (na)     :  box      (na)  

// @function Returns na value of the same type as the elements of the parent array. E.g. `arrayFloat.tona()` returns `float(na)`.
export method tona(table    [] _temp)=> na(_temp) ? table    (na)     :  table    (na)  

// @function Returns na value of the same type as the elements of the parent array. E.g. `arrayFloat.tona()` returns `float(na)`.
_n(linefill[] i)=> [i, linefill (na)] // thanks to ©kaigouthro
export method tona(linefill[]           _temp)=> [_tmp, _na] = _n(_temp), _na





// @function Returns na value of the same type as the elements of the parent matrix. E.g. `matrixFloat.tona()` returns `float(na)`.
export method tona(matrix<int   >    _temp)=> na(_temp) ? int      (na)     :  int      (na)  

// @function Returns na value of the same type as the elements of the parent matrix. E.g. `matrixFloat.tona()` returns `float(na)`.
export method tona(matrix<float >    _temp)=> na(_temp) ? float    (na)     :  float    (na)  

// @function Returns na value of the same type as the elements of the parent matrix. E.g. `matrixFloat.tona()` returns `float(na)`.
export method tona(matrix<bool  >    _temp)=> na(_temp) ? bool     (na)     :  bool     (na)  

// @function Returns na value of the same type as the elements of the parent matrix. E.g. `matrixFloat.tona()` returns `float(na)`.
export method tona(matrix<string>    _temp)=> na(_temp) ? string   (na)     :  string   (na)  

// @function Returns na value of the same type as the elements of the parent matrix. E.g. `matrixFloat.tona()` returns `float(na)`.
export method tona(matrix<color >    _temp)=> na(_temp) ? color    (na)     :  color    (na)  

// @function Returns na value of the same type as the elements of the parent matrix. E.g. `matrixFloat.tona()` returns `float(na)`.
export method tona(matrix<line  >    _temp)=> na(_temp) ? line     (na)     :  line     (na)  

// @function Returns na value of the same type as the elements of the parent matrix. E.g. `matrixFloat.tona()` returns `float(na)`.
export method tona(matrix<label >    _temp)=> na(_temp) ? label    (na)     :  label    (na)  

// @function Returns na value of the same type as the elements of the parent matrix. E.g. `matrixFloat.tona()` returns `float(na)`.
export method tona(matrix<box   >    _temp)=> na(_temp) ? box      (na)     :  box      (na)  

// @function Returns na value of the same type as the elements of the parent matrix. E.g. `matrixFloat.tona()` returns `float(na)`.
export method tona(matrix<table >    _temp)=> na(_temp) ? table    (na)     :  table    (na)  

// @function Returns na value of the same type as the elements of the parent matrix. E.g. `matrixFloat.tona()` returns `float(na)`.
_n(matrix<linefill> i)=> [i, linefill (na)] // thanks to ©kaigouthro
export method tona(matrix<linefill>           _temp)=> [_tmp, _na] = _n(_temp), _na





// END OF tona() }
// ====== ======== ====== ======== ====== ======= 



// ====== ======== ====== ======== ====== ======= 
// ---------------     cast(int, sampleVar)      -------------- {
// @function Casts int to float if sampleVar is float. Does nothing otherwise.  (May be used to cast const int literals to float in the overloaded functions based on the tyoe of other arguments, e.g. if overloaded function adds a row filled with `1` to a float or int matrix.)
export method cast(int     v, int            sampleVar)    => na(sampleVar) ? v               : v
export method cast(int     v, array<int>     sampleVar)    => na(sampleVar) ? v               : v  
export method cast(int     v, matrix<int>    sampleVar)    => na(sampleVar) ? v               : v  
export method cast(int     v, float          sampleVar)    => na(sampleVar) ? float(v)        : float(v)
export method cast(int     v, array<float>   sampleVar)    => na(sampleVar) ? float(v)        : float(v)
export method cast(int     v, matrix<float>  sampleVar)    => na(sampleVar) ? float(v)        : float(v)
export method cast(float   v, int            sampleVar)    => na(sampleVar) ? v               : v
export method cast(float   v, array<int>     sampleVar)    => na(sampleVar) ? v               : v  
export method cast(float   v, matrix<int>    sampleVar)    => na(sampleVar) ? v               : v  
export method cast(float   v, float          sampleVar)    => na(sampleVar) ? v               : v  
export method cast(float   v, array<float>   sampleVar)    => na(sampleVar) ? v               : v   
export method cast(float   v, matrix<float>  sampleVar)    => na(sampleVar) ? v               : v   
// END OF cast() }
// ====== ======== ====== ======== ====== ======= 


// ++++++++++++++ ++++++++++++++  ---- ++++++++++++++ ++++++++++++++ 
// ||  ||  ||  ||  ||  ||  ||     DEMO    ||  ||  ||  ||  ||  ||  ||  {


int intN = 2
arrayString = array.new<string>() 
arrayLine = array.new<line>() 
matrixFloat = matrix.new<color>()
linefill[] arrayLinefill = na
matrix<linefill>  matrixLinefill = na

if barstate.islastconfirmedhistory
    s = str.format("
                  intN._type() = {0} \n
                  intN.tona()._type() ={1} \n 
                  arrayString._type() = {2} \n
                  arrayLine._type_item() = {3} \n
                  matrixFloat._type_struct() = {4} \n
                  matrixFloat.tona()._type() = {5} \n
                  arrayLinefill.tona()._type() = {6}\n 
                  matrixLinefill.tona()._type() = {7} 
                  "
                  , intN._type()
                  , intN.tona()._type()
                  , arrayString._type()
                  , arrayLine._type_item() 
                  , matrixFloat._type_struct() 
                  , matrixFloat.tona()._type() 
                  , arrayLinefill.tona()._type() 
                  , matrixLinefill.tona()._type()
                  )

    lbl = label.new(bar_index, high, s, color = color.rgb(206, 255, 199), text_font_family = font.family_monospace, textcolor = color.rgb(64, 64, 64))




// END OF DEMO }
// ++++++++++++++ ++++++++++++++  ---- ++++++++++++++ ++++++++++++++ 


// CONDENSED CODE (without descriptions, easier for bulk editing)

// // ====== ======== ====== ======== ====== ======= ======= 
// // ----    _type() / _type_item() / _type_struct() ----- {


// //----------- _type () -----------{

// // @function Returns type of variable in the forms "int", "array<int>", "matrix\<linefill\>"
// // ```
// // int n = 0
// // n._type_item()           // returns "int"
// // arr = array.new<int>()
// // arr._type()              // returns "array<int>" 
// // ```
// export method _type(int                _temp)=> na(_temp) ? 'int'               : 'int'     
// export method _type(float              _temp)=> na(_temp) ? 'float'             : 'float'   
// export method _type(bool               _temp)=> na(_temp) ? 'bool'              : 'bool'    
// export method _type(string             _temp)=> na(_temp) ? 'string'            : 'string'  
// export method _type(color              _temp)=> na(_temp) ? 'color'             : 'color'   
// export method _type(line               _temp)=> na(_temp) ? 'line'              : 'line'    
// export method _type(label              _temp)=> na(_temp) ? 'label'             : 'label'   
// export method _type(box                _temp)=> na(_temp) ? 'box'               : 'box'     
// export method _type(table              _temp)=> na(_temp) ? 'table'             : 'table'   
// export method _type(linefill           _temp)=> na(_temp) ? 'linefill'          : 'linefill'
// export method _type(int      []        _temp)=> na(_temp) ? 'array<int>'        : 'array<int>'     
// export method _type(float    []        _temp)=> na(_temp) ? 'array<float>'      : 'array<float>'   
// export method _type(bool     []        _temp)=> na(_temp) ? 'array<bool>'       : 'array<bool>'    
// export method _type(string   []        _temp)=> na(_temp) ? 'array<string>'     : 'array<string>'  
// export method _type(color    []        _temp)=> na(_temp) ? 'array<color>'      : 'array<color>'   
// export method _type(line     []        _temp)=> na(_temp) ? 'array<line>'       : 'array<line>'    
// export method _type(label    []        _temp)=> na(_temp) ? 'array<label>'      : 'array<label>'   
// export method _type(box      []        _temp)=> na(_temp) ? 'array<box>'        : 'array<box>'     
// export method _type(table    []        _temp)=> na(_temp) ? 'array<table>'      : 'array<table>'   
// export method _type(linefill []        _temp)=> na(_temp) ? 'array<linefill>'   : 'array<linefill>'
// export method _type(matrix   <int>     _temp)=> na(_temp) ? 'matrix<int>'       : 'matrix<int>'                   
// export method _type(matrix   <float>   _temp)=> na(_temp) ? 'matrix<float>'     : 'matrix<float>'                 
// export method _type(matrix   <bool>    _temp)=> na(_temp) ? 'matrix<bool>'      : 'matrix<bool>'                  
// export method _type(matrix   <string>  _temp)=> na(_temp) ? 'matrix<string>'    : 'matrix<string>'                
// export method _type(matrix   <color>   _temp)=> na(_temp) ? 'matrix<color>'     : 'matrix<color>'                 
// export method _type(matrix   <line>    _temp)=> na(_temp) ? 'matrix<line>'      : 'matrix<line>'                  
// export method _type(matrix   <label>   _temp)=> na(_temp) ? 'matrix<label>'     : 'matrix<label>'                 
// export method _type(matrix   <box>     _temp)=> na(_temp) ? 'matrix<box>'       : 'matrix<box>'                   
// export method _type(matrix   <table>   _temp)=> na(_temp) ? 'matrix<table>'     : 'matrix<table>'                 
// export method _type(matrix   <linefill>_temp)=> na(_temp) ? 'matrix<linefill>'  : 'matrix<linefill>'                  
// // END OF _type }

// //----------- _type_item () -----------{
// // @function Returns type of variable or the element for array/matrix.
// // ```
// // int n = 0
// // n._type_item()    // returns "int"
// // arr = array.new<int>()
// // arr._type_item()  // returns "int" 
// // ```
// export method _type_item(int                _temp)=> na(_temp) ? 'int'               : 'int'     
// export method _type_item(float              _temp)=> na(_temp) ? 'float'             : 'float'   
// export method _type_item(bool               _temp)=> na(_temp) ? 'bool'              : 'bool'    
// export method _type_item(string             _temp)=> na(_temp) ? 'string'            : 'string'  
// export method _type_item(color              _temp)=> na(_temp) ? 'color'             : 'color'   
// export method _type_item(line               _temp)=> na(_temp) ? 'line'              : 'line'    
// export method _type_item(label              _temp)=> na(_temp) ? 'label'             : 'label'   
// export method _type_item(box                _temp)=> na(_temp) ? 'box'               : 'box'     
// export method _type_item(table              _temp)=> na(_temp) ? 'table'             : 'table'   
// export method _type_item(linefill           _temp)=> na(_temp) ? 'linefill'          : 'linefill'
// export method _type_item(int      []        _temp)=> na(_temp) ? 'int'               : 'int'     
// export method _type_item(float    []        _temp)=> na(_temp) ? 'float'             : 'float'   
// export method _type_item(bool     []        _temp)=> na(_temp) ? 'bool'              : 'bool'    
// export method _type_item(string   []        _temp)=> na(_temp) ? 'string'            : 'string'  
// export method _type_item(color    []        _temp)=> na(_temp) ? 'color'             : 'color'   
// export method _type_item(line     []        _temp)=> na(_temp) ? 'line'              : 'line'    
// export method _type_item(label    []        _temp)=> na(_temp) ? 'label'             : 'label'   
// export method _type_item(box      []        _temp)=> na(_temp) ? 'box'               : 'box'     
// export method _type_item(table    []        _temp)=> na(_temp) ? 'table'             : 'table'   
// export method _type_item(linefill []        _temp)=> na(_temp) ? 'linefill'          : 'linefill'
// export method _type_item(matrix   <int>     _temp)=> na(_temp) ? 'int'               : 'int'                 
// export method _type_item(matrix   <float>   _temp)=> na(_temp) ? 'float'             : 'float'               
// export method _type_item(matrix   <bool>    _temp)=> na(_temp) ? 'bool'              : 'bool'                
// export method _type_item(matrix   <string>  _temp)=> na(_temp) ? 'string'            : 'string'              
// export method _type_item(matrix   <color>   _temp)=> na(_temp) ? 'color'             : 'color'               
// export method _type_item(matrix   <line>    _temp)=> na(_temp) ? 'line'              : 'line'                
// export method _type_item(matrix   <label>   _temp)=> na(_temp) ? 'label'             : 'label'               
// export method _type_item(matrix   <box>     _temp)=> na(_temp) ? 'box'               : 'box'                 
// export method _type_item(matrix   <table>   _temp)=> na(_temp) ? 'table'             : 'table'               
// export method _type_item(matrix   <linefill>_temp)=> na(_temp) ? 'linefill'          : 'linefill'                
// // END OF _type_item }


// //----------- _type_struct () -----------{
// // @function Returns type of the structure only ("array" or "matrix"), for simple types (like e.g. `int`) returns "simple"
// // ```
// // int n = 0
// // n._type_struct()    // returns "simple"
// // arr = array.new<int>()
// // arr._type_struct()  // returns "array" 
// // ```
// export method _type_struct(int                _temp)=> na(_temp) ? 'simple'  : 'simple'     
// export method _type_struct(float              _temp)=> na(_temp) ? 'simple'  : 'simple'   
// export method _type_struct(bool               _temp)=> na(_temp) ? 'simple'  : 'simple'    
// export method _type_struct(string             _temp)=> na(_temp) ? 'simple'  : 'simple'  
// export method _type_struct(color              _temp)=> na(_temp) ? 'simple'  : 'simple'   
// export method _type_struct(line               _temp)=> na(_temp) ? 'simple'  : 'simple'    
// export method _type_struct(label              _temp)=> na(_temp) ? 'simple'  : 'simple'   
// export method _type_struct(box                _temp)=> na(_temp) ? 'simple'  : 'simple'     
// export method _type_struct(table              _temp)=> na(_temp) ? 'simple'  : 'simple'   
// export method _type_struct(linefill           _temp)=> na(_temp) ? 'simple'  : 'simple'
// export method _type_struct(int      []        _temp)=> na(_temp) ? 'array'   : 'array'
// export method _type_struct(float    []        _temp)=> na(_temp) ? 'array'   : 'array'
// export method _type_struct(bool     []        _temp)=> na(_temp) ? 'array'   : 'array'
// export method _type_struct(string   []        _temp)=> na(_temp) ? 'array'   : 'array'
// export method _type_struct(color    []        _temp)=> na(_temp) ? 'array'   : 'array'
// export method _type_struct(line     []        _temp)=> na(_temp) ? 'array'   : 'array'
// export method _type_struct(label    []        _temp)=> na(_temp) ? 'array'   : 'array'
// export method _type_struct(box      []        _temp)=> na(_temp) ? 'array'   : 'array'
// export method _type_struct(table    []        _temp)=> na(_temp) ? 'array'   : 'array'
// export method _type_struct(linefill []        _temp)=> na(_temp) ? 'array'   : 'array'
// export method _type_struct(matrix   <int>     _temp)=> na(_temp) ? 'matrix'  : 'matrix'
// export method _type_struct(matrix   <float>   _temp)=> na(_temp) ? 'matrix'  : 'matrix'
// export method _type_struct(matrix   <bool>    _temp)=> na(_temp) ? 'matrix'  : 'matrix'
// export method _type_struct(matrix   <string>  _temp)=> na(_temp) ? 'matrix'  : 'matrix'
// export method _type_struct(matrix   <color>   _temp)=> na(_temp) ? 'matrix'  : 'matrix'
// export method _type_struct(matrix   <line>    _temp)=> na(_temp) ? 'matrix'  : 'matrix'
// export method _type_struct(matrix   <label>   _temp)=> na(_temp) ? 'matrix'  : 'matrix'
// export method _type_struct(matrix   <box>     _temp)=> na(_temp) ? 'matrix'  : 'matrix'
// export method _type_struct(matrix   <table>   _temp)=> na(_temp) ? 'matrix'  : 'matrix'
// export method _type_struct(matrix   <linefill>_temp)=> na(_temp) ? 'matrix'  : 'matrix'
// // END OF _type_struct }

// // END OF _type }
// // ====== ======== ====== ======== ====== ======= ======= 


// // ====== ======== ====== ======== ====== ======= 
// // ---------------     tona()      -------------- {
// // @function Returns na of the same type. 
// //```
// // int n = 0
// // n.tona() // returns int(na)
// //```
// export method tona(int                _temp)=> na(_temp) ? int       (na)     :  int       (na)  
// export method tona(float              _temp)=> na(_temp) ? float     (na)     :  float     (na)  
// export method tona(bool               _temp)=> na(_temp) ? bool      (na)     :  bool      (na)  
// export method tona(string             _temp)=> na(_temp) ? string    (na)     :  string    (na)  
// export method tona(color              _temp)=> na(_temp) ? color     (na)     :  color     (na)  
// export method tona(line               _temp)=> na(_temp) ? line      (na)     :  line      (na)  
// export method tona(label              _temp)=> na(_temp) ? label     (na)     :  label     (na)  
// export method tona(box                _temp)=> na(_temp) ? box       (na)     :  box       (na)  
// export method tona(table              _temp)=> na(_temp) ? table     (na)     :  table     (na)  
// // export method tona(linefill           _temp)=> na(_temp) ? linefill  (na)     :  linefill  (na)  
// export method tona(int      [] _temp)=> na(_temp) ? int      (na)     :  int      (na)  
// export method tona(float    [] _temp)=> na(_temp) ? float    (na)     :  float    (na)  
// export method tona(bool     [] _temp)=> na(_temp) ? bool     (na)     :  bool     (na)  
// export method tona(string   [] _temp)=> na(_temp) ? string   (na)     :  string   (na)  
// export method tona(color    [] _temp)=> na(_temp) ? color    (na)     :  color    (na)  
// export method tona(line     [] _temp)=> na(_temp) ? line     (na)     :  line     (na)  
// export method tona(label    [] _temp)=> na(_temp) ? label    (na)     :  label    (na)  
// export method tona(box      [] _temp)=> na(_temp) ? box      (na)     :  box      (na)  
// export method tona(table    [] _temp)=> na(_temp) ? table    (na)     :  table    (na)  
// _n(linefill[] i)=> [i, linefill (na)] // thanks to ©kaigouthro
// method tona(linefill[]           _temp)=> [_tmp, _na] = _n(_temp), _na
// export method tona(matrix<int   >    _temp)=> na(_temp) ? int      (na)     :  int      (na)  
// export method tona(matrix<float >    _temp)=> na(_temp) ? float    (na)     :  float    (na)  
// export method tona(matrix<bool  >    _temp)=> na(_temp) ? bool     (na)     :  bool     (na)  
// export method tona(matrix<string>    _temp)=> na(_temp) ? string   (na)     :  string   (na)  
// export method tona(matrix<color >    _temp)=> na(_temp) ? color    (na)     :  color    (na)  
// export method tona(matrix<line  >    _temp)=> na(_temp) ? line     (na)     :  line     (na)  
// export method tona(matrix<label >    _temp)=> na(_temp) ? label    (na)     :  label    (na)  
// export method tona(matrix<box   >    _temp)=> na(_temp) ? box      (na)     :  box      (na)  
// export method tona(matrix<table >    _temp)=> na(_temp) ? table    (na)     :  table    (na)  
// _n(matrix<linefill> i)=> [i, linefill (na)] // thanks to ©kaigouthro
// method tona(matrix<linefill>           _temp)=> [_tmp, _na] = _n(_temp), _na
// // END OF tona() }
// // ====== ======== ====== ======== ====== ======= 


