From 9aed2132c8b09be008897f0ecbd6418810520179 Mon Sep 17 00:00:00 2001 From: David Thompson Date: Wed, 17 Mar 2021 09:25:18 -0400 Subject: chapter-2: function-combinators: Add more comments. --- chapter-2/function-combinators.scm | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) 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 -- cgit v1.2.3