1 /* -*-comment-start: "//";comment-end:""-*-
2 * Mes --- Maxwell Equations of Software
3 * Copyright © 2016 Jan Nieuwenhuizen <janneke@gnu.org>
5 * This file is part of Mes.
7 * Mes is free software; you can redistribute it and/or modify it
8 * under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 3 of the License, or (at
10 * your option) any later version.
12 * Mes is distributed in the hope that it will be useful, but
13 * WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with Mes. If not, see <http://www.gnu.org/licenses/>.
23 define_env (SCM e, SCM a)
25 return vm_call (vm_define_env, e, cell_undefined, a);
33 if (TYPE (r2) != PAIR)
34 x = eval_env (caddr (r1), cons (cons (cadr (r1), cadr (r1)), r0));
37 SCM p = pairlis (cadr (r1), cadr (r1), r0);
38 x = eval_env (make_lambda (cdadr (r1), cddr (r1)), p);
40 if (eq_p (car (r1), cell_symbol_define_macro) == cell_t)
41 x = make_macro (r2, x);
43 SCM entry = cons (r2, x);
44 SCM aa = cons (entry, cell_nil);
45 set_cdr_x (aa, cdr (r0));
47 SCM cl = assq (cell_closure, r0);
52 SCM define_env (SCM r1, SCM a){}
53 SCM vm_define_env (SCM r1, SCM a){}
57 define_macro (SCM r1, SCM a)