From 2d49ed25acc03550036b124e2ffade0edf812150 Mon Sep 17 00:00:00 2001 From: Aryadev Chavali Date: Mon, 10 Feb 2025 07:23:02 +0000 Subject: Implement a "take" function to read subsequences of a list Basically a wrapper over subseq but for when using `->>` as the list is the last parameter. --- lib.functions.lisp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'lib.functions.lisp') diff --git a/lib.functions.lisp b/lib.functions.lisp index c7b3ed1..30c1e64 100644 --- a/lib.functions.lisp +++ b/lib.functions.lisp @@ -29,3 +29,6 @@ each member is STEP distance apart." (fn parse-integer* (inp) (-> (string) (or integer list)) (parse-integer inp :junk-allowed t)) + +(fn take (n lst) (-> (fixnum list) list) + (subseq lst 0 n)) -- cgit v1.2.3-13-gbd6f