From 9c60997b02d7126969c05a4b368170022d3ed567 Mon Sep 17 00:00:00 2001 From: Abdulaziz Ghuloum Date: Sat, 1 Nov 2008 16:19:35 -0400 Subject: [PATCH] - invoking ikarus in r6rs mode now takes optional library files arguments as in $ ikarus ... --r6rs-script args ... --- scheme/ikarus.load.ss | 1 - scheme/ikarus.main.ss | 10 +++++++++- scheme/ikarus.reader.annotated.ss | 10 +++++++++- scheme/last-revision | 2 +- 4 files changed, 19 insertions(+), 4 deletions(-) diff --git a/scheme/ikarus.load.ss b/scheme/ikarus.load.ss index 2c8ca1b..364586b 100644 --- a/scheme/ikarus.load.ss +++ b/scheme/ikarus.load.ss @@ -24,7 +24,6 @@ (only (psyntax expander) compile-r6rs-top-level) (only (ikarus.reader.annotated) read-script-source-file)) - (define-struct serialized-library (contents)) (define fasl-extension ".ikarus-fasl") diff --git a/scheme/ikarus.main.ss b/scheme/ikarus.main.ss index 55728d0..51ffab5 100644 --- a/scheme/ikarus.main.ss +++ b/scheme/ikarus.main.ss @@ -75,6 +75,8 @@ (export) (import (ikarus) (except (ikarus startup) host-info) + (only (psyntax library-manager) current-library-expander) + (only (ikarus.reader.annotated) read-source-file) (only (ikarus load) load-r6rs-top-level)) (init-library-path) (let-values ([(files script script-type args) @@ -124,8 +126,14 @@ files))) (cond [(eq? script-type 'r6rs-script) - (assert-null files "--r6rs-script") (command-line-arguments (cons script args)) + (for-each + (lambda (filename) + (for-each + (lambda (src) + ((current-library-expander) src)) + (read-source-file filename))) + files) (load-r6rs-top-level script 'run) (exit 0)] [(eq? script-type 'compile) diff --git a/scheme/ikarus.reader.annotated.ss b/scheme/ikarus.reader.annotated.ss index 265af2c..24f569b 100644 --- a/scheme/ikarus.reader.annotated.ss +++ b/scheme/ikarus.reader.annotated.ss @@ -15,7 +15,7 @@ (library (ikarus.reader.annotated) - (export read-library-source-file read-script-source-file) + (export read-source-file read-library-source-file read-script-source-file) (import (except (ikarus) read-annotated read-script-annotated) (only (ikarus.reader) read-annotated read-script-annotated) @@ -32,6 +32,14 @@ (define (read-library-source-file file-name) (read-annotated (annotated-port file-name))) + (define (read-source-file file-name) + (let ([p (annotated-port file-name)]) + (let f () + (let ([x (read-annotated p)]) + (if (eof-object? x) + '() + (cons x (f))))))) + (define (read-script-source-file file-name) (let ([p (annotated-port file-name)]) (let ([x (read-script-annotated p)]) diff --git a/scheme/last-revision b/scheme/last-revision index df05bdc..d1b8e2f 100644 --- a/scheme/last-revision +++ b/scheme/last-revision @@ -1 +1 @@ -1659 +1660