Suggestion: (type or (type?
Posted: Fri Jan 10, 2003 8:40 pm
X-Lisp deviants<sp?> have a function (type symbol)
that returns SYMBOL STRING REAL LIST ....
It allows a case statement to be used to handle a wide range of input presorted processing by data type.
(define (data2string x)
(case (type x)
(LIST (append "List: " (string x)))
(REAL (append "Real: " (string x)))
(SYMBOL (append "Symbol: " (string x)))
(STRING (append "String: " (string x)))
...
(true (append "Undefined: (string x)))))
I know I can use:
(cond ((list? x) ......
((NaN? x) .......
But sometimes I just want to know what a symbol
is pointing to.
that returns SYMBOL STRING REAL LIST ....
It allows a case statement to be used to handle a wide range of input presorted processing by data type.
(define (data2string x)
(case (type x)
(LIST (append "List: " (string x)))
(REAL (append "Real: " (string x)))
(SYMBOL (append "Symbol: " (string x)))
(STRING (append "String: " (string x)))
...
(true (append "Undefined: (string x)))))
I know I can use:
(cond ((list? x) ......
((NaN? x) .......
But sometimes I just want to know what a symbol
is pointing to.