Changeset 4434 for branches/f4grobner/infix-printer.lisp
- Timestamp:
- 2016-06-10T09:50:24-07:00 (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/f4grobner/infix-printer.lisp
r4423 r4434 44 44 (defun inverse-op (op) 45 45 (ecase op 46 (+ '-) 46 47 (- '+) 48 (* '/) 47 49 (/ '*))) 48 50 … … 53 55 (beg t) 54 56 (count 0) 55 true-sep) 57 true-sep 58 more-args) 56 59 "Print a list LST using SEP as separator, to stream STREAM. Every 57 60 argument is printed usin OP as main operator. PRINT-LEVEL is used to … … 87 90 (> count 1) 88 91 (consp arg) 89 (endp (cddr arg))90 92 (eq alt-op (car arg))) 91 93 (psetf arg (cadr arg) 92 true-sep (if (eq op alt-op) (inverse-op op) alt-op))) 93 94 more-args (cddr arg)) 95 (cond ((endp more-args) 96 (setf true-sep (if (eq op alt-op) (inverse-op op) alt-op))))) 97 98 94 99 ;; Unless at the beginning, print the separator 95 100 (cond … … 106 111 (infix-print-to-stream arg stream op print-level) 107 112 113 ;; Print remaining arguments 114 (unless (endp more-args) 115 (let ((x-op (inverse-op op))) 116 (format stream "~a" x-op) 117 (infix-print-separated-list more-args x-op stream sep print-level x-op))) 108 118 ))) 109 119 (values))
Note:
See TracChangeset
for help on using the changeset viewer.