Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Karsten Poeck
ansi-test
Commits
1a65162b
Commit
1a65162b
authored
Jan 02, 2003
by
pfdietz
Browse files
Extended EQUALP-WITH-CASE to two dimensional arrays.
parent
d5c03686
Changes
1
Hide whitespace changes
Inline
Side-by-side
ansi-tests/rt/rt.lsp
View file @
1a65162b
...
...
@@ -105,16 +105,15 @@
(defun equalp-with-case (x y)
"Like EQUALP, but doesn't do case conversion of characters.
Currently doesn't work on arrays of dimension >
1
."
Currently doesn't work on arrays of dimension >
2
."
(cond
((consp x)
(and (consp y)
(equalp-with-case (car x) (car y))
(equalp-with-case (cdr x) (cdr y))))
((and (typep x 'array)
(typep y 'array)
(not (eql (array-rank x) (array-rank y))))
nil)
(= (array-rank x) 0))
(equalp-with-case (aref x) (aref y)))
((typep x 'vector)
(and (typep y 'vector)
(let ((x-len (length x))
...
...
@@ -125,8 +124,19 @@
for e2 across y
always (equalp-with-case e1 e2))))))
((and (typep x 'array)
(= (array-rank x) 0))
(equalp-with-case (aref x) (aref y)))
(typep y 'array)
(not (equal (array-dimensions x)
(array-dimensions y))))
nil)
;; I should use ROW-MAJOR-AREF to do this, but that's broken
;; in GCL right now.
((and (typep x 'array)
(= (array-rank x) 2))
(let ((dim (array-dimensions x)))
(loop for i from 0 below (first dim)
always (loop for j from 0 below (second dim)
always (equalp-with-case (aref x i j)
(aref y i j))))))
(t (eql x y))))
(defun do-entry (entry &optional
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment