From f57b987ce66957a86baa846a813d5d3ddee6c6db Mon Sep 17 00:00:00 2001 From: Ben Sima Date: Wed, 9 Feb 2022 18:19:00 -0500 Subject: Fix simple errors in Serval and core --- bs/core.scm | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) (limited to 'bs/core.scm') 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." -- cgit v1.2.3