summaryrefslogtreecommitdiff
path: root/libguile/modules.h
Commit message (Expand)AuthorAgeFilesLines
* finish deprecating eval closures...* libguile/deprecated.h: * libguile/deprecated.c (scm_eval_closure_lookup) (scm_standard_eval_closure, scm_standard_interface_eval_closure) (scm_eval_closure_module): Deprecate these, as they are unused. * libguile/modules.h: * libguile/modules.c: Remove deprecated code. * module/oop/goops/util.scm (top-level-env, top-level-env?): Deprecate. * module/ice-9/deprecated.scm (set-system-module!): Deprecate. (module-eval-closure): Deprecate, by overriding the core definition to return a fresh eval closure. * module/ice-9/boot-9.scm (make-module): Don't set an eval closure on the module. (the-root-module, the-scm-module): Don't call set-system-module!. Andy Wingo2012-05-231-8/+0
* deprecate lookup closures...* libguile/deprecated.h (SCM_TOP_LEVEL_LOOKUP_CLOSURE): * libguile/deprecated.c (scm_lookup_closure_module): (scm_module_lookup_closure): (scm_current_module_lookup_closure): Deprecate this part of the eval closure interface. It was unused internally, after the scm_sym2var refactor. * libguile/eval.h: * libguile/modules.c: * libguile/modules.h: Remove deprecated code. * libguile/goops.c (scm_ensure_accessor): Use scm_module_variable instead of calling the lookup closure. However I'm not sure that this code is used at all. Andy Wingo2012-05-231-3/+0
* deprecate scm_sym2var...* libguile/deprecated.h: * libguile/deprecated.c (scm_sym2var): Deprecate this function. * libguile/modules.h: * libguile/modules.c (scm_module_ensure_local_variable): New public function, replacing scm_sym2var with a true definep, without going through eval closures (which are deprecated). (scm_current_module): Rework to do something sensible before modules are booted. (scm_module_lookup, scm_lookup): Refactor to use scm_module_variable. (scm_module_define, scm_define): Refactor to use scm_module_ensure_local_variable. * libguile/vm-i-system.c (define!): Use scm_define. * libguile/vm.c (resolve_variable): Use scm_module_lookup. * libguile/macros.c (scm_make_syntax_transformer): Use scm_module_variable. * libguile/gdbint.c (gdb_binding): Use scm_define. * doc/ref/api-modules.texi (Accessing Modules from C): Add docs for scm_module_ensure_local_variable. Andy Wingo2012-05-231-5/+5
* add scm_c_public_ref et al...* libguile/modules.h: * libguile/modules.c (scm_public_lookup, scm_private_lookup) (scm_c_public_lookup, scm_c_private_lookup, scm_public_ref) (scm_private_ref, scm_c_public_ref, scm_c_private_ref) (scm_public_variable, scm_private_variable, scm_c_public_variable) (scm_c_private_variable): New helpers to get at variables and values in modules. Andy Wingo2011-03-081-1/+16
* new evaluator, y'all...* libguile/eval.c: So, ladies & gents, a new evaluator. It's similar to the old one, in that we memoize and then evaluate, but in this incarnation, memoization of an expression happens before evaluation, not lazily as the expression is evaluated. This makes the evaluation itself much cleaner, in addition to being threadsafe. In addition, since this C evaluator will in the future just serve to bootstrap the Scheme evaluator, we don't have to pay much concern for debugging conveniences. So the environment is just a list of values, and the memoizer pre-computes where it's going to find each individual value in the environment. Interface changes are commented below, with eval.h. (scm_evaluator_traps): No need to reset the debug mode after rnning te traps thing. But really, the whole traps system needs some love. * libguile/memoize.h: * libguile/memoize.c: New memoizer, which runs before evaluation, checking all syntax before evaluation begins. Significantly, no debugging information is left for lexical variables, which is not so great for interactive debugging; perhaps we should change this to have a var list in the future as per the classic interpreters. But it's quite fast, and the resulting code is quite good. Also note that it doesn't produce ilocs, memoized code is a smob whose type is in the first word of the smob itself. * libguile/eval.h (scm_sym_and, scm_sym_begin, scm_sym_case) (scm_sym_cond, scm_sym_define, scm_sym_do, scm_sym_if, scm_sym_lambda) (scm_sym_let, scm_sym_letstar, scm_sym_letrec, scm_sym_quote) (scm_sym_quasiquote, scm_sym_unquote, scm_sym_uq_splicing, scm_sym_at) (scm_sym_atat, scm_sym_atapply, scm_sym_atcall_cc) (scm_sym_at_call_with_values, scm_sym_delay, scm_sym_eval_when) (scm_sym_arrow, scm_sym_else, scm_sym_apply, scm_sym_set_x) (scm_sym_args): Remove public declaration of these symbols. (scm_ilookup, scm_lookupcar, scm_eval_car, scm_eval_body) (scm_eval_args, scm_i_eval_x, scm_i_eval): Remove public declaration of these functions. (scm_ceval, scm_deval, scm_ceval_ptr): Remove declarations of these deprecated functions. (scm_i_print_iloc, scm_i_print_isym, scm_i_unmemocopy_expr) (scm_i_unmemocopy_body): Remove declarations of these internal functions. (scm_primitive_eval_x, scm_eval_x): Redefine as macros for their less destructive siblings. * libguile/Makefile.am: Add memoize.[ch] to the build. * libguile/debug.h (scm_debug_mode_p, scm_check_entry_p) (scm_check_apply_p, scm_check_exit_p, scm_check_memoize_p) (scm_debug_eframe_size): Remove these vars that were tied to the old evaluator's execution model. (SCM_RESET_DEBUG_MODE): Remove, no more need for this. (SCM_MEMOIZEDP, SCM_MEMOIZED_EXP, SCM_MEMOIZED_ENV): Remove macros referring to old memoized code representation. (scm_local_eval, scm_procedure_environment, scm_memoized_environment) (scm_make_memoized, scm_memoized_p): Remove functions operating on old memoized code representation. (scm_memcons, scm_mem_to_proc, scm_proc_to_mem): Remove debug-only code for old evaluator. * libguile/debug.c: Remove code to correspond with debug.h removals. (scm_debug_options): No need to set the debug mode or frame limit here, as we don't have C stack limits any more. Perhaps this is a bug, but as long as we can compile eval.scm, we should be fine. * libguile/init.c (scm_i_init_guile): Init memoize.c. * libguile/modules.c (scm_top_level_env, scm_env_top_level) (scm_env_module, scm_system_module_env_p): Remove these functions. * libguile/print.c (iprin1): No more need to handle isyms. Adapt to new form of interpreted procedures. * libguile/procprop.c (scm_i_procedure_arity): Adapt to new form of interpreted procedures. * libguile/procs.c (scm_thunk_p): Adapt to new form of interpreted procedures. * libguile/procs.h (SCM_CLOSURE_FORMALS): Removed, this exists no more. (SCM_CLOSURE_NUM_REQUIRED_ARGS, SCM_CLOSURE_HAS_REST_ARGS): New accessors. * libguile/srcprop.c (scm_source_properties, scm_source_property) (scm_set_source_property_x): Remove special cases for memoized code. * libguile/stacks.c (read_frame): Remove a source-property case for interpreted code. (NEXT_FRAME): Remove a case that I don't fully understand, that seems to be designed to skip over apply frames. Will be obsolete in the futures. (read_frames): Default source value for interpreted frames to #f. (narrow_stack): Don't pay attention to the system_module thing. * libguile/tags.h: Remove isyms and ilocs. Whee! * libguile/validate.h (SCM_VALIDATE_MEMOIZED): Fix to use the new MEMOIZED_P formulation. * module/ice-9/psyntax-pp.scm (do, quasiquote, case): Adapt for these no longer being primitive macros. * module/ice-9/boot-9.scm: Whitespace change, but just a poke to force a rebuild due to and/or/cond/... not being primitives any more. * module/ice-9/deprecated.scm (unmemoize-expr): Deprecate, it's unmemoize-expression now. * test-suite/tests/eval.test ("define set procedure-name"): XFAIL a couple of tests here; I don't know what to do about them. I reckon the expander should ensure that defined values are named. * test-suite/tests/chars.test ("basic char handling"): Fix expected exception when trying to apply a char. Andy Wingo2009-12-011-5/+0
* remove some deprecated things, undeprecate scm_the_root_module()...* libguile/deprecated.h * libguile/deprecated.c (SCM_ILOC00, SCM_IDINC, SCM_IDSTMSK) (scm_s_expression, scm_s_test, scm_s_body, scm_s_bindings) (scm_s_variable, scm_s_clauses, scm_s_formals, SCM_EVALIM2) (SCM_EVALIM, SCM_XEVAL, SCM_XEVALCAR): Remove these macros and constants, deprecated in 2003. (scm_the_root_module): Undeprecate, it's actually a useful function, that other parts of the code use. * libguile/modules.h (scm_the_root_module): Undeprecated. * libguile/modules.c (scm_the_root_module): Rename from the_root_module. Use it in the rest of this file. Andy Wingo2009-12-011-0/+1
* Change Guile license to LGPLv3+...(Not quite finished, the following will be done tomorrow. module/srfi/*.scm module/rnrs/*.scm module/scripts/*.scm testsuite/*.scm guile-readline/* ) Neil Jerram2009-06-171-6/+7
* eval-closure-module, here hopefully not for long...* libguile/modules.h: * libguile/modules.c (scm_eval_closure_module): Define a new-yet-deprecated accessor, to ease a transition. Andy Wingo2009-04-171-0/+1
* move module-public-interface to C, and expose it as C API...* libguile/modules.h: * libguile/modules.c: * ice-9/boot-9.scm (module-public-interface): Move definition of module-public-interface to C, where it is now available as scm_module_public_interface (). Andy Wingo2008-09-291-0/+1
* Add `SCM_INTERNAL' macro, use it.Ludovic Courtès2008-05-311-3/+3
* Changes from arch/CVS synchronizationLudovic Courtès2007-05-051-1/+10
* merge from 1.8 branchKevin Ryde2006-04-171-1/+1
* Renamed the "frames" that are related to dynamic-wind to "dynamic...contexts. Renamed all functions from scm_frame_ to scm_dynwind_. Updated documentation. Marius Vollmer2006-01-291-1/+1
* (scm_eval_closure_module): Removed, we already have...scm_lookup_closure_module, which does the same thing. Marius Vollmer2005-07-311-1/+0
* *** empty log message ***Han-Wen Nienhuys2005-06-111-0/+1
* The FSF has a new address.Marius Vollmer2005-05-231-1/+1
* (scm_frame_current_module): New.Marius Vollmer2005-03-021-0/+1
* Changed license terms to the plain LGPL thru-out.Marius Vollmer2003-04-051-35/+11
* * modules.c (scm_module_import_interface): New function....* boot-9.scm (process-duplicates): Use module-import-interface. (module-symbol-interface): Removed. Mikael Djurfeldt2003-03-111-1/+2
* (SCM_MAKE_VALIDATE_MSG): New. Use it instead of SCM_MAKE_VALIDATE in...lots of places to gove better error messages. Thanks to Bill Schottstaedt! Marius Vollmer2002-10-201-2/+2
* 2002-07-20 Han-Wen <hanwen@cs.uu.nl>...* *.c: add space after commas everywhere. * *.c: use SCM_VECTOR_SET everywhere, where a vector is written. Document cases where SCM_WRITABLE_VELTS() is used. * vectors.h (SCM_VELTS): prepare for write barrier, and let SCM_VELTS() return a const pointer (SCM_VECTOR_SET): add macro. * autogen.sh (mscripts): find and check version number of autoconf. Complain if 2.53 is not found. Han-Wen Nienhuys2002-07-201-1/+1
* Prefixed each each exported symbol with SCM_API.Marius Vollmer2001-11-021-47/+47
* * Removed lots of deprecated stuff.Dirk Herrmann2001-08-311-12/+5
* replace "scm_*_t" with "scm_t_*".Marius Vollmer2001-06-141-2/+2
* * Changed the default definition of SCM....* Fixed some typing problems detected by the above change. * Fixed some problems that were detected by compiling guile with -W. Dirk Herrmann2001-05-271-6/+6
* (scm_system_module_env_p): Move out of deprecated...section. Marius Vollmer2001-05-201-1/+1
* * modules.h, modules.c: Moved around a lot of code so that...deprecated features appear at the bottom. (root_module_lookup_closure, scm_sym_app, scm_sym_modules, module_prefix, make_modules_in_var, beautify_user_module_x_var, scm_the_root_module, scm_make_module, scm_ensure_user_module, scm_load_scheme_module): Deprecated. (scm_system_module_env_p): Return SCM_BOOL_T directly for environments corresponding to the root module. (convert_module_name, scm_c_resolve_module, scm_c_call_with_current_module, scm_c_define_module, scm_c_use_module, scm_c_export): New. (the_root_module): New static variant of scm_the_root_module. Use it everywhere instead of scm_the_root_module. Marius Vollmer2001-05-191-21/+36
* Merge from mvo-vcell-cleanup-1-branch.Marius Vollmer2001-05-151-2/+21
* * modules.c (scm_module_type): New....(scm_post_boot_init_modules): Initialize from Scheme value. (the_module, scm_current_module, scm_init_modules): the_module is now a C only fluid. (scm_current_module): Export to Scheme. (scm_set_current_module): Do not call out to Scheme, do all the work in C. Export procedure to Scheme. Only accept modules, `#f' is no longer valid as the current module. Only set scm_top_level_lookup_closure_var and scm_system_transformer when they are not deprecated. (scm_module_transformer, scm_current_module_transformer): New. * modules.h (scm_module_index_transformer, SCM_MODULE_TRANSFORMER, scm_current_module_transformer, scm_module_transformer): New. Marius Vollmer2001-04-241-0/+5
* * modules.h. modules.c (scm_current_module_lookup_closure): New...function. Marius Vollmer2001-02-111-0/+1
* * modules.h (scm_selected_module, scm_current_module): Renamed...scm_selected_module to scm_current_module to synchronize Scheme and C names. (scm_select_module, scm_set_current_module): Likewise. Changed all uses. Marius Vollmer2001-02-081-2/+2
* Smob-related creanup.Keisuke Nishida2000-12-081-2/+3
* * modules.c: Use applicable smobs for eval closures instead of...compiled closures. Include "libguile/smob.h". (f_eval_closure): Removed. (scm_eval_closure_tag): New variable. (scm_eval_closure_lookup): Renamed from eval_closure. This function now takes a smob instead of a compiled closure. (scm_standard_eval_closure): Create a smob instead of a compiled closure. (scm_init_modules): Initialize the eval closure type as a smob. * modules.h (SCM_EVAL_CLOSURE_P): New macro. (scm_eval_closure_tag, scm_eval_closure_lookup): Declare. * symbols.c: Include "libguile/smob.h". (scm_sym2vcell): Call scm_eval_closure_lookup directly if THUNK is an eval closure. Keisuke Nishida2000-09-101-0/+4
* * modules.h (SCM_MODULEP, SCM_VALIDATE_MODULE,...SCM_MODULE_OBARRAY, SCM_MODULE_USES, SCM_MODULE_BINDER, SCM_MODULE_EVAL_CLOSURE): New macros. (scm_module_index_obarray, scm_module_index_uses, scm_module_index_binder, scm_module_index_eval_closure): New constants; #include "validate.h". Mikael Djurfeldt2000-08-111-0/+31
* * modules.h (scm_standard_eval_closure): Declare.Mikael Djurfeldt2000-06-041-1/+2
* * *.[hc]: add Emacs magic at the end of file, to ensure GNU... indentation style. Michael Livshin2000-03-191-0/+6
* * list.c: Moved append docs to append! Thanks Dirk Hermann. Also,...added append docs from R4RS. * strings.c: Docstring typo fix, + eliminate unneeded IMP tests. Thanks Dirk Hermann! * chars.h: Provide SCM_CHARP, SCM_CHAR, SCM_MAKE_CHAR and deprecate SCM_ICHRP, SCM_ICHR, SCM_MAKICHR. Thanks Dirk Hermann! * *.h, *.c: Use SCM_CHARP, SCM_CHAR, SCM_MAKE_CHAR throughout. Drop use of SCM_P for function prototypes... assume an ANSI C compiler. Thanks Dirk Hermann! Greg J. Badros2000-03-021-3/+3
* * debug.c, eval.c, evalext.c, stacks.c: #include "modules.h"....* modules.c, modules.h, eval.c, eval.h (scm_env_top_level, scm_top_level_env, scm_system_module_env_p): Moved to modules.c. Mikael Djurfeldt1999-03-191-0/+3
* * modules.c, modules.h (scm_resolve_module): New function.Mikael Djurfeldt1998-11-261-0/+2
* * modules.c (scm_make_module): Beautify the module.Mikael Djurfeldt1998-11-231-0/+2
* * modules.c, modules.h: New files: C interface to modules. (This...is necessary in order to interface the object system to Guile properly. The guts of these modules will be replaced by the new module system in the future.) Mikael Djurfeldt1998-11-221-0/+58