summaryrefslogtreecommitdiff
path: root/libguile/modules.h
AgeCommit message (Collapse)AuthorFilesLines
2012-05-23finish deprecating eval closuresAndy Wingo1-8/+0
* 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!.
2012-05-23deprecate lookup closuresAndy Wingo1-3/+0
* 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.
2012-05-23deprecate scm_sym2varAndy Wingo1-5/+5
* 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.
2011-03-08add scm_c_public_ref et alAndy Wingo1-1/+16
* 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.
2009-12-01new evaluator, y'allAndy Wingo1-5/+0
* 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.
2009-12-01remove some deprecated things, undeprecate scm_the_root_module()Andy Wingo1-0/+1
* 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.
2009-06-17Change Guile license to LGPLv3+Neil Jerram1-6/+7
(Not quite finished, the following will be done tomorrow. module/srfi/*.scm module/rnrs/*.scm module/scripts/*.scm testsuite/*.scm guile-readline/* )
2009-04-17eval-closure-module, here hopefully not for longAndy Wingo1-0/+1
* libguile/modules.h: * libguile/modules.c (scm_eval_closure_module): Define a new-yet-deprecated accessor, to ease a transition.
2008-09-29move module-public-interface to C, and expose it as C APIAndy Wingo1-0/+1
* 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 ().
2008-05-31Add `SCM_INTERNAL' macro, use it.Ludovic Courtès1-3/+3
2007-05-05Changes from arch/CVS synchronizationLudovic Courtès1-1/+10
2006-04-17merge from 1.8 branchKevin Ryde1-1/+1
2006-01-29Renamed the "frames" that are related to dynamic-wind to "dynamicMarius Vollmer1-1/+1
contexts. Renamed all functions from scm_frame_ to scm_dynwind_. Updated documentation.
2005-07-31(scm_eval_closure_module): Removed, we already haveMarius Vollmer1-1/+0
scm_lookup_closure_module, which does the same thing.
2005-06-11*** empty log message ***Han-Wen Nienhuys1-0/+1
2005-05-23The FSF has a new address.Marius Vollmer1-1/+1
2005-03-02(scm_frame_current_module): New.Marius Vollmer1-0/+1
2003-04-05Changed license terms to the plain LGPL thru-out.Marius Vollmer1-35/+11
2003-03-11* modules.c (scm_module_import_interface): New function.Mikael Djurfeldt1-1/+2
* boot-9.scm (process-duplicates): Use module-import-interface. (module-symbol-interface): Removed.
2002-10-20(SCM_MAKE_VALIDATE_MSG): New. Use it instead of SCM_MAKE_VALIDATE inMarius Vollmer1-2/+2
lots of places to gove better error messages. Thanks to Bill Schottstaedt!
2002-07-202002-07-20 Han-Wen <hanwen@cs.uu.nl>Han-Wen Nienhuys1-1/+1
* *.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.
2001-11-02Prefixed each each exported symbol with SCM_API.Marius Vollmer1-47/+47
2001-08-31* Removed lots of deprecated stuff.Dirk Herrmann1-12/+5
2001-06-14replace "scm_*_t" with "scm_t_*".Marius Vollmer1-2/+2
2001-05-27* Changed the default definition of SCM.Dirk Herrmann1-6/+6
* Fixed some typing problems detected by the above change. * Fixed some problems that were detected by compiling guile with -W.
2001-05-20(scm_system_module_env_p): Move out of deprecatedMarius Vollmer1-1/+1
section.
2001-05-19* modules.h, modules.c: Moved around a lot of code so thatMarius Vollmer1-21/+36
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.
2001-05-15Merge from mvo-vcell-cleanup-1-branch.Marius Vollmer1-2/+21
2001-04-24* modules.c (scm_module_type): New.Marius Vollmer1-0/+5
(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.
2001-02-11* modules.h. modules.c (scm_current_module_lookup_closure): NewMarius Vollmer1-0/+1
function.
2001-02-08* modules.h (scm_selected_module, scm_current_module): RenamedMarius Vollmer1-2/+2
scm_selected_module to scm_current_module to synchronize Scheme and C names. (scm_select_module, scm_set_current_module): Likewise. Changed all uses.
2000-12-08Smob-related creanup.Keisuke Nishida1-2/+3
2000-09-10* modules.c: Use applicable smobs for eval closures instead ofKeisuke Nishida1-0/+4
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.
2000-08-11* modules.h (SCM_MODULEP, SCM_VALIDATE_MODULE,Mikael Djurfeldt1-0/+31
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".
2000-06-04* modules.h (scm_standard_eval_closure): Declare.Mikael Djurfeldt1-1/+2
2000-03-19 * *.[hc]: add Emacs magic at the end of file, to ensure GNUMichael Livshin1-0/+6
indentation style.
2000-03-02* list.c: Moved append docs to append! Thanks Dirk Hermann. Also,Greg J. Badros1-3/+3
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!
1999-03-19* debug.c, eval.c, evalext.c, stacks.c: #include "modules.h".Mikael Djurfeldt1-0/+3
* 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.
1998-11-26* modules.c, modules.h (scm_resolve_module): New function.Mikael Djurfeldt1-0/+2
1998-11-23* modules.c (scm_make_module): Beautify the module.Mikael Djurfeldt1-0/+2
1998-11-22* modules.c, modules.h: New files: C interface to modules. (ThisMikael Djurfeldt1-0/+58
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.)