summaryrefslogtreecommitdiff
path: root/bs/core.scm
diff options
context:
space:
mode:
authorBen Sima <ben@bsima.me>2022-02-09 18:19:00 -0500
committerBen Sima <ben@bsima.me>2022-02-09 18:19:00 -0500
commitf57b987ce66957a86baa846a813d5d3ddee6c6db (patch)
treeb81fdeb7b9478aa2522c53173d9b86bf53ceecbd /bs/core.scm
parentc2de6ff2bdf08620a4697733ea32c2ae847612f8 (diff)
Fix simple errors in Serval and core
Diffstat (limited to 'bs/core.scm')
-rw-r--r--bs/core.scm17
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."