Commits

Shlomi Fish committed 0cd96ba

r4751@telaviv1: shlomi | 2008-02-14 10:13:12 +0200
Added slice.

Comments (0)

Files changed (1)

99-problems/99-problems-test.lisp

 (split-test "3-5" ('(a b c) 5) ((a b c) ()))
 (split-test "a-k-3"  ('(a b c d e f g h i k) 3) ((a b c) ( d e f g h i k)))
 
+(declare-multi-result-func-test slice)
+
+(defun slice (the-list start end)
+  (car (split (cadr (split the-list (1- start))) (1+ (- end start)))))
+
+(slice-test "a-k-3-7" ('(a b c d e f g h i k) 3 7) (c d e f g))
+(slice-test "a-k-1-7" ('(a b c d e f g h i k) 1 7) (a b c d e f g))
+
 (cybertiggyr-test:run)