123456789101112131415161718192021222324252627282930313233343536373839404142434445464748 |
- #!/bin/sh
- #|-*- mode:lisp -*-|#
- #|
- exec ros -Q -m my-lilu -- $0 "$@"
- |#
- (progn ;;init forms
- (ros:ensure-asdf)
- #+quicklisp(ql:quickload '(:lilu-roswell :lilu-debugger/emacs) :silent t)
- )
- (defpackage :ros.script.lilu-eval.3841829401
- (:use :cl))
- (in-package :ros.script.lilu-eval.3841829401)
- (opts:define-opts
- #.lilu-roswell:*default-help-option*
- #.lilu-roswell:*default-debugger-option*)
- (defun main (&rest argv)
- (lilu-roswell:init-debugging)
- (multiple-value-bind (options free-args)
- (lilu-roswell:parse-options argv
- :free-args-p t :min-free-args 1 :max-free-args 1)
- (declare (ignorable free-args))
- (lilu-roswell:options-check-for-help options
- :prefix nil
- :suffix nil
- :usage-of "lilu-script.ros"
- :args "FILE ...")
- (lilu-debugger:with-debugger
- ((lilu-roswell:options-get-value options :debugger))
- (with-open-file (stream (car free-args))
- ;; remove shebang
- (let ((first-char (read-char stream))
- (second-char (read-char stream)))
- (cond
- ((and (char= first-char #\#) (char= second-char #\!))
- (read-line stream))
- (t (unread-char second-char stream)
- (unread-char first-char stream))))
- (loop for sexp = (read stream nil)
- while sexp
- do
- (format t "R: ~A~%" (eval sexp)))))))
- ;;; vim: set ft=lisp lisp:
|