mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-06-16 16:50:21 +02:00
Implement built-in syntax procedures.
* module/language/js-il/runtime.js (syntax?, make-syntax, syntax-expression, syntax-wrap, syntax-module): New procedures.
This commit is contained in:
parent
2a3c43a5a9
commit
5d49a5be18
1 changed files with 21 additions and 0 deletions
|
@ -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));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue