This is the mail archive of the kawa@sources.redhat.com mailing list for the Kawa project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

kawa 1.6.99 and set!ing parameters


The following code is somewhat ugly but works on all Schemes I know -
except kawa
(I use this set!-if pattern in line 2 for setting defaults of optional
parameters quite frequently so I would prefer not to change this pattern to
a let-if pattern with a fresh variable pad2):

(define write-integer-pad (lambda (n size . pad)
  (set! pad (if (pair? pad) (car pad) #\space))  ; <----------
  (let ((n-size 0))
    (cond ((<= n 0)
           (set! n-size 1)))
    (do ((n2 n (quotient n2 10)))
      ((= n2 0))
      (set! n-size (+ n-size 1)))
    (let ((diff-size (- size n-size)))
      (cond ((> diff-size 0)
             (do-n (lambda ()
                     (write-char pad))
                   diff-size)))
      (write n)))))

> kawa
#|kawa:1|# (load "kawabug.scm")
kawabug.scm:2:4: warning - cannot convert literal (of type gnu.text.Char) to gnu.lists.LList

Is kawa's behavior supported by the R5RS standard?

Ciao
Sven


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]