False

From the SETL Wiki

Jump to: navigation, search

false is the name of the predefined boolean constant that represents logical falsehood in SETL (like most high-level languages.)

Operations involving false include:

  • Use it as the condition in an if statement:
    if false then
      print('You should not see this');
    else
      print('You should see this');
    end;
    


  • Use it as the condition in an while statement:
    (while false)
      print('You should not see this');
    end while;
    
    (until false)
      print('You should see this repeated infinitely');
    end until;
    

    repeat ... until false

  • Convert it to a string:
    str false
    

    Result: '#F'

  • Parse it from a string:
    unstr '#F'
    

    Result:false

  • Query its type:
    print(type false, is_boolean false, is_integer false, denotype '#F');
    

    Output:BOOLEAN #T #F BOOLEAN

  • Insert it into a set or map:
    s := {false};
    false in s;
    true in s;
    
    not_map := {[true, false], [false, true]};
    not_map(false);
    not_map(true);
    

    Results:
    #T
    #F

    #T
    #F

Personal tools