[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Guile-commits] 57/99: Implement built-in syntax procedures.
From: |
Christopher Allan Webber |
Subject: |
[Guile-commits] 57/99: Implement built-in syntax 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 5d49a5be186930fcdc750f99753d93a67317299c
Author: Ian Price <ianprice90@googlemail.com>
AuthorDate: Wed Aug 2 21:12:47 2017 +0100
Implement built-in syntax procedures.
* module/language/js-il/runtime.js
(syntax?, make-syntax, syntax-expression, syntax-wrap,
syntax-module): New procedures.
---
module/language/js-il/runtime.js | 21 +++++++++++++++++++++
1 file changed, 21 insertions(+)
diff --git a/module/language/js-il/runtime.js b/module/language/js-il/runtime.js
index 5011f2e..e7d78e1 100644
--- a/module/language/js-il/runtime.js
+++ b/module/language/js-il/runtime.js
@@ -754,6 +754,27 @@ def_guile0("make-syntax-transformer", function (self,
cont, name, type, binding)
return cont(new scheme.Macro(name, type, binding));
});
+function scm_is_syntax (self, cont, obj) {
+ return cont(coerce_bool(obj instanceof scheme.Syntax));
+};
+def_guile0("syntax?", scm_is_syntax);
+
+def_guile0("make-syntax", function (self, cont, expr, wrap, module) {
+ return cont(new scheme.Syntax(expr, wrap, module));
+});
+
+def_guile0("syntax-expression", function (self, cont, obj) {
+ return cont(obj.expr);
+});
+
+def_guile0("syntax-wrap", function (self, cont, obj) {
+ return cont(obj.wrap);
+});
+
+def_guile0("syntax-module", function (self, cont, obj) {
+ return cont(obj.module);
+});
+
// Strings
def_guile0("string=?", function (self, cont, s1, s2) {
return cont(coerce_bool(s1.s === s2.s));
- [Guile-commits] 38/99: Explicitly test for undefined arguments to handle false values like 0, (continued)
- [Guile-commits] 38/99: Explicitly test for undefined arguments to handle false values like 0, Christopher Allan Webber, 2021/10/10
- [Guile-commits] 44/99: Update primitives in no-values-primitives, Christopher Allan Webber, 2021/10/10
- [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 <=
- [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, 2021/10/10
- [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