Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # encoding: utf-8
- def ∀(arr, &block)
- arr.all?(&block)
- end
- def ∃(arr, &block)
- arr.any?(&block)
- end
- puts(∀ [1, 2, 3] { |x| x > 1 })
- puts(∀ [1, 2, 3] { |x| x >= 1 })
- puts(∃ [1, 2, 3] { |x| x > 1 })
- puts(∃ [1, 2, 3] { |x| x >= 1 })
- puts(∃ [1, 2, 3] { |x| x > 9 })
Add Comment
Please, Sign In to add comment