LogicalExpression - MrKaszeba19/PapajLang GitHub Wiki
LogicalExpression is an entity type used in PapajScript. It stores instructions that may be executed when calling it. The set of instructions is meant to return either true
or false
. Logical expressions are used in conditionals and some prebuilt functions (e.g. Array.filter
). The LogicalExpression is a successor of a ( <instructions> )
expression, which technically used to be an entity of Function
type, and it was introduced in October 2020. The first RPN Calculator stable version that has LogicalExpressions is 0.5.1.
Syntax
( <instructions> )
Examples
( $x 0 >= )
checks ifx
variable is non-negative( $x 0 >= $y 0 >= or )
checks ifx
variable is non-negative ory
variable is non-negative( 0 >= )
checks if the value being on the top of the PS stack is non-negative$T ( 0 >= ) Array.filter
filters the non-negative values fromT
array