[uim-commit] r1248 - branches/r5rs/scm

yamaken at freedesktop.org yamaken at freedesktop.org
Sun Aug 21 07:44:21 EST 2005


Author: yamaken
Date: 2005-08-20 14:44:19 -0700 (Sat, 20 Aug 2005)
New Revision: 1248

Modified:
   branches/r5rs/scm/custom.scm
   branches/r5rs/scm/util.scm
Log:
* scm/util.scm
  - (string-escape): Add a comment about its wrong implementation. It
    must be re-implemented based on the comment
* scm/custom.scm
  - (custom-list-as-literal, custom-value-as-literal): Revert the
    wrong change in r1244. custom-list-as-literal does not intend to
    overwrite original lst. The change seems to be applied based on a
    misrecognition about the specification of the string-escape


Modified: branches/r5rs/scm/custom.scm
===================================================================
--- branches/r5rs/scm/custom.scm	2005-08-20 18:31:37 UTC (rev 1247)
+++ branches/r5rs/scm/custom.scm	2005-08-20 21:44:19 UTC (rev 1248)
@@ -664,7 +664,7 @@
 				 ((symbol? elem)
 				  (symbol->string elem))
 				 ((string? elem)
-				  (set! elem (string-escape elem)))
+				  (string-escape elem))
 				 (else
 				  "")))
 			      lst)))
@@ -679,9 +679,9 @@
        ((eq? type 'integer)
 	(digit->string val))
        ((eq? type 'string)
-	(set! val (string-escape val)))
+	(string-escape val))
        ((eq? type 'pathname)
-	(set! val (string-escape val)))
+	(string-escape val))
        ((eq? type 'choice)
 	(string-append "'" (symbol->string val)))
        ((or (eq? type 'ordered-list)

Modified: branches/r5rs/scm/util.scm
===================================================================
--- branches/r5rs/scm/util.scm	2005-08-20 18:31:37 UTC (rev 1247)
+++ branches/r5rs/scm/util.scm	2005-08-20 21:44:19 UTC (rev 1248)
@@ -37,6 +37,17 @@
 ;; generic utilities
 ;;
 
+;; FIXME: Properly escape all special chars in s such as "\"", "\\" as
+;; original siod based one does.
+;;
+;;$ uim-sh
+;;uim> (string-escape "\"")
+;;"\"\\\"\""
+;;uim> (string-escape "\\")
+;;"\"\\\\\""
+;;uim> (string-escape "\n")
+;;"\"\\n\""
+;;
 ;; TODO: write test
 (define string-escape
   (lambda (s)



More information about the uim-commit mailing list