summaryrefslogtreecommitdiff
path: root/libguile/modules.c
AgeCommit message (Collapse)AuthorFilesLines
2009-04-17eval-closure-module, here hopefully not for longAndy Wingo1-0/+15
* libguile/modules.h: * libguile/modules.c (scm_eval_closure_module): Define a new-yet-deprecated accessor, to ease a transition.
2009-03-22Merge branch 'master' into boehm-demers-weiser-gcLudovic Courtès1-2/+24
Conflicts: libguile/continuations.c libguile/gc-freelist.c libguile/gc-mark.c libguile/symbols.c libguile/threads.c module/ice-9/boot-9.scm
2008-11-05Work around unintentional retention of modules by the GC.Ludovic Courtès1-1/+7
This reverts par of "Document the failure of `gc.test' wrt. unused modules." (commit 328efeb9a66dddcf78a24fad96d3db58e9c3375d.) * ice-9/boot-9.scm (set-module-eval-closure!): Don't set the `module' property on CLOSURE. * libguile/modules.c (scm_lookup_closure_module): Call `abort ()' to make it clear that code that uses the `module' property no longer works. That code is unused anyway.
2008-09-30Merge commit 'origin/master' into vmAndy Wingo1-0/+3
Conflicts: doc/Makefile.am ice-9/Makefile.am libguile/gc.c
2008-09-29move module-public-interface to C, and expose it as C APIAndy Wingo1-0/+19
* 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-09-13Merge branch 'master' into boehm-demers-weiser-gcLudovic Courtès1-0/+3
Conflicts: lib/Makefile.am libguile/gc-card.c libguile/gc-freelist.c libguile/gc-mark.c libguile/gc-segment.c libguile/gc.c libguile/gc.h libguile/gc_os_dep.c libguile/private-gc.h m4/.cvsignore m4/gnulib-cache.m4 m4/gnulib-comp.m4
2008-09-13Include <config.h> in all C files; use `#ifdef HAVE_CONFIG_H' rather than `#if'.Ludovic Courtès1-0/+3
2008-09-10Merge branch 'master' into boehm-demers-weiser-gcLudovic Courtès1-13/+15
Conflicts: libguile/Makefile.am libguile/coop-defs.h libguile/gc-card.c libguile/gc-freelist.c libguile/gc-malloc.c libguile/gc-mark.c libguile/gc-segment.c libguile/gc.c libguile/gc.h libguile/gc_os_dep.c libguile/hashtab.c libguile/hashtab.h libguile/inline.h libguile/private-gc.h libguile/struct.c libguile/struct.h libguile/threads.c libguile/threads.h libguile/vectors.h libguile/weaks.h test-suite/tests/gc.test
2008-09-10Merge commit '7337d56d5714227865aeca2b40b6bd97cce296d2' into ↵Ludovic Courtès1-56/+241
boehm-demers-weiser-gc Conflicts: libguile/struct.c
2008-09-10Merge commit 'f30e1bdf97ae8b2b2918da585f887a4d3a23a347' into ↵Ludovic Courtès1-2/+3
boehm-demers-weiser-gc Conflicts: libguile/Makefile.am libguile/coop-pthreads.c libguile/gc-freelist.c libguile/gc-segment.c libguile/gc.c libguile/private-gc.h test-suite/tests/environments.nottest
2008-09-07module-variable accesses pre-module-obarray if module is #fAndy Wingo1-2/+5
* libguile/modules.c (module-variable): If module is #f, access the pre-modules-array. This is so that nested-ref can work before the module system is booted, I think. Of course all of these dependency lines during bootstrap are just to make sure the system can be booted properly, either interpreted or compiled, so there's no one right way: there are many ways that could work.
2008-09-05Removed a lot of now-useless SMOB mark/free functions.Ludovic Courtes1-1/+0
* libguile/arbiters.c (scm_init_arbiters): Don't invoke `scm_set_smob_mark'. * libguile/async.c (async_gc_mark): Removed. (scm_init_async): Don't invoke `scm_set_smob_mark'. * libguile/coop-pthreads.c (thread_mark): Removed. (create_thread): Use `scm_gc_malloc' instead of `scm_malloc' when allocating `launch_data'. (mutex_mark): Removed. (scm_threads_init): Don't invoke `scm_set_smob_mark' and `scm_set_smob_free'. * libguile/debug.c (scm_init_debug): Don't invoke `scm_set_smob_mark'. * libguile/dynl.c (dynl_obj_mark): Removed. (scm_init_dynamic_linking): Don't invoke `scm_set_smob_mark'. * libguile/dynwind.c (winder_mark): Removed. (scm_init_dynwind): Don't invoke `scm_set_smob_mark'. * libguile/environments.c (environment_mark): Removed. (environment_free): Removed. (observer_mark): Removed. (core_environments_mark): Removed. (core_environments_finalize): Removed. (leaf_environment_mark): Removed. (leaf_environment_free): Removed. (leaf_environment_funcs): Don't refer to the above funcs. (eval_environment_mark): Removed. (eval_environment_free): Removed. (eval_environment_funcs): Don't refer to the above funcs. (import_environment_mark): Removed. (import_environment_free): Removed. (import_environment_funcs): Don't refer to the above funcs. (export_environment_mark): Removed. (export_environment_free): Removed. (export_environment_funcs): Don't refer to the above funcs. (scm_environments_prehistory): Don't invoke `scm_set_smob_mark' and `scm_set_smob_free'. * libguile/environments.h (scm_environment_funcs)[mark]: Removed. [free]: Removed. * libguile/eval.c (promise_mark): Removed. (promise_free): Removed. (scm_init_eval): Don't invoke `scm_set_smob_mark' and `scm_set_smob_free'. * libguile/fluids.c (fluid_free): Removed. (scm_fluids_prehistory): Don't invoke `scm_set_smob_mark' and `scm_set_smob_free'. * libguile/futures.c (future_mark): Removed. (scm_init_futures): Don't invoke `scm_set_smob_mark'. * libguile/hashtab.c (hashtable_free): Removed. (scm_hashtab_prehistory): Don't invoke `scm_set_smob_mark' and `scm_set_smob_free'. * libguile/hooks.c (scm_init_hooks): Don't invoke `scm_set_smob_mark'. * libguile/keywords.c (scm_init_keywords): Don't invoke `scm_set_smob_mark'. * libguile/macros.c (scm_init_macros): Don't invoke `scm_set_smob_mark'. * libguile/modules.c (scm_init_modules): Don't invoke `scm_set_smob_mark'. * libguile/print.c (scm_init_print): Don't invoke `scm_set_smob_mark'. * libguile/random.c (scm_i_copy_rstate): Use `scm_gc_malloc' instead of `scm_malloc'. (scm_c_make_rstate): Likewise. (rstate_free): Removed. (scm_init_random): Don't invoke `scm_set_smob_free'. * libguile/srcprop.c (srcprops_mark): Removed. (scm_init_srcprop): Don't invoke `srcprops_mark'. * libguile/srfi-14.c (charset_free): Removed. (scm_init_srfi_14): Don't invoke `scm_set_smob_free'. * libguile/srfi-4.c (uvec_mark): Removed. (uvec_free): Removed. (scm_init_srfi_4): Don't invoke `scm_set_smob_free' and `scm_set_smob_mark'. * libguile/threads.c (thread_mark): Removed. (fat_mutex_mark): Removed. (fat_cond_mark): Removed. (scm_init_threads): Dont invoke `scm_set_smob_mark' and `scm_set_smob_free'. * libguile/unif.c (bitvector_free): Removed. (array_mark): Removed. (array_free): Removed. (scm_init_unif): Don't invoke `scm_set_smob_free' and `scm_set_smob_mark'. git-archimport-id: lcourtes@laas.fr--2005-libre/guile-core--boehm-gc--1.9--patch-28
2008-09-05Fixes in weak hash tables handling, notably in `hash-fold'.Ludovic Courtes1-2/+12
* libguile/hashtab.c (scm_i_rehash): Return immediately if TABLE is weak. (scm_hash_fn_create_handle_x): Explicitly mention that we don't support weak alist vectors. (scm_internal_hash_fold): Handle weak pairs within buckets. * libguile/modules.c (scm_module_reverse_lookup): Handle weak alists (currently, don't do anything if a NULL pair is met). git-archimport-id: lcourtes@laas.fr--2005-libre/guile-core--boehm-gc--1.9--patch-16
2008-02-15Release stuff: missing NEWS and 2007/2008 copyrights.Neil Jerram1-1/+1
2008-02-01* modules.c (the_root_module): Moved before scm_current_module.Neil Jerram1-12/+14
(scm_current_module): Return the root module if `the-module' fluid gives #f. * standalone/Makefile.am: Add stanza for test-with-guile-module. * standalone/test-with-guile-module.c: New test.
2007-05-05Changes from arch/CVS synchronizationLudovic Courtès1-56/+241
2006-11-02Remove environments.[ch] from the build.Neil Jerram1-2/+3
2006-04-17merge from 1.8 branchKevin Ryde1-1/+1
2006-01-29Renamed the "frames" that are related to dynamic-wind to "dynamicMarius Vollmer1-2/+2
contexts. Renamed all functions from scm_frame_ to scm_dynwind_. Updated documentation.
2005-07-31(scm_eval_closure_module): Removed, we already haveMarius Vollmer1-12/+0
scm_lookup_closure_module, which does the same thing.
2005-06-11*** empty log message ***Han-Wen Nienhuys1-0/+13
2005-05-23The FSF has a new address.Marius Vollmer1-1/+1
2005-03-02(scm_frame_current_module): New.Marius Vollmer1-0/+5
2005-01-02Use new vector elements API or simple vector API, as appropriate.Marius Vollmer1-1/+1
Removed SCM_HAVE_ARRAYS ifdefery. Replaced all uses of SCM_HASHTABLE_BUCKETS with SCM_HASHTABLE_BUCKET.
2004-09-22*** empty log message ***Marius Vollmer1-6/+6
2004-08-19* strings.h, strings.c: (scm_i_string_chars, scm_i_string_length,Marius Vollmer1-8/+9
scm_i_string_writable_chars, scm_i_string_stop_writing): New, to replace SCM_I_STRING_CHARS and SCM_I_STRING_LENGTH. Updated all uses. (scm_i_make_string, scm_c_make_string): New, to replace scm_allocate_string. Updated all uses. (SCM_STRINGP, SCM_STRING_CHARS, SCM_STRING_UCHARS, SCM_STRING_LENGTH): Deprecated. (scm_allocate_string, scm_take_str, scm_take0str, scm_mem2string, scm_str2string, scm_makfrom0str, scm_makfrom0str_opt): Discouraged. Replaced all uses with scm_from_locale_string or similar, as appropriate. (scm_c_string_length, scm_c_string_ref, scm_c_string_set_x, scm_c_substring, scm_c_substring_shared, scm_c_substring_copy, scm_substring_shared, scm_substring_copy): New. * symbols.c, symbols.h (SCM_SYMBOLP, SCM_SYMBOL_FUNC, SCM_SET_SYMBOL_FUNC, SCM_SYMBOL_PROPS, SCM_SET_SYMBOL_PROPS, SCM_SYMBOL_HASH, SCM_SYMBOL_INTERNED_P, scm_mem2symbol, scm_str2symbol, scm_mem2uninterned_symbol): Discouraged. (SCM_SYMBOL_LENGTH, SCM_SYMBOL_CHARS, scm_c_symbol2str): Deprecated. (SCM_MAKE_SYMBOL_TAG, SCM_SET_SYMBOL_LENGTH, SCM_SET_SYMBOL_CHARS, SCM_PROP_SLOTS, SCM_SET_PROP_SLOTS): Removed. (scm_is_symbol, scm_from_locale_symbol, scm_from_locale_symboln): New, to replace scm_str2symbol and scm_mem2symbol, respectively. Updated all uses. (scm_gensym): Generate only the number suffix in the buffer, just string-append the prefix.
2004-07-06* deprecated.h, boolean.h (SCM_FALSEP, SCM_NFALSEP, SCM_BOOL,Marius Vollmer1-20/+20
SCM_NEGATE_BOOL, SCM_BOOLP): Deprecated by moving into "deprecated.h". Replaced all uses with scm_is_false, scm_is_true, scm_from_bool, and scm_is_bool, respectively.
2004-04-26 * libguile/eval.c (s_macro_keyword): New static identifier.Dirk Herrmann1-1/+1
(scm_m_define): Change order to first create binding and evaluating the expression afterwards. (scm_m_set_x): Memoize complete set! expression. Only leave symbols if no binding exists at memoization time. Throw error if assigning to a syntactic keyword. (lazy_memoize_variable): New function. (CEVAL): When execution set!, perform lazy memoization if unmemoized symbol is detected. * libguile/modules.c (module_variable): Return variables with unbound value. * libguile/tags.h: Fix comment. * test-suite/tests/syntax.test: Add test case to check the correct handling of define expressions.
2003-11-30 * modules.c (module_variable): Fixed (and thus simplified) theDirk Herrmann1-2/+1
definition of SCM_BOUND_THING_P to reflect the fact that since after the 1.4 series of guile, obarrays only hold variable objects.
2003-09-12(scm_module_reverse_lookup): Check that the obarray really is aMarius Vollmer1-0/+3
hashtable and do nothing if not.
2003-05-292003-05-29 Stefan Jahn <stefan@lkcc.org>Stefan Jahn1-9/+9
* configure.in: Removed -lm check and added a cached check for __libc_stack_end to get it building for mingw32 hosts. 2003-05-29 Stefan Jahn <stefan@lkcc.org> * win32-dirent.c: Use malloc() instead of scm_malloc(). * stime.c (s_scm_strftime): Add a type cast to avoid compiler warning. * posix.c (s_scm_putenv): Disable use of unsetenv() for the mingw32 build. * modules.c (s_scm_module_import_interface): Renamed local variable interface to _interface. Seems like 'interface' is a special compiler directive for the mingw32 compiler. * mkstemp.c: Provide prototype to avoid compiler warning. * load.c (s_scm_search_path): Fixed absolute and relative path detections for native Windows platforms. * gc.h, threads.h: Export some more symbols using SCM_API (necessary to build on mingw32). * gc-freelist.c ("s_scm_map_free_list", "s_scm_gc_set_debug_check_freelist_x"): Fixed use of FUNC_NAME. * fports.c (fport_fill_input): Disable use of fport_wait_for_input() on Win32 platforms. * filesys.c (s_scm_basename): Fixed __MINGW32__ code. * Makefile.am: Modified some rules for cross compiling. 2003-05-29 Stefan Jahn <stefan@lkcc.org> * raw-ltdl.c: Some more modifications for mingw32 platforms. 2003-05-29 Stefan Jahn <stefan@lkcc.org> * Makefile.am (libguile_srfi_srfi_1_la_LDFLAGS, libguile_srfi_srfi_4_la_LDFLAGS, libguile_srfi_srfi_13_14__la_LDFLAGS): Added the -no-undefined option for the mingw32 build. 2003-05-29 Stefan Jahn <stefan@lkcc.org> * standalone/Makefile.am: Setup to build on mingw32.
2003-04-05* modules.c (s_scm_module_import_interface): move declaration ofRob Browning1-1/+2
uses before any code.
2003-04-05Changed license terms to the plain LGPL thru-out.Marius Vollmer1-36/+12
2003-03-11* modules.c (scm_module_import_interface): New function.Mikael Djurfeldt1-0/+36
* boot-9.scm (process-duplicates): Use module-import-interface. (module-symbol-interface): Removed.
2003-02-19* environments.c (DEFAULT_OBARRAY_SIZE): Changed from 137 to 31Mikael Djurfeldt1-1/+1
(since hash tables now adapt their size). * modules.c (scm_modules_prehistory): Changed from 2001 to 1533 (current number of prehistory bindings; hashtable code will select a prime which is greater than this value). * symbols.c (scm_symbols_prehistory): Changed from 1009 to 2139 (current number of initial symbols). * properties.c (scm_init_properties): Don't specify size of scm_properties_whash. * objprop.c (scm_init_objprop): Don't specify size of scm_object_whash. * keywords.c (scm_init_keywords): Don't specify a hash table size.
2003-02-19* hooks.c (scm_c_hook_add): Fixed bug in append mode.Mikael Djurfeldt1-3/+3
* environments.c (obarray_enter, obarray_retrieve, obarray_remove, leaf_environment_fold, obarray_remove_all): Use hashtable accessors. * gc.c (scm_init_storage): Moved hook initialization to scm_storage_prehistory. (scm_storage_prehistory): New function. (scm_igc): Added commentary about placement of scm_after_sweep_c_hook. * gc-mark.c (scm_mark_all): Use hashtable accessors. (scm_gc_mark_dependencies): Use SCM_WVECT_WEAK_KEY_P and SCM_WVECT_WEAK_VALUE_P. * hashtab.c, hashtab.h (scm_hash_for_each, scm_hash_map): New functions. (scm_vector_to_hash_table, scm_c_make_resizing_hash_table): Removed. (scm_make_weak_key_hash_table, scm_make_weak_value_hash_table, scm_make_doubly_weak_hash_table): Moved here from weaks.c. * init.c (scm_init_guile_1): Removed call to scm_init_weaks; Added calls to scm_storage_prehistory and scm_hashtab_prehistory. * modules.c (module-reverse-lookup): Use hashtable accessors. * symbols.c, symbols.h (scm_i_hash_symbol): New function. * weaks.c, weaks.h (scm_make_weak_key_alist_vector, scm_make_weak_value_alist_vector, scm_make_doubly_weak_alist_vector): New functions. * weaks.c (scm_init_weaks_builtins): New function. * weaks.h (SCM_WVECTF_WEAK_KEY, SCM_WVECTF_WEAK_VALUE, SCM_WVECTF_NOSCAN, SCM_WVECT_WEAK_KEY_P, SCM_WVECT_WEAK_VALUE_P, SCM_WVECT_NOSCAN_P): New macros. * weaks.c (scm_scan_weak_vectors): Use SCM_WVECT_WEAK_KEY_P and SCM_WVECT_WEAK_VALUE_P. * weaks.c, weaks.h (scm_i_allocate_weak_vector): Renamed from allocate_weak_vector and exported. * Makefile.am (ice9_sources): Added weak-vector.scm. * weak-vector.scm: New file. * boot-9.scm (module-clear!): Use hash-clear!. (module-for-each): Use hash-for-each. (module-map): Use hash-map.
2002-12-10* modules.c (scm_export): Inserted a return statement.Mikael Djurfeldt1-2/+2
2002-12-10* modules.c (scm_export): new functionHan-Wen Nienhuys1-3/+16
* gc-card.c: add a note about malloc()/free() overhead.
2002-11-16* modules.c (scm_env_top_level, scm_lookup_closure_module,Dirk Herrmann1-16/+16
module_variable, scm_module_lookup_closure, scm_module_transformer, scm_sym2var, scm_module_reverse_lookup, scm_system_module_env_p): Don't compare SCM values with C operators == or !=. Avoid SCM_IMP predicates. Prefer !SCM_FALSEP over SCM_NFALSEP.
2002-07-21* modules.c (scm_sym2var): Don't compare SCM values with ==.Dirk Herrmann1-1/+1
2002-03-14Retire inclusion guard macro SCM_MAGIC_SNARFER.Thien-Thi Nguyen1-2/+0
2001-11-23(scm_c_use_module): Adapt to changes to `process-use-modules'.Marius Vollmer1-1/+1
2001-11-20(scm_c_export): Do nothing when the first argument isMarius Vollmer1-13/+30
already the terminating NULL. Thanks to Han-Wen Nienhuys!
2001-11-13(scm_c_export): Call va_end after collecting the symbols.Marius Vollmer1-0/+1
2001-11-11* Documentation work.Neil Jerram1-1/+1
2001-10-13(module_variable): Pass over variables that exist but are unbound.Marius Vollmer1-3/+8
2001-08-31* Removed lots of deprecated stuff.Dirk Herrmann1-86/+0
2001-07-26* tags.h: Update tag system docs.Marius Vollmer1-1/+1
(scm_tc3_cons_gloc): Renamed to scm_tc3_struct. Changed all uses. (scm_tcs_cons_gloc): Renamed to scm_tcs_struct. Changed all uses. (SCM_ECONSP, SCM_NECONSP): Removed. Changed all uses to SCM_CONSP or SCM_NCONSP, respectively. * struct.c, struct.h, srcprop.c, procs.c, procprop.c, print.c, objects.c. modules.c, goops.c, eval.c, debug.c: Changed all uses of scm_tc3_cond_gloc and scm_tcs_cons_gloc. See above. * print.c (scm_iprin1): Remove printing of glocs. Do not try to tell glocs from structs. * gc.c (scm_gc_mark, scm_gc_sweep): Remove handling of glocs. * eval.c (scm_m_atbind): Make a list of variables, not glocs. (scm_ceval, scm_deval): For SCM_IM_BIND, fiddle with variables instead of with glocs. (EVALCAR): Do not test for glocs. (scm_lookupcar, scm_lookupcar1): Do not handle glocs in race condition. (scm_unmemocar): Do not handle glocs. (scm_m_atfop): Memoize as a variable, not as a gloc. (scm_eval_args, scm_deval_args): Do not handle glocs. (scm_ceval, scm_deval): Likewise. * eval.h (SCM_XEVALCAR): Do not test for glocs. (SCM_GLOC_VAR, SCM_GLOC_VAL, SCM_GLOC_SET_VAL, SCM_GLOC_VAL_LOC): Removed. * debug.h, debug.c (scm_make_gloc, scm_gloc_p): Removed. * dynwind.c (scm_swap_bindings): Likewise. (scm_dowinds): Updated to recognize lists of variables instead of lists of glocs. * __scm.h (SCM_CAUTIOS, SCM_RECKLESS): Update comments.
2001-07-09Remove "face-lift" comment.Thien-Thi Nguyen1-2/+0
2001-06-28 * list.h (scm_list_1, scm_list_2, scm_list_3, scm_list_4, scm_list_5,Keisuke Nishida1-7/+7
scm_list_n): New functions. (SCM_LIST0, SCM_LIST1, SCM_LIST2, SCM_LIST3, SCM_LIST4, SCM_LIST5, SCM_LIST6, SCM_LIST7, SCM_LIST8, SCM_LIST9, scm_listify): Deprecated. (lots of files): Use the new functions. * goops.c (CALL_GF1, CALL_GF2, CALL_GF3, CALL_GF4): Use scm_call_N. * strings.c: #include "libguile/deprecation.h".