1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-05-01 04:10:18 +02:00

Compile string constants

This commit is contained in:
Ian Price 2015-06-07 21:48:02 +01:00
parent 86fabef4ca
commit a4003003e2
3 changed files with 12 additions and 0 deletions

View file

@ -167,6 +167,9 @@
(define (print-const c port)
(cond ((string? c)
;; FIXME:
;; Scheme strings and JS Strings are different, and not just in
;; terms of mutability
(write c port))
((number? c)
(write c port))

View file

@ -112,5 +112,10 @@
(make-call
(make-refine *scheme* (make-const "list"))
(map compile-const c)))
((string? c)
(make-new
(make-call
(make-refine *scheme* (make-const "String"))
(list (make-const c)))))
(else
(throw 'uncompilable-const c))))

View file

@ -118,6 +118,10 @@ scheme.Symbol = function(s) {
// Chars
// Strings
scheme.String = function(s) {
this.s = s;
return this;
};
// Closures
scheme.Closure = function(f, size) {