Types of undeclared lists
Mosel 6 allows the user to define lists that contain elements of different types, any such mixed type list now results in a list of any. With previous versions of Mosel a combination of the numerical types real and integer was permitted, resulting in the type list of real.
- Constant lists combining types real and integer: In order to obtain the same type list of real with Mosel 6, all integer values need to be cast explicitly to real when defining constant lists of numerical values (LR) or be specified as real numbers (LR2):
declarations LC=[1,2.5] ! Mosel 5: list of real; Mosel 6: list of any LR=[real(1),2.5] ! Mosel 5+6: list of real LR2=[1.0,2.5] ! Mosel 5+6: list of real end-declarations
As a consequence of the change of type for list LC in the code snippet above, Mosel 5 code accessing elements of this list, such asdeclarations myval: real end-declarations myval:= LC(2)
will result in an error message "Incompatible types in assignment" with Mosel 6. - Non-constant lists combining types real and integer: For non-constant lists that were previously undeclared and hence relied on the automatic type deduction it will be sufficient to add a suitable declaration:
declarations LD: list of real end-declarations LA:=[1,2.5] ! Mosel 5: list of real; Mosel 6: list of any LD:=[1,2.5] ! Mosel 5+6: list of real
© 2001-2024 Fair Isaac Corporation. All rights reserved. This documentation is the property of Fair Isaac Corporation (“FICO”). Receipt or possession of this documentation does not convey rights to disclose, reproduce, make derivative works, use, or allow others to use it except solely for internal evaluation purposes to determine whether to purchase a license to the software described in this documentation, or as otherwise set forth in a written software license agreement between you and FICO (or a FICO affiliate). Use of this documentation and the software described in it must conform strictly to the foregoing permitted uses, and no other use is permitted.