This method is called when ever a type is invoked using parens()
any->invoke
any()
When a string is invoked it simple returns itself.
Code
local( mylocal = 'My string' )
#mylocal->invoke
Result
My string
You can also ->invoke by using parens()
Code
local( mylocal = 'My string' )
#mylocal()
Result
My string
Below is a simple counter type that overides the default ->invoke method.
Code
define mycounter => type {
data public count = 1
public invoke() => .'count'++
}
local( mylocal = mycounter )
#mylocal()
#mylocal()
#mylocal()
Result
123
Please note that periodically LassoSoft will go through the notes and may incorporate information from them into the documentation. Any submission here gives LassoSoft a non-exclusive license and will be made available in various formats to the Lasso community.
©LassoSoft Inc 2015 | Web Development by Treefrog Inc | Privacy | Legal terms and Shipping | Contact LassoSoft
Recent Comments