ardee
01-20-2005, 08:26 PM
LScript bails out on scripts wherein functions are calling methods on globals that, at the time of compilation, do not have a value that responds to the method. I think this is BAD. LScript is dynamically typed and this form of limited type checking is the wrong thing.
Example: Globals in modifiers are usually initialized within the "option" method. However, code like this is rejected:
GBone;
process: ChannelAccess, Time, Frame
{
RestPos = GBone.restParam( WPOSITION );
}
option:
{
//initialize GBone with a value set by the user through an interface
}
This bails with restParam being rejected as a valid method of GBone.
By the way, it's restParam and not restparam as claimed in the LW docs.
Example: Globals in modifiers are usually initialized within the "option" method. However, code like this is rejected:
GBone;
process: ChannelAccess, Time, Frame
{
RestPos = GBone.restParam( WPOSITION );
}
option:
{
//initialize GBone with a value set by the user through an interface
}
This bails with restParam being rejected as a valid method of GBone.
By the way, it's restParam and not restparam as claimed in the LW docs.