chicken-hackers
[Top][All Lists]
Advanced

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

[Chicken-hackers] [PATCH 1/1] Fix csi's "report" feature and add guard f


From: Evan Hanson
Subject: [Chicken-hackers] [PATCH 1/1] Fix csi's "report" feature and add guard for `keyword-style' parameter
Date: Mon, 24 Jun 2019 20:17:26 +1200

The interpreter's "report" command (,r) was a casualty of db2608b1f,
which causes `symbol->string' to fail when passed a keyword.

Update that code to use `keyword->string' and add a guard procedure to
the keyword-style parameter to ensure that it is always a keyword.
---
 csi.scm     | 2 +-
 library.scm | 4 +++-
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/csi.scm b/csi.scm
index 17c6d1a1..20769369 100644
--- a/csi.scm
+++ b/csi.scm
@@ -508,7 +508,7 @@ EOF
                     (installation-repository)
                    (repository-path)
                    ##sys#include-pathnames
-                   (symbol->string (keyword-style))
+                   (keyword->string (keyword-style))
                    (shorten (vector-ref sinfo 0))
                    (shorten (vector-ref sinfo 1))
                    (vector-ref sinfo 2)
diff --git a/library.scm b/library.scm
index b7d0c10e..4c647c30 100644
--- a/library.scm
+++ b/library.scm
@@ -3677,10 +3677,12 @@ EOF
   (##sys#read-error port "invalid `#...' read syntax" n) )
 
 (set! chicken.base#case-sensitive (make-parameter #t))
-(set! chicken.base#keyword-style (make-parameter #:suffix))
 (set! chicken.base#parentheses-synonyms (make-parameter #t))
 (set! chicken.base#symbol-escape (make-parameter #t))
 
+(set! chicken.base#keyword-style
+  (make-parameter #:suffix (lambda (x) (##sys#check-keyword x 'keyword-style) 
x)))
+
 (define ##sys#current-read-table (make-parameter (##sys#make-structure 
'read-table #f #f #f)))
 
 (define ##sys#read-warning
-- 
2.21.0




reply via email to

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