diff options
Diffstat (limited to 'bs')
-rw-r--r-- | bs/core.scm | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/bs/core.scm b/bs/core.scm index 943e586..73b328d 100644 --- a/bs/core.scm +++ b/bs/core.scm @@ -4,7 +4,7 @@ #:use-module ((ice-9 rdelim) #:select (read-line)) #:use-module (srfi srfi-1) #:export (fmt printf pr prn - first ffirst rest last butlast + first ffirst second rest last butlast true? false? some? empty? -> ->> fn /. curry comp repeat for seq turn @@ -59,15 +59,18 @@ (define (empty? a) (equal? a '())) -(define (first a) - (car a)) +(define (first coll) + (car coll)) -(define (ffirst a) - (first (first a))) +(define (ffirst coll) + (first (first coll))) -(define (rest a) +(define (rest coll) "Returns a list of the items after the first." - (cdr a)) + (cdr coll)) + +(define (second coll) + (first (rest coll))) (define (last coll) "Return the last time in coll, in linear time." |