[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Slib-discuss] Minor printf bug?
From: |
Aubrey Jaffer |
Subject: |
Re: [Slib-discuss] Minor printf bug? |
Date: |
Sun, 07 Dec 2008 16:49:55 -0500 (EST) |
| From: Kris De Volder <address@hidden>
| Date: Sun, 07 Dec 2008 12:10:24 -0800
|
| I ran across a problem with the SLIB printf library, which I
| *suspect* may be a minor bug. I say *suspect* because it is of
| course also possibly a bug in my code or my understanding of how
| things ought to work, instead of a bug in slib code. Either way
| I'd like to do something about the bug... whatever kind of bug it
| may be :-)
See patch below.
| The Slib FAQ doesn't talk about reporting bugs. So I gather the
| list may be a good place. I apologize if it is not. If so, please
| point me to a good way/place to report bugs in the future.
slib-discuss is good.
| Now for the "bug report".
|
| Steps to reproduce:
|
| 1) you will need a Scheme implementation which does not support the
| multiarg-apply feature.
|
| E.g. you could outcomment ;multiarg apply line in XXX-init file and
| then
|
| (define apply
| (let ((old-apply apply))
| (lambda (p a) (old-apply p a))))
|
| 2) In a Scheme repl evaluate following
|
| > (require 'printf)
| slib:load:
"file:/home/kdvolder/workspaces/kscheme/ca.kscheme/bin/slib/printf"
| slib:load:
"file:/home/kdvolder/workspaces/kscheme/ca.kscheme/bin/slib/strcase"
| slib:load:
"file:/home/kdvolder/workspaces/kscheme/ca.kscheme/bin/slib/sc4opt"
| > (printf "Hello World")
|
| The following error is reported (by my Scheme implementation, which is
| not yet publically available)
|
| > (printf "Hello world")
| ...
| It appears that the printf module is using multiarg apply, which is not
| provided (yet) by my implementation.
|
| When I check slib:features
| > slib:features
| -> (rev4-optional-procedures string-case printf dynamic-wind source
| vicinity srfi-59 srfi-96 r4rs ieee-p1178 full-continuation defmacro)
|
| Is this a bug? I reasoned that it is, because the printf library
| should either
| - somehow explicitly or implicitly require the 'multiarg-apply
| feature
| - or not use multi-arg apply
|
| From the slib:features list, it appears this environment does not
| purport to support multiarg-apply...
|
| Or maybe I am missing something and support of multiarg apply is
| implied by one of the features that is in the list above, and my
| implementation is in error because it did not actually provide
| multiarg apply while (implicitly) claiming that it does?
"printf.scm" should explicitly require multiarg-apply. Although
REQUIREs are transitive in many implementations, code should not
depend on that.
Thanks for finding that. This patch fixes it (also committed to CVS).
*** printf.scm 20 Dec 2006 11:38:53 -0500 1.35
--- printf.scm 07 Dec 2008 16:00:10 -0500
***************
*** 18,23 ****
--- 18,24 ----
;each case.
(require 'string-case)
+ (require 'multiarg-apply)
(require-if 'compiling 'generic-write)
;; Determine the case of digits > 9. We assume this to be constant.
| Anyway, I plan to resolve this issue by implementing
| multiarg-apply, but I would still like to report this problem (if
| it is indeed a bug) or clarify my misunderstanding (if it is not).
You needn't implement it. (REQUIRE 'MULTIARG-APPLY) will load
slib/mulapply.scm, which redefines APPLY to take multiple arguments.