list-comprehension 438 B

12345678910111213141516171819
  1. # key: lc
  2. # name: list-comprehension
  3. #
  4. # (use-modules (srfi srfi-42))
  5. #
  6. # https://en.wikipedia.org/wiki/List_comprehension
  7. # https://en.wikipedia.org/wiki/Comparison_of_programming_languages_(list_comprehension)
  8. # --
  9. (define list-comprehension
  10. (list-ec (: a 11) (: b 11) (: c 11)
  11. (if (and (= (+ (* a a)
  12. (* b b))
  13. (* c c))
  14. (= (+ a b c)
  15. 24)
  16. (< b c)
  17. (< a b))
  18. (list a b c)
  19. '())))