(define (format-time-zone name offset)
(if (zero? offset) name
(receive (sign offset)
(if (< offset 0)
(values #\+ (- offset)) ; Notice the flipped sign
(values #\- offset)) ; of SIGN.
(let* ((offset (modulo offset 86400))
(h (quotient offset 3600))
(m (quotient (modulo offset 3600) 60))
(s (modulo offset 60)))
(if (zero? s)
(if (zero? m)
(format #f "~a~a~d" name sign h) ; name+h
-> (format #f "~a~a~a:~a" ; name+hh:mm
sign (two-digits h) (two-digits m)))
-> (format #f "~a~a~a:~a:~a" ; name+hh:mm:ss
sign (two-digits h) (two-digits m) (two-digits
Am I dreaming or are there one too many "~a"s on the two lines marked `->'?
On my system (Debian Linux 1.3.1/scsh 0.5.1) this causes a first call
to (date) to fail "insufficient arguments to format", while a second
call works correctly.
I wonder if what it really is, is a missing `name' as the first
arguement to those `format's? Look at the comment. It says
"name+hh:mm:ss". I think that's what it's author intended. The
first `format' has the `name' arg... see it?
I've got `scsh' packaged for Debian. After I work out a few minor
problems, I will upload it. I've not heard from the authors yet...
I will assume silence is consent, and upload to `unstable,
non-free/interpreters' soonish. I'll include in the diff the above
fix, as well as mail a patch for it to this list. (unless asked not
to do so.)
mailto:firstname.lastname@example.org (Karl M. Hegbloom)
Portland, OR USA
Debian GNU pre-2.0 Linux 2.0.33+trans+QNX AMD K5 PR-133 XEmacs-21b34
(("Dont judge a book by its cover" . "Read the book"))