;; copy-list
(defun our-copy-list(lst)
(reduce #'(lambda (x f) (cons x f)) lst :from-end t :initial-value nil))
;; remove-duplicates
(defun our-remove-duplicates(lst)
(reduce #'(lambda (x f) (adjoin x f)) lst :from-end t :initial-value nil))
;; find-if
(defun our-find-if(fn lst)
(reduce #'(lambda (x f) (if (funcall fn x) x f)) lst :from-end t :initial-value nil))
;; some
(defun our-some(fn lst)
(reduce #'(lambda (x f) (or (funcall fn x) f)) lst :from-end t :initial-value nil))
;; テスト
;; copy-list
(defparameter *lst* (list 1 (list 2 3)))
(defparameter *clst* (our-copy-list *lst*))
(eq *clst* *lst*)
(equal *clst* *lst*)
;; our-remove-duplicates
(our-remove-duplicates '(a b c b d d e))
;; our-find-if
(our-find-if #'evenp '(3 1 4 1 5 9))
;; our-some
(our-some #'integerp '(1 3 b 2.7))
(our-some #'integerp '(a 3.1 b 2.7))
OzsgY29weS1saXN0CihkZWZ1biBvdXItY29weS1saXN0KGxzdCkKICAgIChyZWR1Y2UgIycobGFtYmRhICh4IGYpIChjb25zIHggZikpIGxzdCA6ZnJvbS1lbmQgdCA6aW5pdGlhbC12YWx1ZSBuaWwpKQoKOzsgcmVtb3ZlLWR1cGxpY2F0ZXMKKGRlZnVuIG91ci1yZW1vdmUtZHVwbGljYXRlcyhsc3QpCiAgKHJlZHVjZSAjJyhsYW1iZGEgKHggZikgKGFkam9pbiB4IGYpKSBsc3QgOmZyb20tZW5kIHQgOmluaXRpYWwtdmFsdWUgbmlsKSkKCjs7IGZpbmQtaWYKKGRlZnVuIG91ci1maW5kLWlmKGZuIGxzdCkKICAocmVkdWNlICMnKGxhbWJkYSAoeCBmKSAoaWYgKGZ1bmNhbGwgZm4geCkgeCBmKSkgbHN0IDpmcm9tLWVuZCB0IDppbml0aWFsLXZhbHVlIG5pbCkpCgo7OyBzb21lCihkZWZ1biBvdXItc29tZShmbiBsc3QpCiAgKHJlZHVjZSAjJyhsYW1iZGEgKHggZikgKG9yIChmdW5jYWxsIGZuIHgpIGY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