[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Guile-commits] 58/99: Implement built-in symbol procedures.
From: |
Christopher Allan Webber |
Subject: |
[Guile-commits] 58/99: Implement built-in symbol procedures. |
Date: |
Sun, 10 Oct 2021 21:51:00 -0400 (EDT) |
cwebber pushed a commit to branch compile-to-js-merge
in repository guile.
commit 2adebea5d0694a00b62ec32108da5f6d05c33579
Author: Ian Price <ianprice90@googlemail.com>
AuthorDate: Wed Aug 2 21:14:57 2017 +0100
Implement built-in symbol procedures.
* module/language/js-il/runtime.js
(symbol->string, gensym): New procedures.
---
module/language/js-il/runtime.js | 16 ++++++++++++++++
1 file changed, 16 insertions(+)
diff --git a/module/language/js-il/runtime.js b/module/language/js-il/runtime.js
index e7d78e1..1107282 100644
--- a/module/language/js-il/runtime.js
+++ b/module/language/js-il/runtime.js
@@ -775,6 +775,22 @@ def_guile0("syntax-module", function (self, cont, obj) {
return cont(obj.module);
});
+// Symbols
+def_guile0("symbol->string", function (self, cont, sym) {
+ return cont(new scheme.String(sym.name));
+});
+
+var gensym_counter = 0;
+function scm_gensym (self, cont, prefix) {
+ var name = prefix ? prefix.s : "gen ";
+ name += gensym_counter;
+ gensym_counter += 1;
+
+ return cont(new scheme.Symbol(name));
+};
+def_guile0("gensym", scm_gensym);
+
+
// Strings
def_guile0("string=?", function (self, cont, s1, s2) {
return cont(coerce_bool(s1.s === s2.s));
- [Guile-commits] 35/99: Change local type representation and remove var type, (continued)
- [Guile-commits] 35/99: Change local type representation and remove var type, Christopher Allan Webber, 2021/10/10
- [Guile-commits] 42/99: compile-js uses the new cps representation, Christopher Allan Webber, 2021/10/10
- [Guile-commits] 43/99: Handle multiple conts in a function body, Christopher Allan Webber, 2021/10/10
- [Guile-commits] 46/99: JS-IL inliner has different count-calls for different clauses, Christopher Allan Webber, 2021/10/10
- [Guile-commits] 40/99: Merge branch 'stable-2.2' into compile-to-js-2017, Christopher Allan Webber, 2021/10/10
- [Guile-commits] 49/99: Compile Syntax Objects to Javascript, Christopher Allan Webber, 2021/10/10
- [Guile-commits] 39/99: Add missing simplify.scm to Makefile, Christopher Allan Webber, 2021/10/10
- [Guile-commits] 37/99: Fixup binop unparsing, Christopher Allan Webber, 2021/10/10
- [Guile-commits] 57/99: Implement built-in syntax procedures., Christopher Allan Webber, 2021/10/10
- [Guile-commits] 56/99: Implement builtin list procedures., Christopher Allan Webber, 2021/10/10
- [Guile-commits] 58/99: Implement built-in symbol procedures.,
Christopher Allan Webber <=
- [Guile-commits] 64/99: Implement procedure built-ins., Christopher Allan Webber, 2021/10/10
- [Guile-commits] 65/99: Implement module built-ins., Christopher Allan Webber, 2021/10/10
- [Guile-commits] 72/99: Implement basic `equal?' implementation, Christopher Allan Webber, 2021/10/10
- [Guile-commits] 68/99: struct-set! primitive returns no values, Christopher Allan Webber, 2021/10/10
- [Guile-commits] 71/99: modules should be passed current continuation, Christopher Allan Webber, 2021/10/10
- [Guile-commits] 79/99: Implement list builtins, Christopher Allan Webber, 2021/10/10
- [Guile-commits] 80/99: *features* is an empty list, Christopher Allan Webber, 2021/10/10
- [Guile-commits] 84/99: Add assignment js-type to (language javascript), Christopher Allan Webber, 2021/10/10
- [Guile-commits] 87/99: Create stub module forms for dependecies, Christopher Allan Webber, 2021/10/10
- [Guile-commits] 97/99: Switch use of $closure to $const-fun, Christopher Allan Webber, 2021/10/10