minimod (nested quasi-module experiment) added by dieggsy on Mon Feb 1 06:08:00 2021

(module minimod ((minimod make-minimod)
                 minimod-import)
  (import scheme
          (only chicken.base define-record-type))

  (define-record-type minimod
    (make-minimod promise)
    minimod?
    (promise minimod-promise))

  (define-syntax minimod
    (syntax-rules ()
      ([minimod name (exp1 exp2 ...) body ...]
       (define name
         (make-minimod
          (delay
            (eval '(set!-values (exp1 exp2 ...)
                                (let ()
                                  body ...
                                  (values exp1 exp2 ...))))))))))

  (define (minimod-import minimod)
    (force (minimod-promise minimod))))