Welcome to the CHICKEN Scheme pasting service

no title pasted by anonymous on Tue Jul 16 00:29:21 2019

;; a.scm
(declare (unit a))
(use r7rs)

(define-library (a-lib)
  (import (scheme base)
          (scheme write))
  (export do-it)

  (begin
    (define (do-it)
      (display "I did it.")
      (newline))

    ))

;; b.scm
(declare (unit b))
(declare (uses a))
(use r7rs)

(define-library (b-lib)
  (import (scheme base)
          (a-lib))
  (export foo)

  (begin
    (define (foo)
      (do-it))

    ))

;; z.scm
(declare (uses b))
(use r7rs)

(define-library (z-lib)
  (import b-lib)
  (export baz)

  (begin
    (define (baz)
      (foo))

    ))

(import z-lib)
(baz)

;; Makefile
all:
	csc -J -c a.scm
	csc -J -c b.scm
	csc -J -c z.scm
	csc -o prog a.o b.o z.o

reworked for 5.1.0 added by evhan on Tue Jul 16 01:14:59 2019

;; a.scm
(declare (unit a))

(import r7rs)

(define-library (a)
  (import (scheme base)
          (scheme write))
  (export do-it)

  (begin
    (define (do-it)
      (display "I did it.")
      (newline))

    ))

;; b.scm
(declare (unit b))
(declare (uses a))

(import r7rs)

(define-library (b)
  (import (scheme base) (a))
  (export foo)

  (begin
    (define (foo)
      (do-it))

    ))

;; z.scm
(declare (uses a b))

(import r7rs)

(define-library (z)
  (import (scheme base) (b))
  (export baz)

  (begin
    (define (baz)
      (foo))

    ))

(import (z))
(baz)

Your annotation:

Enter a new annotation:

Your nick:
The title of your paste:
Your paste (mandatory) :
Type in the text below:
                   _   
 _______ _ __ ___ | |_ 
|_  / __| '_ ` _ \| __|
 / / (__| | | | | | |_ 
/___\___|_| |_| |_|\__|
                       
Visually impaired? Let me spell it for you (wav file) download WAV