logic.scm 440 B

12345678910111213141516171819202122232425
  1. (library (logic)
  2. (export any?
  3. all?)
  4. (import
  5. (except (rnrs base)
  6. let-values
  7. map
  8. error
  9. vector-map)
  10. (only (guile)
  11. lambda* λ)
  12. (srfi srfi-1))
  13. (define any?
  14. (λ (lst)
  15. (reduce (λ (elem acc) (or acc elem))
  16. #f
  17. lst)))
  18. (define all?
  19. (λ (lst)
  20. (reduce (λ (elem acc) (and acc elem))
  21. #t
  22. lst))))