Commit dd945c3f authored by Juergen Nickelsen's avatar Juergen Nickelsen

removed defspecial and related things

parent b815a7f9
......@@ -628,31 +628,21 @@ sub Blambda {
return make_lambda($params, $body, 0, $Lambda);
}
sub Bkappa {
my ($params, $body) = checkargs($_[0], 'lr');
return make_lambda($params, $body, 1, $Kappa);
}
sub make_lambda {
my ($params, $body, $is_special, $name) = @_;
my ($params, $body, $name) = @_;
my $doc = car($body);
if (stringp($doc)) {
$body = cdr($body);
} else {
$doc = '';
}
return function(cons($params, $body), $is_special, $doc, $name, $Env);
}
sub make_named_function {
my ($name, $params, $body, $is_special) = @_;
fset($name, make_lambda($params, $body, $is_special, $name));
return $name;
return function(cons($params, $body), 0, $doc, $name, $Env);
}
sub Bdefun {
my ($name, $params, $body) = checkargs($_[0], 'ylr');
return make_named_function($name, $params, $body, 0);
fset($name, make_lambda($params, $body, $name));
return $name;
}
sub Blist {
......@@ -1076,8 +1066,6 @@ my @builtins = # [name, func, is_special, doc]
"return a dump of the internal data structure of the argument"],
["lambda", \&Blambda, 1,
"define an anonymous function from ARGS and &rest BODY"],
["kappa", \&Bkappa, 1,
"define an anonymous special form from ARGS and &rest BODY"],
["eq", \&Beq, 0,
"return t if ARG1 and ARG2 are the same object, nil else"],
["symbols", \&Bsymbols, 0, "return a list of all symbols"],
......
......@@ -7,11 +7,4 @@
(testcmp "defun" '(progn (defun lala (n) (* n n))
(lala 123))
"15129")
(testcmp "defspecial" '(progn (defspecial quote-eval (toquote toeval)
(cons toquote (eval toeval)))
(quote-eval (* 3 3) (* 4 4)))
"((* 3 3) . 16)")
(testcmp "kappa" '((kappa (toquote toeval)
(cons toquote (eval toeval)))
(* 3 3) (* 4 4))
"((* 3 3) . 16)")
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment