unofficial mirror of bug-guile@gnu.org 
 help / color / mirror / Atom feed
* bug#31594: Code causes guild compile to hang
@ 2018-05-25 15:32 Tommi Höynälänmaa
  2018-05-27 13:04 ` bug#31594: Information on my system Tommi Höynälänmaa
  2018-06-05 22:01 ` bug#31594: Code causes guild compile to hang Mark H Weaver
  0 siblings, 2 replies; 4+ messages in thread
From: Tommi Höynälänmaa @ 2018-05-25 15:32 UTC (permalink / raw)
  To: 31594

[-- Attachment #1: Type: text/plain, Size: 2036 bytes --]

The following code causes command "guild compile" to hang:
---cut here---
(define (select-nearest-methods binder
                index v-fixed-args v-rest-arg vb-included)
  (dwl4 "select-nearest-methods")
  (assert (is-binder? binder))
  (let ((n (vector-length vb-included)))
    (do ((i 0 (+ i 1))) ((>= i n))
      (if (vector-ref vb-included i)
      (let ((t1 (get-item-at-index
             (vector-ref v-fixed-args i)
             (vector-ref v-rest-arg i)
             index)))
        (do ((j 0 (+ j 1))) ((>= j n))
          (if (and (not (= i j))
               (vector-ref vb-included j))
          (let ((t2 (get-item-at-index
                 (vector-ref v-fixed-args j)
                 (vector-ref v-rest-arg j)
                 index)))
            (if (is-t-subtype? binder t1 t2)
            ;; t2 is excluded
            (vector-set! vb-included j #f))))))))))
---cut here---

However, the following code works fine:
---cut here---
(define (method-loop binder
             index v-fixed-args v-rest-arg vb-included t1 i n)
  (do ((j 0 (+ j 1))) ((>= j n))
    (if (and (not (= i j))
         (vector-ref vb-included j))
    (let ((t2 (get-item-at-index
           (vector-ref v-fixed-args j)
           (vector-ref v-rest-arg j)
           index)))
      (if (is-t-subtype? binder t1 t2)
          ;; t2 is excluded
          (vector-set! vb-included j #f))))))


(define (select-nearest-methods binder
                index v-fixed-args v-rest-arg vb-included)
  (dwl4 "select-nearest-methods")
  (assert (is-binder? binder))
  (let ((n (vector-length vb-included)))
    (do ((i 0 (+ i 1))) ((>= i n))
      (if (vector-ref vb-included i)
      (let ((t1 (get-item-at-index
             (vector-ref v-fixed-args i)
             (vector-ref v-rest-arg i)
             index)))
        (method-loop binder index v-fixed-args v-rest-arg vb-included
             t1 i n))))))
---cut here---

This problem occurs with guile 2.2.3.

     - Tommi Höynälänmaa

[-- Attachment #2: Type: text/html, Size: 2646 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2018-06-06  2:23 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-05-25 15:32 bug#31594: Code causes guild compile to hang Tommi Höynälänmaa
2018-05-27 13:04 ` bug#31594: Information on my system Tommi Höynälänmaa
2018-06-05 22:01 ` bug#31594: Code causes guild compile to hang Mark H Weaver
2018-06-06  2:23   ` Mark H Weaver

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).