summaryrefslogtreecommitdiffstats
path: root/obj2str.scm
diff options
context:
space:
mode:
authorBryan Newbold <bnewbold@robocracy.org>2017-02-20 00:05:28 -0800
committerBryan Newbold <bnewbold@robocracy.org>2017-02-20 00:05:28 -0800
commit87b82b5822ca54228cfa6df29be3ad9d4bc47d16 (patch)
tree1eb4f87abd38bea56e08335d939e8171d5e7bfc7 /obj2str.scm
parentbd9733926076885e3417b74de76e4c9c7bc56254 (diff)
downloadslib-87b82b5822ca54228cfa6df29be3ad9d4bc47d16.tar.gz
slib-87b82b5822ca54228cfa6df29be3ad9d4bc47d16.zip
Import Upstream version 2d2upstream/2d2
Diffstat (limited to 'obj2str.scm')
-rw-r--r--obj2str.scm23
1 files changed, 11 insertions, 12 deletions
diff --git a/obj2str.scm b/obj2str.scm
index a8445f6..a9b8313 100644
--- a/obj2str.scm
+++ b/obj2str.scm
@@ -1,9 +1,9 @@
;;; "obj2str.scm", write objects to a string.
;Copyright (C) 1993, 1994 Aubrey Jaffer
;
-;Permission to copy this software, to redistribute it, and to use it
-;for any purpose is granted, subject to the following restrictions and
-;understandings.
+;Permission to copy this software, to modify it, to redistribute it,
+;to distribute modified versions, and to use it for any purpose is
+;granted, subject to the following restrictions and understandings.
;
;1. Any copy made of this software must include this copyright notice
;in full.
@@ -52,13 +52,12 @@
(generic-write obj #f #f
(lambda (str)
(let ((len (string-length str)))
- (if (> len left)
- (begin
- (set! result (cons (substring str 0 left) result))
- (set! left 0)
- #f)
- (begin
- (set! result (cons str result))
- (set! left (- left len))
- #t)))))
+ (cond ((> len left)
+ (set! result (cons (substring str 0 left) result))
+ (set! left 0)
+ #f)
+ (else
+ (set! result (cons str result))
+ (set! left (- left len))
+ #t)))))
(reverse-string-append result)))