You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am constantly finding a need to check if a numeric value is between two bounds, and having to write and make function calls to do such checks. I believe a more natural language-form operator would not only allow the Easyscript to flow more naturally, but I suspect that coding the bounding checks within C# would be more efficient than having to parse the Easyscript function call and statements therein.
It should be noted that this is not intended for checking discrete integer values as that can be done with a mere
(A..B) contains X
But the Range operator only creates a list of discrete integer values within the resultant collection, and cannot address the (many) cases wherein X, A, and B are desired to be evaluated as floats.
expression that checks if a numercal value mathematically falls within numerical range bounded by the other two arguments
Mind you, because of the natural language form of this operator inclines the ""speaker"" to use either '..' or 'and' to indicate separation between the lower and upper bounds, this ternary operator would have to have a higher precedence than either the bioperand numerical collection-creating Range '..' operator or the bioperand logical 'and' operator.
Alternatively, bounds could be separated by a '->' string, which should not conflict with precedence of any other known operators as of EasyCommands v2.0.0 (published Jan 14, 2023)
Regarding the Clusivity keyword, mathematicians often utilize them when referring to bounds to specify whether the bounds themselves are valid values. by default (that is, without an explicit Clusivity keyword), Clusivity should be 'inclusive'.
'inclusive': lower and upper bounds are valid values
'exclusive': lower and upper bounds are not valid values
examples, with functional equivalence:
X within A and B // return (( X >= A ) and ( X <=B ))
X between A and B exclusive // return (( X > A ) and ( X < B ))
The text was updated successfully, but these errors were encountered:
I am constantly finding a need to check if a numeric value is between two bounds, and having to write and make function calls to do such checks. I believe a more natural language-form operator would not only allow the Easyscript to flow more naturally, but I suspect that coding the bounding checks within C# would be more efficient than having to parse the Easyscript function call and statements therein.
It should be noted that this is not intended for checking discrete integer values as that can be done with a mere
(A..B) contains X
But the Range operator only creates a list of discrete integer values within the resultant collection, and cannot address the (many) cases wherein X, A, and B are desired to be evaluated as floats.
(as BNF:)
::= ( 'within' | 'between' | '<>' ) ( '..' | 'and' ) [ ['inclusive'] | 'exclusive' ]
expression that checks if a numercal value mathematically falls within numerical range bounded by the other two arguments
Mind you, because of the natural language form of this operator inclines the ""speaker"" to use either '..' or 'and' to indicate separation between the lower and upper bounds, this ternary operator would have to have a higher precedence than either the bioperand numerical collection-creating Range '..' operator or the bioperand logical 'and' operator.
Alternatively, bounds could be separated by a '->' string, which should not conflict with precedence of any other known operators as of EasyCommands v2.0.0 (published Jan 14, 2023)
Regarding the Clusivity keyword, mathematicians often utilize them when referring to bounds to specify whether the bounds themselves are valid values. by default (that is, without an explicit Clusivity keyword), Clusivity should be 'inclusive'.
'inclusive': lower and upper bounds are valid values
'exclusive': lower and upper bounds are not valid values
examples, with functional equivalence:
X within A and B // return (( X >= A ) and ( X <=B ))
X between A and B exclusive // return (( X > A ) and ( X < B ))
The text was updated successfully, but these errors were encountered: