Skip to content
Snippets Groups Projects
Commit 5552b6ee authored by toy's avatar toy
Browse files

The deftransform for find should return the item we found, not the

item we were looking for (because of :test-not).
parent 00e106d4
No related branches found
No related tags found
No related merge requests found
......@@ -5,7 +5,7 @@
;;; Carnegie Mellon University, and has been placed in the public domain.
;;;
(ext:file-comment
"$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/compiler/seqtran.lisp,v 1.24 2000/05/02 04:44:28 dtc Exp $")
"$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/compiler/seqtran.lisp,v 1.25 2003/02/21 16:06:57 toy Exp $")
;;;
;;; **********************************************************************
;;;
......@@ -183,11 +183,13 @@
(deftransform find ((item sequence &key from-end (test #'eql) (start 0) end)
(t simple-string &rest t))
`(if (position item sequence
,@(when from-end `(:from-end from-end))
:test test :start start :end end)
item
nil))
(let ((index (gensym)))
`(let ((,index (position item sequence
,@(when from-end `(:from-end from-end))
:test test :start start :end end)))
(if ,index
(elt sequence ,index)
nil))))
;;;; Utilities:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment