/[guile]/guile/guile-core/ice-9/boot-9.scm
ViewVC logotype

Diff of /guile/guile-core/ice-9/boot-9.scm

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.322 by dirk, Sun Nov 16 13:54:26 2003 UTC revision 1.323 by mvo, Mon Nov 17 00:28:03 2003 UTC
# Line 2893  Line 2893 
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  ;;;  ;;;

Legend:
Removed from v.1.322  
changed lines
  Added in v.1.323

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26