l-99

solutions to l-99 (slow)
Log | Files | Refs | Feed | README

commit f9bc95b9cadce71c591ebe1de5333553e17724f4
parent b4cd4f81bdd64079152b432f8677ba1cbb3a8626
Author: Jenny Doe <tng@soykaf.me>
Date:   Thu,  2 May 2019 14:31:09 +0200

added: p20.scm

Diffstat:
Ap20.scm | 9+++++++++
1 file changed, 9 insertions(+), 0 deletions(-)

diff --git a/p20.scm b/p20.scm @@ -0,0 +1,9 @@ +; (*) Remove the K'th element from a list. +; Example: +; * (remove-at '(a b c d) 2) +; (A C D) + +(define (remove-at ls n) + (if (= n 1) + (cdr ls) + (cons (car ls) (remove-at (cdr ls) (- n 1)))))