(setq SCCS-fpPP.l "@(#)fpPP.l 1.1 4/27/83")
; FP interpreter/compiler
; Copyright (c) 1982 Scott B. Baden
;; pretty printer for fp -- snarfed from FRANZ LISP
(declare (special fpPParm1 fpPParm2 lAngle rAngle))
; printRet is like print yet it returns the value printed,
(cond ((null z) (patom "<>"))
(print ,@(cdr $l$))))))))
(setq fpPParm1 50 fpPParm2 100)
; -DNC These "prettyprinter parameters" are used to decide when we should
; quit printing down the right margin and move back to the left -
; Do it when the leftmargin > fpPParm1 and there are more than fpPParm2
; more chars to print in the expression
; - DNC - Here we try to fix the tendency to print a
; thin column down the right margin by allowing it
; to move back to the left if necessary.
(cond ((and (>& lmar fpPParm1) (>& (flatc l (1+ fpPParm2)) fpPParm2))
(patom "; <<<<< start back on the left <<<<<")
(patom "; >>>>> continue on the right >>>>>")
; (*** at the moment we just punt hunks etc)
;(and (atom (car l)) (atom (cdr l)))
((<& (+ rmar (flatc l (charcnt poport)))
; This is just a heuristic - if print can fit it in then figure that
; the printmacros won't hurt. Note that despite the pretentions there
; is no guarantee that everything will fit in before rmar - for example
; atoms (and now even hunks) are just blindly printed. - DNC
(printAccross l lmar rmar))
((not (atom (cdr (setq l (cdr l)))))
((not (atom (setq l (cdr l))))
(cond ((null (setq l (cdr l))) (|1+| rmar))
((atom l) (setq n nil) (plus 4 rmar (pntlen l)))
; The last arg to prDF is the space needed for the suffix
; Note that this is still not really right - if the prefix
; takes several lines one would like to use the old rmar
; until the last line where the " . mumble" goes.
; this is needed to make sure the printmacros are executed
(t (prDF (car l) (nwritn) rmar)