[ssax-sxml] small code modification request in look-for-str.scm (for cleanup +work around kawa bug
Brought to you by:
oleg
From: Hoehle, Joerg-C. <Joe...@t-...> - 2003-07-14 12:54:05
|
Hi, To anybody: if you got SSAX/SXML to compile and fully validate=20 using Kawa, I'd like to hear from you! I'm trying to eradicate bugs (primarily by having them reported) in = whatever software I happen to want to use. Kawa has trouble with a form in look-for-str.scm. Agreed, it's clearly = a problem with Kawa (I reported the problem), but looking at the SSAX = code, I wonder whether it could be rewritten to take advantage of = input-parse.scm which provides the define-opt syntax to better express = what it's is doing and work around the bug as a side effect. Instead of currently (define (MISCIO:find-string-from-port? str <input-port> . max-no-char) (set! max-no-char (if (null? max-no-char) #f (car max-no-char))) the code could read (define-opt (MISCIO:find-string-from-port? str <input-port> (optional = (max-no-char #f))) ; -- one less set! - more FP ;) It would be a) clearer and b) the bug would go away. Drawback: a dependency from look-for-str.scm upon input-parse.scm which = defines define-opt. What do the maintainers think? Incidentally -- code modification request #2: kawa also supports = #!optional, so input-parse.scm could be modified w.r.t. cond-expand. But wait -- Kawa does not have with-input-from-string that's used = therein, only call-with-input-string -- [... I'm beginning to hate = Scheme for portability] -- ok, gambit has that one as well, but not = bigloo... Anyway, here's the Kawa bug: >;s:/src/CVS/ssax/SSAX/lib/look-for-str.scm:40:4: warning -=20 >cannot convert literal (of type java.lang.Boolean) to gnu.lists.LList >A small test case extracted from the above >(define bar (lambda (str . max-no-char) > (set! max-no-char (if (null? max-no-char) #f (car max-no-char))) > (list str max-no-char) >)) >;(bar "abc") -> error >;(bar "abc" 1) -> error ;(bar "abc" '(1 2 3)) -> ("abc" (1 2 3)) Regards, J=F6rg H=F6hle. Using (nearly CVS) SSAX, Kawa-1.7.jar on JDK (1.3.1?) on MS-Windows-2k |