Commit 1b919a12 authored by Juergen Nickelsen's avatar Juergen Nickelsen

sequencep and related regtest 024

parent 9da3fcfc
......@@ -151,6 +151,11 @@
(eval-list body))
(eval resultform)))
(defun sequencep (object)
"return t if OBJECT is a sequence (list or string), nil else"
(or (listp object) (stringp object)))
(defun atom (ob)
"return true if OBJECT is an atom, i.e. not a pair"
(null (consp ob)))
......
......@@ -2,11 +2,6 @@
(testcmp "seqencep 0" '(sequencep nil) t)
(testcmp "seqencep 1" '(sequencep 'a) nil)
(testcmp "seqencep 2" '(sequencep "lala") t)
(testcmp "seqencep 3" '(sequencep (vector 2 3 4)) t)
(testcmp "seqencep 4" '(sequencep (list 3 4 5)) t)
(testcmp "seqencep 5" '(sequencep (make-table)) nil)
(testcmp "seqencep 6" '(sequencep 3.4) nil)
(testcmp "seqencep 7" '(sequencep ?\Newline) nil)
(testcmp "seqencep 8" '(sequencep ?a) nil)
(testcmp "seqencep 9" '(sequencep #/"^.*$") nil)
(testcmp "seqencep 6" '(sequencep 3.4) t) ; numbers are strings!
(testcmp "seqencep 10" '(sequencep (lambda () 3)) nil)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment