summaryrefslogtreecommitdiff
path: root/libguile/modules.c
Commit message (Collapse)AuthorAgeFilesLines
* Use 'scm_from_utf8_{string,symbol,keyword}' for C string literals.Mark H Weaver2018-10-171-2/+3
| | | | | | | | | | | | | | | | | | | | | | Partial fix for <https://bugs.gnu.org/33044>. Reported by Tom de Vries <tdevries@suse.de>. Fix several instances of the mistake of using 'scm_from_locale_*' for C strings that originally came from a C string literal. Change several uses of 'scm_from_latin1_*' as well, to promote the practice of writing code that works for arbitrary C string literals. Also add missing years to the copyright notices of changed files, based on the git history. * libguile/debug-malloc.c, libguile/deprecation.c, libguile/error.c, libguile/eval.c, libguile/expand.c, libguile/extensions.c, libguile/filesys.c, libguile/init.c, libguile/load.c, libguile/modules.c, libguile/pairs.c, libguile/posix.c, libguile/print.c, libguile/random.c, libguile/read.c, libguile/regex-posix.c, libguile/snarf.h, libguile/srfi-13.c, libguile/stacks.c, libguile/stime.c, libguile/strports.c, libguile/values.c: Use 'scm_from_utf8_*' where appropriate.
* Module import obarrays are accessed in a critical section.Ludovic Courtès2018-06-181-1/+18
| | | | | | | | Fixes <https://bugs.gnu.org/31879>. * libguile/modules.c (import_obarray_mutex): New variable. (resolve_duplicate_binding, module_imported_variable): Acquire it before accessing an obarray.
* Merge remote-tracking branch 'origin/stable-2.0'Andy Wingo2012-05-231-173/+29
|\ | | | | | | | | | | | | | | | | | | | | This commit removes code that was newly deprecated in stable-2.0. Conflicts: libguile/deprecated.c libguile/deprecated.h libguile/modules.c module/ice-9/boot-9.scm module/ice-9/deprecated.scm
| * finish deprecating eval closuresAndy Wingo2012-05-231-63/+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!.
| * deprecate lookup closuresAndy Wingo2012-05-231-50/+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.
| * deprecate scm_sym2varAndy Wingo2012-05-231-73/+42
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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.
* | tune default hash table sizesAndy Wingo2012-02-191-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | * libguile/modules.c: In my current image, there are 1790 bindings in the root module, which tips over to the next hash vector size, so declare that to prevent rehashing. * libguile/srcprop.c (scm_init_srcprop): Don't preallocate a big source_whash table, as we might not need it (if everything is compiled, for example). * module/ice-9/boot-9.scm (make-module): Don't preall-cate big hash tables for imported bindings. Instead trust that resizing works correctly.
* | most uses of scm_from_locale_symbol become scm_from_utf8_symbolAndy Wingo2011-10-251-13/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * libguile/array-handle.c: * libguile/chars.c: * libguile/expand.c: * libguile/feature.c: * libguile/goops.c: * libguile/gsubr.c: * libguile/instructions.c: * libguile/load.c: * libguile/macros.c: * libguile/memoize.c: * libguile/modules.c: * libguile/options.c: * libguile/print.c: * libguile/smob.c: * libguile/snarf.h: Change most uses of scm_from_locale_symbol to scm_from_utf8_symbol, as the symbols really are not locale-dependent.
* | add SCM_HEAP_OBJECT_PAndy Wingo2011-10-241-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * libguile/tags.h (SCM_HEAP_OBJECT_P): New macro, an alias for SCM_NIMP. * libguile/arrays.c: * libguile/debug.c: * libguile/foreign.c: * libguile/gdbint.c: * libguile/guardians.c: * libguile/list.c: * libguile/modules.c: * libguile/options.c: * libguile/smob.c: * libguile/validate.h: * libguile/weak-set.c: * libguile/weak-table.c: * libguile/weak-vector.c: Use it instead of SCM_NIMP or !SCM_IMP.
* | remove weak pairs, rewrite weak vectorsAndy Wingo2011-10-241-10/+2
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * libguile/weak-vector.c: * libguile/weak-vector.h: Renamed from weaks.[ch]. Remove weak pairs. They were not safe to access with `car' and `cdr'. Remove weak alist vectors, as we have weak tables and sets. Reimplement weak vectors, moving the implementation here. * libguile/vectors.c: * libguile/vectors.h: Remove the extra header word. Use scm_c_weak_vector_ref / scm_c_weak_vector_set_x to access weak vectors. * libguile/snarf.h: Remove the extra header word in vectors. * libguile/threads.c (do_thread_exit, fat_mutex_lock, fat_mutex_unlock): Instead of weak pairs, store thread-owned mutexes in a list of one-element weak vectors. * libguile/guardians.c (finalize_guarded): Similarly, store object guardians in a list of one-element weak vectors. * libguile/modules.c (scm_module_reverse_lookup): We no longer need to handle the case of weak references. * libguile/print.c (iprin1): Use the standard vector accessor to print vectors. * libguile.h: * libguile/Makefile.am: * libguile/gc-malloc.c: * libguile/gc.c: * libguile/goops.c: * libguile/init.c: * libguile/objprop.c: * libguile/struct.c: Update includes. * module/ice-9/weak-vector.scm: Load weak vector definitions using an extension instead of %init-weaks-builtins. * test-suite/tests/weaks.test: Use the make-...-hash-table names instead of the old alist vector names.
* fix invocation of duplicate handlers for merge-genericsAndy Wingo2011-07-071-31/+44
| | | | | | | | | | | | | * libguile/modules.c (resolve_duplicate_binding): Fix unbound -> #f conversion for the imported bindings. Pass the existing entry in the import obarray as the resolved var (7th arg), and properly pass #f as the value (8th arg) if there is no such binding. Fixes merge-generics; before, the <boolean> type test (indicating no previous value) was not being triggered. This bug has been present since 2007 at least, though it was not in 1.8. * test-suite/tests/modules.test ("duplicate bindings"): Add a test that the var and val are both #f. These types are used by GOOPS.
* more care regarding SCM_PACK and SCM_UNPACKAndy Wingo2011-05-131-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | * libguile/control.c (reify_partial_continuation): * libguile/eval.c (RETURN_BOOT_CLOSURE): * libguile/frames.c (scm_frame_num_locals, scm_frame_local_ref) (scm_frame_local_set_x) * libguile/frames.h (SCM_FRAME_SET_RETURN_ADDRESS): (SCM_FRAME_SET_MV_RETURN_ADDRESS, SCM_FRAME_SET_DYNAMIC_LINK): * libguile/goops.c (scm_class_of, scm_primitive_generic_generic) (scm_c_extend_primitive_generic, compute_getters_n_setters) (scm_sys_initialize_object): * libguile/guardians.c (finalize_guarded): * libguile/list.c (SCM_I_CONS): * libguile/macros.c (scm_i_make_primitive_macro) (scm_make_syntax_transformer): * libguile/memoize.c (MAKMEMO, SCM_MAKE_MEMOIZER) (SCM_MAKE_REST_MEMOIZER): * libguile/modules.c (scm_module_reverse_lookup) * libguile/print.c (iprin1): * libguile/promises.c (scm_make_promise) * libguile/srcprop.c (scm_make_srcprops): * libguile/vectors.c (scm_c_vector_ref): * libguile/vm-engine.c (vm_engine) * libguile/vm-i-scheme.c (REL, add1, sub1): * libguile/vm-i-system.c (new_frame, call_cc) * libguile/weaks.h (SCM_WEAK_PAIR_WORD_DELETED_P): Be more careful about SCM_PACK / SCM_UNPACK.
* scm_is_eq for SCM vals, not == or !=Andy Wingo2011-05-131-3/+3
| | | | | | | | | | | | | | | | | | | | | | | * libguile/bytevectors.c (scm_make_bytevector, STRING_TO_UTF) (UTF_TO_STRING): * libguile/continuations.c (scm_i_check_continuation): * libguile/expand.h (SCM_EXPANDED_P): * libguile/fluids.c (scm_i_make_with_fluids): * libguile/generalized-vectors.c (scm_make_generalized_vector): * libguile/goops.c (SCM_GOOPS_UNBOUNDP, slot_definition_using_name): (scm_c_extend_primitive_generic, more_specificp, scm_make) * libguile/i18n.c (SCM_VALIDATE_OPTIONAL_LOCALE_COPY): (scm_locale_string_to_integer) * libguile/modules.c (resolve_duplicate_binding): (scm_module_reverse_lookup) * libguile/posix.c (scm_to_resource): * libguile/r6rs-ports.c (scm_put_bytevector): * libguile/socket.c (scm_connect, scm_bind, scm_sendto * libguile/stacks.c (find_prompt): * libguile/variable.c (scm_variable_ref, scm_variable_bound_p): * libguile/vm-engine.h (ASSERT_BOUND_VARIABLE, ASSERT_BOUND) * libguile/vm-i-system.c (VARIABLE_BOUNDP, local_bound) (long_local_bound, fluid_ref): Use scm_is_eq to compare, not == / !=.
* add scm_c_public_ref et alAndy Wingo2011-03-081-0/+122
| | | | | | | | | | * 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.
* comment on scm_pre_modules_obarray re threadsafetyAndy Wingo2011-02-101-0/+2
| | | | | * libguile/modules.c (scm_pre_modules_obarray): Add comment to the effect that this global variable does not need a lock around it.
* use scm_from_latin1_symboln for string literals and load-symbolAndy Wingo2011-01-071-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | * libguile/bytevectors.c: * libguile/eval.c: * libguile/goops.c: * libguile/i18n.c: * libguile/load.c: * libguile/memoize.c: * libguile/modules.c: * libguile/ports.c: * libguile/print.c: * libguile/procs.c: * libguile/programs.c: * libguile/read.c: * libguile/script.c: * libguile/srfi-14.c: * libguile/stacks.c: * libguile/strings.c: * libguile/throw.c: * libguile/vm.c: Use scm_from_latin1_symboln to make symbols from string literals, because they aren't in the user's locale -- they are in ASCII, and we can optimize this case. * libguile/vm-i-loader.c: Also use scm_from_latin1_symboln when loading narrow symbols.
* scm_c_define_module uses define-module*Andy Wingo2010-11-191-4/+4
| | | | | | * libguile/modules.c (scm_c_define_module): * module/ice-9/boot-9.scm: Update to have the C function call define-module*.
* module-local-variable optimizationAndy Wingo2010-09-021-7/+22
| | | | | * libguile/modules.c (scm_module_local_variable): An optimization in the common no-module-binder case.
* macro expanders return memoized expressionsAndy Wingo2010-05-071-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | * libguile/eval.c (scm_c_primitive_eval): * module/ice-9/eval.scm (primitive-eval): Rely on the expander to produce a memoized expression. If the expression is already memoized, just pass it through (the equivalent of the old "noexpand" hack). * libguile/memoize.c (scm_init_memoize): Initialize `memoize-expression' as the initial binding of `macroexpand'. * libguile/modules.c (scm_module_transformer): Before modules are booted, look for `macroexpand', not `%pre-modules-transformer'. * module/ice-9/boot-9.scm: No more %pre-modules-transformer. Loading psyntax extends `macroexpand'. (make-module): `macroexpand' is the default transformer. * module/ice-9/psyntax.scm: No more `noexpand'. (top-level-eval-hook, local-eval-hook): Instead of annotating with noexpand, memoize the expression before handing it to primitive-eval. (macroexpand): No more noexpand hack -- in its place we have another hack, to memoize the result when running in eval mode. * module/ice-9/psyntax-pp.scm: Regenerated.
* comment some global variables in modules.cAndy Wingo2010-04-271-2/+4
| | | | * libguile/modules.c: Comment some global variables.
* module-public-interface in SchemeAndy Wingo2010-04-241-28/+13
| | | | | | | | | * libguile/modules.c: Consolidate all variables to the top of the file. (scm_module_public_interface): Dispatch to Scheme. (scm_post_boot_init_modules): Resolve module-public-interface. * module/ice-9/boot-9.scm (module-public-interface): Implement in Scheme.
* module-type defined programmaticallyAndy Wingo2010-04-201-2/+8
| | | | | | | | | | | | | | * module/ice-9/boot-9.scm (make-record-type): Add an explanatory comment. (%print-module): Remove a hacky comment about redefinitions being difficult, because now the module-printer is called by name from module-type's printer. (module-type): Define the module type, its constructor, predicate, and accessors programmatically, at expansion time. Should reduce any errors in transcription, between adding fields and adding accessors. * libguile/modules.c (scm_lookup_closure_module): Move an explanatory comment here from boot-9.scm.
* Fix `module-reverse-lookup'.Ludovic Courtès2010-04-091-12/+15
| | | | | | | | | * libguile/modules.c (scm_module_reverse_lookup): Type-check VARIABLE. Don't traverse the `uses' list when MODULE is #f. * test-suite/tests/modules.test ("foundations")["module-reverse-lookup [pre-module-obarray]", "module-reverse-lookup [wrong-type-arg]"]: New tests.
* SCM_CELL in modules.cAndy Wingo2009-12-081-3/+3
| | | | | | * libguile/modules.c (SCM_F_EVAL_CLOSURE_INTERFACE) (SCM_EVAL_CLOSURE_INTERFACE_P, scm_standard_interface_eval_closure): Fix to not use SCM_CELL macros.
* remove a bunch of needless scm_permanent_object callsAndy Wingo2009-12-051-12/+9
| | | | | | | | | | | | | | | | | | | | | | | | | * libguile/array-handle.c: * libguile/bytevectors.c: * libguile/deprecated.c: * libguile/eval.c: * libguile/feature.c: * libguile/filesys.c: * libguile/gc.c: * libguile/gdbint.c: * libguile/goops.c: * libguile/instructions.c: * libguile/load.c: * libguile/modules.c: * libguile/numbers.c: * libguile/options.c: * libguile/ports.c: * libguile/scmsigs.c: * libguile/srcprop.c: * libguile/srfi-4.c: * libguile/stacks.c: * libguile/threads.c: * libguile/vm.c: Remove calls to scm_permanent_object, as they are no longer needed with the BDW GC.
* really boot primitive-eval from scheme.Andy Wingo2009-12-031-3/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * libguile/eval.c (scm_primitive_eval, scm_c_primitive_eval): (scm_init_eval): Rework so that scm_primitive_eval always calls out to the primitive-eval variable. The previous definition is the default value, which is probably overridden by scm_init_eval_in_scheme. * libguile/init.c (scm_i_init_guile): Move ports and load-path up, so we can debug when initing eval. Call scm_init_eval_in_scheme. Awesome. * libguile/load.h: * libguile/load.c (scm_init_eval_in_scheme): New procedure, loads up ice-9/eval.scm to replace the primitive-eval definition, if everything is there and up-to-date. * libguile/modules.c (scm_module_transformer): Export to Scheme, so it's there for eval.go. * module/ice-9/boot-9.scm: No need to define module-transformer. * module/ice-9/eval.scm (capture-env): Only reference the-root-module if modules are booted. (primitive-eval): Inline a definition for identity. Throw a more standard error for "wrong number of arguments". * module/ice-9/psyntax.scm (chi-install-global): The macro binding for a syncase macro is now a pair: the transformer, and the module that was current when the transformer was installed. The latter is used for hygiene purposes, replacing the use of procedure-module, which didn't work with the interpreter's shared-code closures. (chi-macro): Adapt for the binding being a pair, and get the hygiene from the cdr. (eval-local-transformer): Adapt to new form of macro bindings. * module/ice-9/psyntax-pp.scm: Regenerated. * .gitignore: Ignore eval.go.stamp. * module/Makefile.am: Reorder for fastest serial compilation, now that there are no ordering constraints. I did a number of experiments here and this seems to be the best; but the bulk of the time is compiling psyntax-pp.scm with eval.scm. Not so great. * libguile/vm-engine.c (vm-engine): Throw a more standard error for "wrong type to apply". * test-suite/tests/gc.test ("gc"): Remove a hack that shouldn't affect the new evaluator, and throw in another (gc) for good measure. * test-suite/tests/goops.test ("defining classes"): * test-suite/tests/hooks.test (proc1): We can't currently check what the arity is of a closure made by eval.scm -- or more accurately all closures have 0 required args and no rest args. So punt for now. * test-suite/tests/syntax.test ("letrec"): The scheme evaluator can't check that a variable is unbound, currently; perhaps the full "fixing letrec" expansion could fix this. But barring that, punt.
* export scm_define to scheme as define!Andy Wingo2009-12-011-4/+10
| | | | | * libguile/modules.c (scm_define): Export to Scheme as `define!'. The evaluator needs it, and actually it's an OK thing to have around.
* new evaluator, y'allAndy Wingo2009-12-011-43/+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.
* remove some deprecated things, undeprecate scm_the_root_module()Andy Wingo2009-12-011-5/+5
| | | | | | | | | | | | | | | * 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.
* add some optargs testsAndy Wingo2009-10-231-3/+9
| | | | | | | | * libguile/modules.c (scm_module_lookup, scm_lookup): Throw to 'unbound-variable, like eval.i.c does. * test-suite/tests/optargs.test: Add an optargs test. Run optargs tests under both the VM and the interpreter.
* Merge branch 'master' into boehm-demers-weiser-gcLudovic Courtès2009-08-181-14/+36
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: lib/Makefile.am libguile/Makefile.am libguile/frames.c libguile/gc-card.c libguile/gc-freelist.c libguile/gc-mark.c libguile/gc-segment.c libguile/gc_os_dep.c libguile/load.c libguile/macros.c libguile/objcodes.c libguile/programs.c libguile/strings.c libguile/vm.c m4/gnulib-cache.m4 m4/gnulib-comp.m4 m4/inline.m4
| * Change Guile license to LGPLv3+Neil Jerram2009-06-171-6/+7
| | | | | | | | | | | | | | | | | | | | (Not quite finished, the following will be done tomorrow. module/srfi/*.scm module/rnrs/*.scm module/scripts/*.scm testsuite/*.scm guile-readline/* )
| * add module-{define-keyword!,undefine-keyword!,lookup-keyword}Andy Wingo2009-04-261-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * libguile/modules.c (scm_module_local_variable): Allow this to be called before modules are booted with #f as the module. * module/ice-9/boot-9.scm (module-define-keyword!) (module-lookup-keyword, module-undefine-keyword!): Well, if syncase forces us to allow the keyword bindings to be partitioned from value bindings, let's go ahead and do that in boot-9 instead of in psyntax. A step on the way to removing `install-global-transformer'. (sc-chi): Remove. * module/ice-9/psyntax.scm (put-global-definition-hook): (remove-global-definition-hook, get-global-definition-hook): Use our new module-* functions. (sc-chi): Remove, no longer needed. * module/ice-9/psyntax-pp.scm: Regenerated.
| * scm_[current_]module_transformer returns the %pre-modules-transformer, if setAndy Wingo2009-04-211-6/+12
| | | | | | | | | | | | | | | | * libguile/modules.c (scm_module_transformer) (scm_current_module_transformer): So, if the module system hasn't yet booted, take the current transformer from a variable named %pre-modules-transformer from the %pre-modules-obarray. This is a prequel to booting syncase early in boot-9.
| * eval-closure-module, here hopefully not for longAndy Wingo2009-04-171-0/+15
| | | | | | | | | | | | * libguile/modules.h: * libguile/modules.c (scm_eval_closure_module): Define a new-yet-deprecated accessor, to ease a transition.
* | Merge branch 'master' into boehm-demers-weiser-gcLudovic Courtès2009-03-221-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
| * Merge commit 'origin/master' into vmAndy Wingo2008-09-301-0/+3
| |\ | | | | | | | | | | | | | | | | | | | | | Conflicts: doc/Makefile.am ice-9/Makefile.am libguile/gc.c
| * | move module-public-interface to C, and expose it as C APIAndy Wingo2008-09-291-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 ().
| * | module-variable accesses pre-module-obarray if module is #fAndy Wingo2008-09-071-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.
* | | Work around unintentional retention of modules by the GC.Ludovic Courtès2008-11-051-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.
* | | Merge branch 'master' into boehm-demers-weiser-gcLudovic Courtès2008-09-131-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
| * | Include <config.h> in all C files; use `#ifdef HAVE_CONFIG_H' rather than `#if'.Ludovic Courtès2008-09-131-0/+3
| |/
* | Merge branch 'master' into boehm-demers-weiser-gcLudovic Courtès2008-09-101-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
| * Release stuff: missing NEWS and 2007/2008 copyrights.Neil Jerram2008-02-151-1/+1
| |
| * * modules.c (the_root_module): Moved before scm_current_module.Neil Jerram2008-02-011-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.
* | Merge commit '7337d56d5714227865aeca2b40b6bd97cce296d2' into ↵Ludovic Courtès2008-09-101-56/+241
|\| | | | | | | | | | | | | boehm-demers-weiser-gc Conflicts: libguile/struct.c
| * Changes from arch/CVS synchronizationLudovic Courtès2007-05-051-56/+241
| |
* | Merge commit 'f30e1bdf97ae8b2b2918da585f887a4d3a23a347' into ↵Ludovic Courtès2008-09-101-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
| * Remove environments.[ch] from the build.Neil Jerram2006-11-021-2/+3
| |
* | Removed a lot of now-useless SMOB mark/free functions.Ludovic Courtes2008-09-051-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