mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-06-09 13:30:26 +02:00
Don't diverge when serializing cyclic lists during compilation
* module/language/glil/compile-assembly.scm (scheme-list?): Don't diverge when serializing cyclic lists.
This commit is contained in:
parent
39eb0b7297
commit
c5f6c2e47f
1 changed files with 5 additions and 3 deletions
|
@ -106,9 +106,11 @@
|
|||
;; This tests for a proper scheme list whose last cdr is '(), not #nil.
|
||||
;;
|
||||
(define (scheme-list? x)
|
||||
(or (eq? x '())
|
||||
(and (pair? x)
|
||||
(scheme-list? (cdr x)))))
|
||||
(and (list? x)
|
||||
(or (eq? x '())
|
||||
(let ((p (last-pair x)))
|
||||
(and (pair? p)
|
||||
(eq? (cdr p) '()))))))
|
||||
|
||||
;; Note: in all of these procedures that build up constant tables, the
|
||||
;; first (zeroth) index is reserved. At runtime it is replaced with the
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue