Menu

#1 testing against eof-object value believed non-portable

closed-fixed
nobody
None
5
2003-08-02
2003-07-11
No

Hi,

I believe there's a portability bug in SSAX.scm testing part:
(run-test (letrec
((a-tag (make-xml-token 'START (string->symbol "BR")))
(a-ref (make-xml-token 'ENTITY-REF (string->symbol "lt")))
(eof-object (with-input-from-string "" read))
...

1. I've a little problem because I haven't with-input-from-string in Kawa, but that's not the point
here.

2. R5RS provides an eof-object? predicate, not a eof-object constant, and says "The precise set of
end of objects will vary among implementations, [...]".
I.e. I believe code to be in error which invokes
(equal? token expected-token)) ; where expect-token is the above eof-object
because it may not work in the presence of multiple EOF objects.
[This is not a problem in Kawa which has a unique such object: #!eof]

I believe this fraction of the testing code ought to be rewritten in a way to use the R5RS
eof-object? predicate instead of the above test:

(if this-is-an-eof-test (eof-object? token) (equal? token expected-token))

Regards,
Jörg Höhle.

Discussion

  • Jörg Höhle

    Jörg Höhle - 2003-07-15

    patch to above and other small bugs

     
  • Jörg Höhle

    Jörg Höhle - 2003-07-15

    Logged In: YES
    user_id=377168

    I made the above sketched patches and other tiny fixes which
    I submit as an annotated diff/patch file against the CVS
    snapshot that I downloaded.
    Please include in CVS. I transfer copyright to Oleg Kiselyov
    and put it into the public domain.

     
  • Oleg Kiselyov

    Oleg Kiselyov - 2003-07-18
    • status: open --> closed-remind
     
  • Oleg Kiselyov

    Oleg Kiselyov - 2003-07-18

    Logged In: YES
    user_id=4017

    According to an interpretation kindly provided by an R5RS
    author, R5RS systems are meant to have only one EOF object
    (which may vary from one system to another).
    See a message "Re: testing against eof-object value believed
    non-portable SSAX code" posted on July 14, 2003 on the
    SSAX-SXML mailing list for more details.

     
  • Jörg Höhle

    Jörg Höhle - 2003-07-30
    • status: closed-remind --> open-remind
     
  • Jörg Höhle

    Jörg Höhle - 2003-07-30

    Logged In: YES
    user_id=377168

    Well, even if you don't feel a need for that part of the
    patch (but see my response from 30th of July), there's more
    than that in the attached patch file and you should really
    look at it and take note of what I put there.

    Regards,
    Jrg Hhle.

     
  • Oleg Kiselyov

    Oleg Kiselyov - 2003-08-02

    Logged In: YES
    user_id=4017

    Applied suggested changes to SSAX.scm. For more details,
    see a message posted on the SSAX-SXML list on
    Aug 1, 2003.

     
  • Oleg Kiselyov

    Oleg Kiselyov - 2003-08-02
    • status: open-remind --> closed-fixed
     

Log in to post a comment.