guile-commits
[Top][All Lists]
Advanced

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

[Guile-commits] branch master updated: Fix reading improper curly-infix


From: Andy Wingo
Subject: [Guile-commits] branch master updated: Fix reading improper curly-infix expressions
Date: Thu, 04 Mar 2021 06:42:35 -0500

This is an automated email from the git hooks/post-receive script.

wingo pushed a commit to branch master
in repository guile.

The following commit(s) were added to refs/heads/master by this push:
     new d904392  Fix reading improper curly-infix expressions
d904392 is described below

commit d904392885517296ad68e915b4f11c19388559f1
Author: Andy Wingo <wingo@pobox.com>
AuthorDate: Thu Mar 4 12:40:14 2021 +0100

    Fix reading improper curly-infix expressions
    
    * module/ice-9/read.scm (%read): A fix to last night's fix, to make
    srfi-105.test pass.
---
 module/ice-9/read.scm | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/module/ice-9/read.scm b/module/ice-9/read.scm
index 8ed4ea6..80f145b 100644
--- a/module/ice-9/read.scm
+++ b/module/ice-9/read.scm
@@ -199,9 +199,9 @@
                                  (cons* op x (cdr tail))))))))))
       (cond
        ((not (eqv? rdelim #\})) ret) ; Only on {...} lists.
-       ((not (pair? ret)) ret)            ; {} => ()
-       ((not (pair? (cdr ret))) (car ret)); {x} => x
-       ((not (pair? (cddr ret))) ret)     ; {x y} => (x y)
+       ((not (pair? ret)) ret)       ; {} => (); {.x} => x
+       ((null? (cdr ret)) (car ret)); {x} => x
+       ((and (pair? (cdr ret)) (null? (cddr ret))) ret) ; {x y} => (x y)
        ((extract-infix-list ret))   ; {x + y + ... + z} => (+ x y ... z)
        (else (cons '$nfx$ ret))))   ; {x y . z} => ($nfx$ x y . z)
     (define curly? (eqv? rdelim #\}))



reply via email to

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