Sunnan wrote:
Thanks, I guess I was stressed, and forgot that unknown macros can
already be defined. The error message just looked so weird.

I was pretty sleep-deprived at the time.

I hadn't looked at srfi-31 before. I thought I knew most of the srfis.
This one was pretty disappointing.

(define (...) 10)
; They want to write:
((rec (F N) (if (zero? N) 1 (* N (F (- N 1))))) (...))

;; instead of:
(let f ((n (...)))
  (if (zero? n) 1
      (* n (f (- n 1)))))
;; it's the exact same number of characters!

Almost - note that REC returns the recursive
function, so you need to return the function
in the let:

  ((let f ((n (...)))
     (if (zero? n) 1
         (* n (f (- n 1))))
     f)
    (...))

--
Jens Axel Søgaard






_______________________________________________
Chicken-users mailing list
[email protected]
http://lists.nongnu.org/mailman/listinfo/chicken-users

Reply via email to