bugKawa - Bugs: bug #37633, char-set-union with same char-sets

 
 

bug #37633: char-set-union with same char-sets

Submitter:  None
Submitted:  Fri 26 Oct 2012 12:04:24 AM UTC
   
 
Category:  Scheme library Severity:  3 - Normal
Item Group:  None Status:  Fixed
Privacy:  Public Assigned to:  None
Open/Closed:  Closed
* Mandatory Fields

Add a New Comment Rich Markup
   

Sun 23 Dec 2012 10:55:31 PM UTC, comment #1: 

Thanks for the bug report and fix, and sorry I let it sit so long.
It's checked in now.

Per Bothner <bothner>
Group administrator
Fri 26 Oct 2012 12:04:24 AM UTC, original submission:  

char-set-union from the srfi-14 lib goes in an infinite loop when applying it to the same charsets. For example, this fails with a stack overflow:

(import (srfi :14)) (char-set-union char-set:ascii char-set:ascii)

it is fixed by defining %boundary-pairs-union as follows, with one additional and clause:

(define (%boundary-pairs-union (l1 ::list) (l2 ::list)) ::list
  (display l1) (display " -- ")
  (display l2) (newline)
  (cond ((null? l1) l2)
        ((null? l2) l1)
        ((or (> (cdar l2) (cdar l1))        ; swap arguments if
             (and (= (cdar l2) (cdar l1))   ; necessary to ensure
                  (< (caar l2) (cdar l1))   ; (cdar l1) is highest
                  (> (caar l2) (caar l1))))
         (%boundary-pairs-union l2 l1))
        (else
....

Anonymous

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by bothner (Posted a comment)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.

     

    Follow 2 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2012-12-23 bothner StatusNone Fixed
        Open/ClosedOpen Closed

    Back to the top

    Powered by Savane 3.13-4b48.
    Corresponding source code