diff options
author | Bryan Newbold <bnewbold@robocracy.org> | 2017-02-20 00:05:28 -0800 |
---|---|---|
committer | Bryan Newbold <bnewbold@robocracy.org> | 2017-02-20 00:05:28 -0800 |
commit | 87b82b5822ca54228cfa6df29be3ad9d4bc47d16 (patch) | |
tree | 1eb4f87abd38bea56e08335d939e8171d5e7bfc7 /obj2str.scm | |
parent | bd9733926076885e3417b74de76e4c9c7bc56254 (diff) | |
download | slib-87b82b5822ca54228cfa6df29be3ad9d4bc47d16.tar.gz slib-87b82b5822ca54228cfa6df29be3ad9d4bc47d16.zip |
Import Upstream version 2d2upstream/2d2
Diffstat (limited to 'obj2str.scm')
-rw-r--r-- | obj2str.scm | 23 |
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))) |