guile-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Concentrate procedures from various modules in one module


From: Diogo F. S. Ramos
Subject: Concentrate procedures from various modules in one module
Date: Tue, 21 Feb 2017 11:37:34 -0300

Can I concentrate procedures from various modules in one module and use
this module in the other modules?

For example, suppose I have these modules:

(define-module (foo)
  #:export (foo-proc))

(define-module (bar)
  #:export (bar-proc))

`foo' is a module that exports procedure `foo-proc' and `bar' is another
module that exports `bar-proc'.

I want to concentrate `foo-proc' and `bar-proc' in a single `quux'
module, and then use this `quux' module in `foo' and `bar'.

(define-module (quux)
  #:use-module (foo)
  #:re-export (foo-proc)
  #:use-module (bar)
  #:re-export (bar-proc))

(define-module (foo)
  #:use-module (quux)
  #:export (foo-proc))

(define-module (bar)
  #:use-module (quux)
  #:export (bar-proc))

Unfortunately on the REPL, when I try to change to module (say) `foo',
there is an `ERROR: Undefined variable: foo-proc'.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]