bug-kawa
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug-kawa] [bug #37633] char-set-union with same char-sets


From: anonymous
Subject: [Bug-kawa] [bug #37633] char-set-union with same char-sets
Date: Fri, 26 Oct 2012 00:04:25 +0000
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_2) AppleWebKit/536.26.14 (KHTML, like Gecko) Version/6.0.1 Safari/536.26.14

URL:
  <http://savannah.gnu.org/bugs/?37633>

                 Summary: char-set-union with same char-sets
                 Project: Kawa
            Submitted by: None
            Submitted on: Fri 26 Oct 2012 12:04:24 AM UTC
                Category: Scheme library
                Severity: 3 - Normal
              Item Group: None
                  Status: None
                 Privacy: Public
             Assigned to: None
             Open/Closed: Open
         Discussion Lock: Any

    _______________________________________________________

Details:

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
....





    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?37633>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]