2007-05-02 02:16:56 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2006-12-06 21:05:19 -05:00
|
|
|
;;; Finally, we're ready to evaluate the files and enter the cafe.
|
2007-05-02 02:16:56 -04:00
|
|
|
|
2007-04-28 20:54:02 -04:00
|
|
|
(library (ikarus interaction)
|
2007-05-02 04:48:41 -04:00
|
|
|
(export bar)
|
2007-04-28 20:54:02 -04:00
|
|
|
(import (scheme))
|
2007-05-02 01:52:11 -04:00
|
|
|
|
2007-05-02 04:48:41 -04:00
|
|
|
(define bar 'i-am-an-exported-primitive-named-foo)
|
2007-05-01 05:49:33 -04:00
|
|
|
|
2007-04-28 20:54:02 -04:00
|
|
|
(let-values ([(files script args)
|
|
|
|
(let f ([args (command-line-arguments)])
|
|
|
|
(cond
|
|
|
|
[(null? args) (values '() #f '())]
|
|
|
|
[(string=? (car args) "--")
|
|
|
|
(values '() #f (cdr args))]
|
|
|
|
[(string=? (car args) "--script")
|
|
|
|
(let ([d (cdr args)])
|
|
|
|
(cond
|
|
|
|
[(null? d)
|
|
|
|
(error #f "--script requires a script name")]
|
|
|
|
[else
|
|
|
|
(values '() (car d) (cdr d))]))]
|
|
|
|
[else
|
|
|
|
(let-values ([(f* script a*) (f (cdr args))])
|
|
|
|
(values (cons (car args) f*) script a*))]))])
|
|
|
|
(cond
|
|
|
|
[script ; no greeting, no cafe
|
|
|
|
(command-line-arguments (cons script args))
|
|
|
|
(for-each load files)
|
|
|
|
(load script)
|
|
|
|
(exit 0)]
|
|
|
|
[else
|
2007-04-30 04:51:37 -04:00
|
|
|
(let ()
|
|
|
|
(define-syntax compile-time-string
|
|
|
|
(lambda (x) (date-string)))
|
|
|
|
(printf "Ikarus Scheme (Build ~a)\n" (compile-time-string)))
|
2007-04-28 20:54:02 -04:00
|
|
|
(display "Copyright (c) 2006-2007 Abdulaziz Ghuloum\n\n")
|
|
|
|
(command-line-arguments args)
|
|
|
|
(for-each load files)
|
|
|
|
(new-cafe)
|
|
|
|
(exit 0)])))
|