1 ;;; -*- Mode:LISP; Package:MACSYMA -*-
3 ; ** (c) Copyright 1981 Massachusetts Institute of Technology **
5 (macsyma-module format
)
7 (declare (special $floatformat $floatint $floatfrac $floatprec $floatwidth
8 $floatoptions $aliases $stringdisp $lispdisp
))
10 (defmvar $floatformat nil
)
12 (defmvar $floatfrac
2)
13 (defmvar $floatprec
3)
14 (defmvar $floatwidth
10.
)
15 (defmvar $floatoptions nil
)
17 (defprop print-fixed-field-floating
(fformat fasl dsk liblsp
) autoload
)
18 (defprop print-fixed-precision-floating
(fformat fasl dsk liblsp
) autoload
)
20 (defun number-exploden (form)
21 (cond ((and $floatformat
(floatp form
))
23 (cond ((null list
) (exploden form
))
24 ((= $floatwidth
0) (delete 32. list
))
26 (cond ((eq $floatformat
'$f
)
27 (print-fixed-field-floating
28 form
(cond ((= $floatwidth
0) 15.
) (t $floatwidth
)) $floatfrac
29 (cons 'exploden
(and $floatoptions
31 (cdr $floatoptions
))))))
33 (print-fixed-precision-floating
34 form
(cond ((= $floatwidth
0) 15.
) (t $floatwidth
)) $floatprec
35 (cons 'exploden
(and $floatoptions
37 (cdr $floatoptions
))))
38 (cond ((numberp $floatint
) $floatint
)
39 (t (cdr $floatint
))))))))
42 (declare (eval (read)))
43 (setsyntax '/# 'macro
'tyi
)
45 (defun makestring (form)
47 (cond ((numberp form
) (number-exploden form
))
48 ((and (setq dummy
(get form
'reversealias
))
49 (not (and (member form $aliases
:test
#'eq
) (get form
'noun
))))
51 (t (setq dummy
(exploden form
))
52 (cond ((= #$
(car dummy
)) (cdr dummy
))
53 ((and $stringdisp
(stringp form
)) (cons #" (nconc dummy (list #"))))
54 ((= #%
(car dummy
)) (cdr dummy
))
55 ($lispdisp
(cons #? dummy
))
60 (or (and (numberp x
) (number-exploden x
))
63 (declare (eval (read)))
65 (setsyntax '/# 'macro nil
)