Call end call from format

I have noticed that there is formatthat call / . force-outputfinish-output

Why?

It seems to be useful in interacting with the user, cf. Lisp format and forced output .

For example, it ~=can translate to finish-outputand ~:=to force-output. I do not think it clear-outputmakes sense in this context, but we can display ~@=for completeness.

PS. Wed CLISP RFE .

+4
source share
1 answer

Summary from comp.lang.lisp :

Explanation from Stephen Haflich

( ~/.../), . , finish-output .

, , pprint-dispatch print-object - , . ( , finish-output a ~<, !) finish-output, ? , .

, , , finish-output . finish-output .. , cl:write. ( , ), , .

, format . - COMMON- LISP -USER package:

(defun fo (stream arg colon-p atsign-p &rest params)
  (declare (ignore arg params))
  (cond
    (colon-p (force-output stream))
    (atsign-p (clear-output stream))
    (t (finish-output stream))))

:

(progn
  (format t "enter var: ~/fo/" nil)
  (read))
enter var: 456
456 

(!) -

  • verbosity (~/fo/ ~=)
  • (nil )
+2

Source: https://habr.com/ru/post/1684148/


All Articles