add a beginning fx

This commit is contained in:
Quentin 2020-07-04 15:13:54 +02:00
parent 4a4d706798
commit 2df10ebf9e

View file

@ -10,7 +10,18 @@
((> b e) '()) ((> b e) '())
(#t (cons b (rangeinc (+ 1 b) e))))) (#t (cons b (rangeinc (+ 1 b) e)))))
(define (less-than l n) (cond ((null? l) #t) ((<= n 0) #f) (#t (less-than (cdr l) (- n 1))))) (define (less-than l n)
(cond
((null? l) #t)
((<= n 0) #f)
(#t (less-than (cdr l) (- n 1)))))
(define (beginning l n)
(cond
((null? l) '())
((<= n 0) '())
(#t (cons (car l) (beginning (cdr l) (- n 1))))))
(define (unit v) v) (define (unit v) v)
(define (aget key alist) (cdr (assoc key alist))) (define (aget key alist) (cdr (assoc key alist)))
(define (aset key val alist) (define (aset key val alist)