#14 (reverse '()) fails

closed-fixed
nobody
None
6
2011-01-16
2009-07-24
No

The "reverse" builtin should use TST_LIST, not TST_PAIR; otherwise, it fails on the (permitted) case of (reverse '()).

Discussion

  • Kevin Cozens

    Kevin Cozens - 2010-01-29

    It seems reasonable to allow reverse to operate on an empty list. Neither the R5RS nor R6RS say it isn't allowed, only that reverse takes a list argument. While the suggested change does fix the problem, the reverse function should also be changed to verify that the passed parameter is a valid list.

     
  • Kevin Cozens

    Kevin Cozens - 2011-01-02
    • priority: 5 --> 6
     
  • Kevin Cozens

    Kevin Cozens - 2011-01-02

    Bumping priority so it stands out from the other bugs as it should be fixed for next release.

     
  • Kevin Cozens

    Kevin Cozens - 2011-01-02

    This should be fixed for the next release.

     
  • Kevin Cozens

    Kevin Cozens - 2011-01-16
    • status: open --> closed-fixed
     
  • Kevin Cozens

    Kevin Cozens - 2011-01-16

    R5RS does indeed state that reverse takes a list. FIx commited as revision 64 in SVN.

     

Log in to post a comment.