From dc6b2f701bd1cc36a55039f7fc36ac48a3d439df Mon Sep 17 00:00:00 2001 From: Aryadev Chavali Date: Fri, 21 Feb 2025 14:00:08 +0000 Subject: Add unit tests for lib.functions.split --- lib/functions.lisp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'lib/functions.lisp') diff --git a/lib/functions.lisp b/lib/functions.lisp index dd9976d..073e34a 100644 --- a/lib/functions.lisp +++ b/lib/functions.lisp @@ -31,10 +31,10 @@ each member is STEP distance apart." "Return the first N elements of LST." (subseq lst 0 n)) -(fn split (n lst) (-> (fixnum list) list) +(fn split (n lst) (-> (fixnum sequence) (values sequence sequence)) "Return CONS where CAR is the first N elements of LST and CDR is the rest." - (cons (take n lst) - (subseq lst n))) + (values (take n lst) + (subseq lst n))) (fn rev-map (indicator lst &key (key-eq #'eq)) (-> (function list &key (:key-eq function)) list) -- cgit v1.2.3-13-gbd6f