- Added stale-when:

syntax:  (stale-when guard-expr e* ...)   ;; in definition context
            (stale-when guard-expr e e* ...) ;; in expression context

   semantics:
     When a stale-when form is encountered while expanding any code
     (expressions, macros, macros in macros, etc.) in a library
     body, the guard-expr is expanded (but not evaluated) and
     serialized along with the library.  When the library is later
     reloaded from fasl and before it is installed, the guard-expr
     is evaluated.  If guard-expr returns true, the fasl content is
     ignored and the library is recompiled afresh from source.
This commit is contained in:
Abdulaziz Ghuloum
2009-05-28 09:02:47 +03:00
parent f759815a8c
commit 24ece86772
5 changed files with 114 additions and 40 deletions
+24 -18
View File
@@ -22,6 +22,7 @@
annotation-stripped
read-library-source-file
library-version-mismatch-warning
library-stale-warning
file-locator-resolution-error
label-binding set-label-binding! remove-location
make-source-position-condition)
@@ -29,32 +30,37 @@
(only (ikarus.compiler) eval-core)
(only (ikarus.reader.annotated) read-library-source-file)
(ikarus))
(define (library-version-mismatch-warning name depname filename)
(fprintf (current-error-port)
"WARNING: library ~s has an inconsistent dependency \
on library ~s; file ~s will be recompiled from \
source.\n"
name depname filename))
(define (library-stale-warning name filename)
(fprintf (current-error-port)
"WARNING: library ~s is stale; file ~s will be recompiled from source.\n"
name filename))
(define (file-locator-resolution-error libname failed-list pending-list)
(define-condition-type &library-resolution &condition
make-library-resolution-condition
library-resolution-condition?
(library condition-library)
(files condition-files))
(define-condition-type &imported-from &condition
make-imported-from-condition imported-from-condition?
(importing-library importing-library))
(define (file-locator-resolution-error libname failed-list pending-list)
(define-condition-type &library-resolution &condition
make-library-resolution-condition
library-resolution-condition?
(library condition-library)
(files condition-files))
(define-condition-type &imported-from &condition
make-imported-from-condition imported-from-condition?
(importing-library importing-library))
(raise
(apply condition (make-error)
(make-who-condition 'expander)
(make-message-condition
"cannot locate library in library-path")
(make-library-resolution-condition
libname failed-list)
(map make-imported-from-condition pending-list))))
(raise
(apply condition (make-error)
(make-who-condition 'expander)
(make-message-condition
"cannot locate library in library-path")
(make-library-resolution-condition
libname failed-list)
(map make-imported-from-condition pending-list))))
(define-syntax define-record
(syntax-rules ()