nested-loop.scm 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. ;;; nested-loop.sls ---
  2. ;; Copyright (C) 2009, 2010 Andreas Rottmann <a.rottmann@gmx.at>
  3. ;; Author: Andreas Rottmann <a.rottmann@gmx.at>
  4. ;; This program is free software, you can redistribute it and/or
  5. ;; modify it under the terms of the new-style BSD license.
  6. ;; You should have received a copy of the BSD license along with this
  7. ;; program. If not, see <http://www.debian.org/misc/bsd.license>.
  8. ;;; Commentary:
  9. ;;; Code:
  10. #!r6rs
  11. (library (arguile nested-loop)
  12. (export iterate*
  13. iterate
  14. iterate!
  15. iterate-values
  16. parallel
  17. nested
  18. recur*
  19. recur
  20. lazy-recur*
  21. lazy-recur
  22. recur-values
  23. collect-list
  24. collect-list-reverse
  25. collect-list!
  26. collect-list-into!
  27. collect-stream
  28. collect-vector
  29. collect-vector-of-length
  30. collect-string
  31. collect-string-of-length
  32. collect-display
  33. collect-sum
  34. collect-product
  35. collect-count
  36. collect-average
  37. collect-minimum
  38. collect-maximum)
  39. (import (rnrs)
  40. (only (rnrs mutable-pairs) set-cdr!)
  41. (only (srfi :1) append-reverse)
  42. (srfi :8 receive)
  43. (arguile lib riastreams)
  44. (arguile loop)
  45. (arguile lib private include))
  46. (define-syntax define-aux
  47. (syntax-rules ()
  48. ((_ id ...)
  49. (begin
  50. (define-syntax id
  51. (lambda (x)
  52. (syntax-violation #f "invalid use of auxiliary keyword" x 'id)))
  53. ...))))
  54. (define-aux parallel nested)
  55. (include-file/downcase ((arguile loop) nested-loop)))