Permalink
Browse files

Fixed ##string-length.

  • Loading branch information...
Gabriano committed Aug 11, 2012
1 parent b7c6ad8 commit 86ffffd2fd5471457b0c527ede32d471fba1a1f8
Showing with 24 additions and 3 deletions.
  1. +22 −1 gsc/_t-univ.scm
  2. +2 −2 include/stamp.h
View
@@ -863,8 +863,14 @@
((list? obj)
(univ-list ctx obj))
+ ;; ((pair? obj)
+ ;; (univ-pair ctx obj))
+
((vector? obj)
(univ-vector ctx obj))
+
+ ((symbol? obj)
+ (univ-symbol ctx obj))
(else
(gen "UNIMPLEMENTED_OBJECT("
@@ -3907,6 +3913,22 @@ EOF
(compiler-internal-error
"##string, unknown target")))))
+(univ-define-prim "##string-length" #f #f
+
+ (lambda (ctx opnds)
+ (case (target-name (ctx-target ctx))
+
+ ((js)
+ (gen (translate-gvm-opnd ctx (list-ref opnds 0))
+ ".stringlength()"))
+
+ ((python ruby php) ;TODO: complete
+ (gen ""))
+
+ (else
+ (compiler-internal-error
+ "##string-length, unknown target")))))
+
;;(univ-define-prim "string-append" #f #f (lambda (ctx opnds) (gen "")))
(univ-define-prim "string-append" #f #f
@@ -3964,7 +3986,6 @@ EOF
(univ-define-prim "##string-set!" #f #t
(lambda (ctx opnds)
- (display "##string-set!")(newline)
(case (target-name (ctx-target ctx))
((js)
View
@@ -2,5 +2,5 @@
* Time stamp of last source code repository commit.
*/
-#define ___STAMP_YMD 20120810
-#define ___STAMP_HMS 191321
+#define ___STAMP_YMD 20120811
+#define ___STAMP_HMS 232000

0 comments on commit 86ffffd

Please sign in to comment.