Plaster
New
List
Login
common-lisp
default
anonymous
2024.11.04 10:28:47
(defun format-coords (coords) (with-output-to-string (out) (loop with first = t for label in '("x" "y" "z" "t") for coord in coords when coord do (if first (setq first nil) (write-string ", " out)) (write-string label out) (write-string ": " out) (princ coord out))))
Raw
Annotate
Repaste
Edit
Annotations
common-lisp
default
anonymous
2024.11.04 10:39:15
(defun format-coords (coords) (with-output-to-string (out) (loop for prefix = "" then ", " for label in '("x: " "y: " "z: " "t: ") for coord in coords when coord do (write-string prefix out) (write-string label out) (princ coord out))))
Raw
Repaste
Edit