Someting I miss inside newlisp, yes there are functions you can miss ;-)
Is a function that detects all possible types inside newlisp..
Because if your checking content you never know what it is by default..
here an example of what i mean ->
Code: Select all
(define (type? T)
;;-- returns TYPE of T
(cond
((macro? T) "macro")
((lambda? T) "lambda")
((integer? T) "integer")
((float? T) "float")
((list? T) "list")
((string? T) "string")
((array? T) "array")
((context? T) "context")
((file? T) "file")
)
)
-> (type? '(nothing))
"list"
-> (type? (fn(x) (y)))
"lambda"
-> (type? 1.234)
"float"
-> (type? 12341234)
"integer"
Now ..the function should not return a string but actualy just
the quoted-result... like: file list string lambda macro array..
See 'type? as a detection on the "Predicates", partly..
Is it possible to have this as a default inside newlisp?
Norman.
PS: Actualy when you would use 'type? the use of all other
predicates could be eliminated..
PPS: extendig newlisp with new prdicates like:
utf8? date? url?(aka file?) would be nice to have too ;-)