Search code examples
if-statementoperatorslasso-lang

What does !>> mean?


I ran across a bit of if-statement code today in Lasso that I hadn't seen before. It looked like this:

if(#theFile !>> 'image');
    ...
/if;

How does the !>> operator work in Lasso?


Solution

  • The reference information for this operator in Lasso 8.5 is here[1].

    In Lasso 9, you can find the discussion about "Containment Operators" here[2].

    Discussing Lasso 9, in the expression

    E1 >> E2

    this is useful if the type of E1 includes a contains method, whose only parameter will be populated by the right operand; E2 in the example just above. This operator invokes that method for E1 with argument E2. That method returns a boolean value, so this operator returns a boolean operator.

    E1 !>> E2

    yields the same result as

    !(E1 >> E2)

    Example:

    !("test" >> "st") == ("test" !>> "st")

    Result:

    true