guile-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Guile-commits] 52/99: Add macro type in runtime.js


From: Christopher Allan Webber
Subject: [Guile-commits] 52/99: Add macro type in runtime.js
Date: Sun, 10 Oct 2021 21:50:58 -0400 (EDT)

cwebber pushed a commit to branch compile-to-js-merge
in repository guile.

commit ff7fff920d1a26cf01837d0ad5e44ac471ef94e9
Author: Ian Price <ianprice90@googlemail.com>
AuthorDate: Wed Jun 28 10:38:00 2017 +0100

    Add macro type in runtime.js
    
    * module/language/js-il/runtime.js
      (scheme.Macro): Add type.
      (make-syntax-transformer): Add guile procedure.
---
 module/language/js-il/runtime.js | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/module/language/js-il/runtime.js b/module/language/js-il/runtime.js
index cccccc6..5a2afa2 100644
--- a/module/language/js-il/runtime.js
+++ b/module/language/js-il/runtime.js
@@ -550,3 +550,15 @@ function scm_mul(self, cont) {
 };
 def_guile0("*", scm_mul);
 
+// Macros
+scheme.Macro = function (name, type, binding) {
+    // TODO: prim field?
+    this.name = name;
+    this.type = type;
+    this.binding = binding;
+    return this;
+};
+
+def_guile0("make-syntax-transformer", function (self, cont, name, type, 
binding) {
+    return cont(new scheme.Macro(name, type, binding));
+});



reply via email to

[Prev in Thread] Current Thread [Next in Thread]