(defun ToString
(x
/ typex
) ;; convert item to a string, if x is a real use
;; the highest possible precision, if x is a
;; string double quote it, if x is a list process
;; each item in the list appropriatel, otherwise
;; just hammer item with vl-princ-to-string
;; (ToString 1.0 )
(cond ;; it's a string, return it double quoted ;; it's a real, with decimal
((and (eq 'real typex
) (= (- x
(fix x
)) 0.0)); reali con parte decimale nulla (setvar 'dimzin
1); variabile sistema dimzin a 1 consente di non sopprimere gli zeri finali nelle quote decimali (setq res$
(rtos x
2 1)) ;_ numeri reali coincidenti con interi trasformati in stringhe con un solo decimale res$)
;; it's a real, covert to the highest possible
;; resolution string equivalent
2
1
15)))
;; it's a list
;; it's a normal list
;; it's a dotted pair
;; hammer down on everything else