alias provides a way to work around variable name shadowing... but as a side effect, it also give a way to shorthand just about any property/function you want.
alias get2 = get
namespace http
'Do an HTTP request
sub get()
print get2.aa().data 'using `get2` aliased symbol here. it's now clear which item we intended to use
end sub
end namespace
namespace get
function aa()
return {
data: "abc"
}
end function
end namespace
transpiles to
sub http_get()
print get_aa().data
end sub
sub get_aa()
return {
data: "abc"
}
end sub
it also allows this ... which is cool?:
alias lc = lcase
alias co = createObject
sub getModelTypeLower()
lc(co("roDeviceInfo").getModelType())
end sub
it also allows this ... which is also cool?:
alias abgdz = alpha.beta.gamma.delta.zeta
sub foo()
print abgdz.someConst
end sub
This is pretty cool!
alias
provides a way to work around variable name shadowing... but as a side effect, it also give a way to shorthand just about any property/function you want.transpiles to
it also allows this ... which is cool?:
it also allows this ... which is also cool?: