diff options
author | David Thompson <dthompson@vistahigherlearning.com> | 2021-03-17 09:25:18 -0400 |
---|---|---|
committer | David Thompson <dthompson@vistahigherlearning.com> | 2021-03-17 09:25:18 -0400 |
commit | 9aed2132c8b09be008897f0ecbd6418810520179 (patch) | |
tree | 71b2f1444fcab4e2339bf9376cb9e72d2c2c5412 /chapter-2 | |
parent | 95b25732a8dcdca6832df23f01bb246b872d7acf (diff) |
chapter-2: function-combinators: Add more comments.
Diffstat (limited to 'chapter-2')
-rw-r--r-- | chapter-2/function-combinators.scm | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/chapter-2/function-combinators.scm b/chapter-2/function-combinators.scm index f16cb1a..2b820f2 100644 --- a/chapter-2/function-combinators.scm +++ b/chapter-2/function-combinators.scm @@ -17,6 +17,9 @@ (use-modules (srfi srfi-11)) + +;; 2.1.1 Function combinators + (define (compose f g) (lambda args (f (apply g args)))) @@ -48,6 +51,9 @@ (lambda (u v w) (list 'bar u v w))) 'a 'b 'c) + +;; Arity + (define (get-arity f) (let ((arity (procedure-minimum-arity f))) (if arity (car arity) 0))) @@ -100,7 +106,8 @@ ;; Exercise 2.2: Arity extension -;; Not sure how to accomplish this in Guile, honestly. +;; Not sure how to accomplish this in Guile, honestly. There is no +;; equivalent of procedure-arity-max that I can find. ;; Multiple values |