Changeset 6195


Ignore:
Timestamp:
Apr 8, 2007, 4:12:55 AM (12 years ago)
Author:
gb
Message:

Some changes, then reverted those changes manually and most of the
effects were cosmetic. TOPLEVEL-PRINT takes an output stream arg.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ccl/level-1/l1-readloop-lds.lisp

    r5976 r6195  
    2424  (loop
    2525    (if (eq (catch :toplevel
    26               (read-loop :break-level 0
    27                          :input-stream *standard-input*
    28                          :output-stream *standard-output* )) $xstkover)
     26              (read-loop :break-level 0 )) $xstkover)
    2927      (format t "~&;[Stacks reset due to overflow.]")
    3028      (when (eq *current-process* *initial-process*)
     
    195193
    196194;;; This is the part common to toplevel loop and inner break loops.
    197 (defun read-loop (&key (break-level *break-level*)
    198                        (prompt-function #'(lambda (stream) (print-listener-prompt stream t)))
    199                        (input-stream *standard-input*)
    200                        (output-stream *standard-output*))
     195(defun read-loop (&key (input-stream *standard-input*)
     196                       (output-stream *standard-output*)
     197                       (break-level *break-level*)
     198                       (prompt-function #'(lambda (stream) (print-listener-prompt stream t))))
    201199  (let* ((*break-level* break-level)
    202200         (*last-break-level* break-level)
     
    227225                      (abort-break))
    228226                    (exit-interactive-process *current-process*))
    229                   (or (check-toplevel-command form)
    230                       (let* ((values (toplevel-eval form path)))
    231                         (if print-result (toplevel-print values))))))))
     227                    (or (check-toplevel-command form)
     228                        (let* ((values (toplevel-eval form path)))
     229                          (if print-result (toplevel-print values))))))))
    232230           (format *terminal-io* "~&Cancelled")))
    233231       (abort () :report (lambda (stream)
     
    244242                     (unless (eq break-level 0)
    245243                       (abort))))
    246       (clear-input input-stream)
     244       (clear-input input-stream)
    247245      (format output-stream "~%"))))
    248246
     
    272270;;; Read a form from the specified stream.
    273271(defun toplevel-read (&key (input-stream *standard-input*)
    274                            (output-stream *standard-output*)
    275                            (prompt-function #'print-listener-prompt)
     272                           (output-stream *standard-output*)
     273                           (prompt-function #'print-listener-prompt)
    276274                           (eof-value *eof-value*))
    277275  (force-output output-stream)
     
    295293    values))
    296294
    297 (defun toplevel-print (values)
     295(defun toplevel-print (values &optional (out *standard-output*))
    298296  (setq /// // // / / values)
    299297  (unless (eq (car values) (%unbound-marker))
    300298    (setq *** ** ** * *  (%car values)))
    301299  (when values
    302     (fresh-line)
    303     (dolist (val values) (write val) (terpri))))
     300    (fresh-line out)
     301    (dolist (val values) (write val :stream out) (terpri out))))
    304302
    305303(defun print-listener-prompt (stream &optional (force t))
     
    532530                (application-ui-operation *application*
    533531                                          :enter-backtrace-context context)
    534                 (read-loop :break-level (1+ *break-level*)
    535                            :input-stream *debug-io*
    536                            :output-stream *debug-io*))
     532                  (read-loop :break-level (1+ *break-level*)
     533                             :input-stream *debug-io*
     534                             :output-stream *debug-io*))
    537535           (application-ui-operation *application* :exit-backtrace-context
    538536                                     context)))))))
Note: See TracChangeset for help on using the changeset viewer.