2893 |
|
|
2894 |
(define load load-module) |
(define load load-module) |
2895 |
|
|
2896 |
|
;; The following macro allows one to write, for example, |
2897 |
|
;; |
2898 |
|
;; (@ (ice-9 pretty-print) pretty-print) |
2899 |
|
;; |
2900 |
|
;; to refer directly to the pretty-print variable in module (ice-9 |
2901 |
|
;; pretty-print). It works by looking up the variable and inserting |
2902 |
|
;; it directly into the code. This is understood by the evaluator. |
2903 |
|
;; Indeed, all references to global variables are memoized into such |
2904 |
|
;; variable objects. |
2905 |
|
|
2906 |
|
(define-macro (@ mod-name var-name) |
2907 |
|
(let ((var (module-variable (resolve-interface mod-name) var-name))) |
2908 |
|
(if (not var) |
2909 |
|
(error "no such public variable" (list '@ mod-name var-name))) |
2910 |
|
var)) |
2911 |
|
|
2912 |
|
;; The '@@' macro is like '@' but it can also access bindings that |
2913 |
|
;; have not been explicitely exported. |
2914 |
|
|
2915 |
|
(define-macro (@@ mod-name var-name) |
2916 |
|
(let ((var (module-variable (resolve-module mod-name) var-name))) |
2917 |
|
(if (not var) |
2918 |
|
(error "no such variable" (list '@@ mod-name var-name))) |
2919 |
|
var)) |
2920 |
|
|
2921 |
|
|
2922 |
;;; {Parameters} |
;;; {Parameters} |
2923 |
;;; |
;;; |