Hi,

Here is example code:

---------------------------------------

(define (partition-two lst)
  (if (< (length lst) 2)
    '()
    (cons
      (list (car lst) (cadr lst))
      (partition-two (cddr lst)))))

(define-macro (letn bindings . body)
  `(let* ,(partition-two bindings)
     ,@body))

(define (println v)
  (display v)
  (newline))

(println
  (letn (a 3
         b 4
         c 4
         d a
         f (+ a b))
     (+ a b c d f)))

---------------------------------------

It correctly prints result, but I'm getting also:

---------------------------------------
;;; note: auto-compilation is enabled, set GUILE_AUTO_COMPILE=0
;;;       or pass the --no-auto-compile argument to disable.
;;; compiling /home/sanel/letn.ss
;;; WARNING: compilation of /home/sanel/letn.ss failed:
;;; ERROR: Unbound variable: partition-two
21
---------------------------------------

I'm using guile: 2.1.0.180-9b977-dirty

Best.



Reply via email to