mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-04-30 20:00:19 +02:00
Add more types of constants
This commit is contained in:
parent
941f8fac01
commit
e9d0f97410
2 changed files with 49 additions and 0 deletions
|
@ -235,5 +235,28 @@
|
|||
(make-call
|
||||
(make-refine *scheme* (make-const "String"))
|
||||
(list (make-const c)))))
|
||||
((pair? c)
|
||||
(make-new
|
||||
(make-call
|
||||
(make-refine *scheme* (make-const "Pair"))
|
||||
(list (compile-const (car c))
|
||||
(compile-const (cdr c))))))
|
||||
((vector? c)
|
||||
(make-new
|
||||
(make-call
|
||||
(make-refine *scheme* (make-const "Vector"))
|
||||
(map compile-const (vector->list c)))))
|
||||
((char? c)
|
||||
(make-new
|
||||
(make-call
|
||||
(make-refine *scheme* (make-const "Char"))
|
||||
(list (make-const (string c))))))
|
||||
((keyword? c)
|
||||
(make-new
|
||||
(make-call
|
||||
(make-refine *scheme* (make-const "Keyword"))
|
||||
(list (make-const (symbol->string (keyword->symbol c)))))))
|
||||
((undefined? c)
|
||||
(make-refine *scheme* (make-const "UNDEFINED")))
|
||||
(else
|
||||
(throw 'uncompilable-const c))))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue