Module: Klam::Primitives::BooleanOperations
- Included in:
- Environment
- Defined in:
- lib/klam/primitives/boolean_operations.rb
Overview
All of the boolean operations are special forms, but if, and, and or are also available as normal functions to facilitate partial application. When partially applied, they are no longer short circuiting.
Instance Method Summary collapse
Instance Method Details
#_if(a, b, c) ⇒ Object Also known as: if
7 8 9 |
# File 'lib/klam/primitives/boolean_operations.rb', line 7 def _if(a, b, c) a ? b : c end |
#and(a, b) ⇒ Object
13 14 15 |
# File 'lib/klam/primitives/boolean_operations.rb', line 13 def and(a, b) a && b end |
#or(a, b) ⇒ Object
17 18 19 |
# File 'lib/klam/primitives/boolean_operations.rb', line 17 def or(a, b) a || b end |