ref: ba328f34850a8030652c105a2258599ab5847f0d
parent: cc543231d0958fb8d0b036c3f865d8d864e114e6
author: Sigrid Solveig Haflínudóttir <sigrid@ftrv.se>
date: Sun Dec 22 21:14:37 EST 2024
a bit of style
--- a/flisp.boot
+++ b/flisp.boot
@@ -300,7 +300,7 @@
#fn(write) nconc #fn(map) list top-level-value #fn(io-write) *linefeed* #fn(io-close)))
#fn("6000n1A50420061:" #(#fn(raise)))) make-system-image)
map! #fn("8000n21D1B3B04101<51_41=?1@\x1d/4:" #() map!) map-int
- #fn(";000n2701E52340q:0E51qPq\x8a78786_4K1K~21870>2|486:" #(<= #fn("7000n1A<F051qPN4AA<=_:" #())) map-int)
+ #fn(";000n2701E52340q:0E51qPq\x8a78786_4K7115122870>2|486:" #(<= 1- #fn("7000n1A<F051qPN4AA<=_:" #())) map-int)
mark-label #fn("8000n270021163:" #(emit label) mark-label) max
#fn(";000z11J400:70210163:" #(foldl #fn("6000n201L3401:0:" #())) max) member #fn("7000n21H340O:1<0d3401:7001=62:" #(member) member)
memv #fn("7000n21H340O:1<0c3401:7001=62:" #(memv) memv) min
--- a/system.lsp
+++ b/system.lsp
@@ -490,15 +490,14 @@
(define (map-int f n)
(if (<= n 0)
- ()
- (let ((first (cons (f 0) ()))
- (acc ()))
- (set! acc first)
- (for 1 (- n 1)
- (λ (i)
- (begin (set-cdr! acc (cons (f i) ()))
- (set! acc (cdr acc)))))
- first)))
+ nil
+ (let ((first (cons (f 0) ()))
+ (acc ()))
+ (set! acc first)
+ (for 1 (1- n)
+ (λ (i) (set-cdr! acc (cons (f i) ()))
+ (set! acc (cdr acc))))
+ first)))
(define (iota n) (map-int identity n))
@@ -700,8 +699,8 @@
(if (null? strlist) ""
(let ((b (buffer)))
(io-write b (car strlist))
- (for-each (λ (s) (begin (io-write b sep)
- (io-write b s)))
+ (for-each (λ (s) (io-write b sep)
+ (io-write b s))
(cdr strlist))
(iostream->string b))))