summaryrefslogtreecommitdiffstats
path: root/lisplib.c
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2016-12-29 12:58:21 -0800
committerKaz Kylheku <kaz@kylheku.com>2016-12-29 12:58:21 -0800
commit744340ab8015179bd32d523e46ed2f56f20c82b9 (patch)
treea6ae48e0fb9e298731e8e0220a4d58042721cbf3 /lisplib.c
parent5c051fc12abc1d2a7d5207656b26af371a2916e9 (diff)
downloadtxr-744340ab8015179bd32d523e46ed2f56f20c82b9.tar.gz
txr-744340ab8015179bd32d523e46ed2f56f20c82b9.tar.bz2
txr-744340ab8015179bd32d523e46ed2f56f20c82b9.zip
Hoist binding and arg checking to expansion time.
Checking for uses of non-bindable symbols in variable binding and argument lists is moved to expansion time. Also checked at expansion time are macro lambda list conventions. :env and others must have a bindable parameter, and the optional arg colon cannot occur twice. * eval.c (bind_args): Remove run-time checks that are now done at expansion time. (not_bindable_error): New function. (expand_opt_params_rec, expand_params_rec): Take form argument for reporting errors. Implement more detailed checking against non-bindable symbols, and against :env, :form and :whole having missing or unsuitable arguments. (expand_params): Take form argument for error reporting, and pass to expand_params_rec. (bind_macro_params, bindings_helper): Remove run-time checks that are now done at expansion time. (check_lambda_list): Function removed, because expand_params now does the bulk of this check. We have a regression here in that we lose the check against :env and others occurring in a function parameter list; this has to be worked into expand_params. (op_defvarl, op_defsymacro, op_defmacro, op_setq, op_lisp1_setq, op_setqf): Replace repeated code with call to not_bindable_error. However, these should be replaced by expansion-time checks anyway, and eventually will be. (expand_macrolet): Pass form to expand_params. (expand_tree_cases): Take form argument for error reporting. Pass to expand_params. (expand_tree_case): Pass form to expand_tree_cases. (me_def_variable, me_mlet): Replace repeated code with call to not_bindable_error. (expand_vars): Do bindable symbol check here, so it doesn't have to be done at the run time in bindings_helper. (me_flet_labels): Don't call check_lambda_list. Expansion of the generated lambdas will do argument list checking. (expand_catch_clause): Pass form to expand_params. (do_expand): Don't call check_lambda_list. Pass form to expand_params.
Diffstat (limited to 'lisplib.c')
0 files changed, 0 insertions, 0 deletions