summaryrefslogtreecommitdiff
path: root/libguile/keywords.c
Commit message (Expand)AuthorAgeFilesLines
* Better errors for odd-length keyword args...* libguile/vm-engine.c (bind-kwargs): * libguile/vm.c (vm_error_kwargs_missing_value): * libguile/eval.c (error_missing_value) (prepare_boot_closure_env_for_apply): Adapt to mirror VM behavior. * libguile/keywords.c (scm_c_bind_keyword_arguments): Likewise. * module/ice-9/eval.scm (primitive-eval): Update to error on (foo #:kw) with a "Keyword argument has no value" instead of the horrible "odd argument list length". Also adapts to the expected args format for the keyword-argument-error exception printer in all cases. Matches 1.8 optargs behavior also. * test-suite/standalone/test-scm-c-bind-keyword-arguments.c (test_missing_value): (missing_value_error_handler): Update test. * test-suite/tests/optargs.test: Add tests. Andy Wingo2017-02-281-10/+14
* Fix --without-threads...* libguile/dynl.c: * libguile/gc.c: * libguile/keywords.c: * libguile/scmsigs.c: * libguile/stime.c: Use scm_i_dynamic_link instead of scm_dynamic_link so that things compile in without-threads configurations. Andy Wingo2016-12-071-1/+1
* Deprecate dynamic roots...* libguile/root.h: * libguile/root.c: Remove these files. * libguile/deprecated.h: * libguile/deprecated.c (scm_internal_cwdr, scm_call_with_dynamic_root) (scm_dynamic_root, scm_apply_with_dynamic_root): Deprecate. Remove all root.h usage, which was vestigial. * module/ice-9/serialize.scm: Use (current-thread) instead of (dynamic-root). Andy Wingo2016-11-211-1/+0
* Mutex instead of critical sectoin in symbol->keyword...* libguile/keywords.c (scm_symbol_to_keyword): Use a mutex in a dynwind instead of a critical section. Andy Wingo2016-11-011-2/+3
* Keywords have a tc7...* libguile/tags.h (scm_tc7_keyword): Allocate a tc7, so that the VM can have cheap keyword? tests. * libguile/keywords.c: * libguile/keywords.h: Adapt. * libguile/goops.c (scm_class_of, scm_sys_goops_early_init): Capture <keyword>. * libguile/print.c (iprin1): Inline keyword printer. * libguile/evalext.c (scm_self_evaluating_p): Add keywords here. * libguile/deprecated.h: * libguile/deprecated.c (scm_tc16_keyword): Deprecate. * module/language/cps/compile-bytecode.scm (compile-fun): Add keyword? case, and bitvector? case while we're at it. * module/language/cps/effects-analysis.scm (define-primitive-effects): Add bytevector?, keyword?, and bitvector? cases. * module/language/cps/primitives.scm (*branching-primcall-arities*): Add keyword?. * module/language/cps/types.scm (bitvector?, keyword?, bytevector?): Add branch inferrers. * module/language/tree-il/primitives.scm (*interesting-primitive-names*): (*effect-free-primitives*): (*effect+exception-free-primitives*): Add bytevector?, keyword?, and bitvector?. * module/oop/goops.scm (<keyword>): New class. * module/system/base/types.scm (%tc7-keyword, cell->object): Add cases. * module/system/vm/assembler.scm (br-if-keyword): New definition. * module/system/vm/disassembler.scm (code-annotation): Add br-if-tc7 case for keywords. * test-suite/tests/types.test ("clonable objects"): Update now that keywords are cloneable. Andy Wingo2015-01-221-23/+10
* Merge remote-tracking branch 'origin/stable-2.0'...Conflicts: libguile/keywords.c libguile/vm.c Mark H Weaver2013-07-161-8/+12
|\
| * Report the faulty keyword in errors raised by `scm_c_bind_keyword_arguments'....Reported by Mark H. Weaver. * libguile/keywords.c (scm_c_bind_keyword_arguments): Use `scm_error_scm' instead of `scm_error'. Pass the faulty keyword enclosed in a list as the last argument. * test-suite/tests/optargs.test ("scm_c_bind_keyword_arguments"): New test prefix. Ludovic Courtès2013-06-051-8/+12
* | Merge remote-tracking branch 'origin/stable-2.0'...Conflicts: GUILE-VERSION libguile/array-map.c libguile/fports.h libguile/gc.h libguile/inline.h libguile/ports.c libguile/ports.h libguile/print.c libguile/r6rs-ports.c libguile/read.c test-suite/tests/00-socket.test Mark H Weaver2013-04-141-0/+67
|\|
| * Implement 'scm_c_bind_keyword_arguments'....* libguile/keywords.c (scm_keyword_argument_error): New variable. (scm_c_bind_keyword_arguments): New API function. * libguile/keywords.h (enum scm_keyword_arguments_flags): New enum. (scm_t_keyword_arguments_flags): New typedef. (scm_c_bind_keyword_arguments): New prototype. * doc/ref/api-data.texi (Coding With Keywords, Keyword Procedures): Add documentation. * test-suite/standalone/test-scm-c-bind-keyword-arguments.c: New file. * test-suite/standalone/Makefile.am: Add test-scm-c-bind-keyword-arguments test. Mark H Weaver2013-04-061-0/+67
| * Add scm_from_latin1_keyword and scm_from_utf8_keyword...* libguile/keywords.c (scm_from_latin1_keyword, scm_from_utf8_keyword): New functions appropriate for use when keyword name is a constant. (scm_from_locale_keyword, scm_from_locale_keywordn): Change formal parameter from `str' to `name'. * libguile/keywords.h: Add prototypes for new functions. Change formal parameter of scm_from_locale_keyword* from `str' to `name'. * doc/ref/api-data.texi: Document new functions. Remind users that scm_from_locale_keyword should not be used when the name is a C string constant. Change formal parameter from `str' to `name'. Mark H Weaver2011-03-091-4/+16
* | locking for putc, puts...* libguile/ports.c (scm_putc, scm_puts): * libguile/ports.h (scm_putc_unlocked, scm_puts_unlocked): Separate into _unlocked and locked variants. Change all callers to use the _unlocked versions. Andy Wingo2011-11-081-2/+2
* | Add scm_from_latin1_keyword and scm_from_utf8_keyword...* libguile/keywords.c (scm_from_latin1_keyword, scm_from_utf8_keyword): New functions appropriate for use when keyword name is a constant. (scm_from_locale_keyword, scm_from_locale_keywordn): Change formal parameter from `str' to `name'. * libguile/keywords.h: Add prototypes for new functions. Change formal parameter of scm_from_locale_keyword* from `str' to `name'. * doc/ref/api-data.texi: Document new functions. Remind users that scm_from_locale_keyword should not be used when the name is a C string constant. Change formal parameter from `str' to `name'. Mark H Weaver2011-03-091-4/+16
|/
* decruftify scm_sys_protects...* libguile/root.h * libguile/root.c (scm_sys_protects): It used to be that for some reason we'd define a special array of "protected" values. This was a little silly, always, but with the BDW GC it's completely unnecessary. Also many of these variables were unused, and none of them were good API. So remove this array, and either eliminate, make static, or make internal the various values. * libguile/snarf.h: No need to generate calls to scm_permanent_object. * guile-readline/readline.c (scm_init_readline): No need to call scm_permanent_object. * libguile/array-map.c (ramap, rafe): Remove the dubious nullvect optimizations. * libguile/async.c (scm_init_async): No need to init scm_asyncs, it is no more. * libguile/eval.c (scm_init_eval): No need to init scm_listofnull, it is no more. * libguile/gc.c: Make scm_protects a static var. (scm_storage_prehistory): Change the sanity check to use the address of protects. (scm_init_gc_protect_object): No need to clear the scm_sys_protects, as it is no more. * libguile/keywords.c: Make the keyword obarray a static var. * libguile/numbers.c: Make flo0 a static var. * libguile/objprop.c: Make object_whash a static var. * libguile/properties.c: Make properties_whash a static var. * libguile/srcprop.h: * libguile/srcprop.c: Make scm_source_whash a global with internal linkage. * libguile/strings.h: * libguile/strings.c: Make scm_nullstr a global with internal linkage. * libguile/vectors.c (scm_init_vectors): No need to init scm_nullvect, it's unused. Andy Wingo2009-12-051-4/+6
* Merge branch 'master' into boehm-demers-weiser-gc...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 Ludovic Courtès2009-08-181-6/+7
|\
| * 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
* | Merge branch 'master' into boehm-demers-weiser-gc...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 Ludovic Courtès2008-09-131-1/+4
|\|
| * Include <config.h> in all C files; use `#ifdef HAVE_CONFIG_H' rather than `#if'.Ludovic Courtès2008-09-131-1/+4
* | Removed a lot of now-useless SMOB mark/free functions....* 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 Ludovic Courtes2008-09-051-1/+0
|/
* merge from 1.8 branchKevin Ryde2006-04-171-1/+1
* The FSF has a new address.Marius Vollmer2005-05-231-1/+1
* Critical section reviewNeil Jerram2005-04-241-1/+2
* Include "libguile/async.h" for SCM_CRITICAL_SECTION_START/END.Marius Vollmer2005-03-071-0/+1
* See ChangeLog from 2005-03-02.Marius Vollmer2005-03-021-2/+2
* * keywords.c (scm_symbol_to_keyword): Use SCM_ASSERT_TYPE for a...better error message. Marius Vollmer2004-10-041-1/+1
* * keywords.h, keywords.c, deprecated.h, deprecated.c...(SCM_KEYWORDP, SCM_KEYWORDSYM): Deprecated and implemented in terms of scm_is_keyword and scm_keyword_dash_symbol. * keywords.h, keywords.c, discouraged.h, discouraged.c (scm_make_keyword_from_dash_symbol, scm_keyword_dash_symbol, scm_c_make_keyword): Discouraged. * keywords.h, keywords.c (scm_symbol_to_keyword, scm_keyword_to_symbol): Implemented in C. (scm_is_keyword, scm_from_locale_keyword, scm_from_locale_keywordn): New. Marius Vollmer2004-10-041-41/+37
* * strings.h, strings.c: (scm_i_string_chars, scm_i_string_length,...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. Marius Vollmer2004-08-191-10/+13
* * deprecated.h, boolean.h (SCM_FALSEP, SCM_NFALSEP, SCM_BOOL,...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. Marius Vollmer2004-07-061-2/+2
* Changed license terms to the plain LGPL thru-out.Marius Vollmer2003-04-051-36/+12
* * environments.c (DEFAULT_OBARRAY_SIZE): Changed from 137 to 31...(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. Mikael Djurfeldt2003-02-191-2/+2
* Retire inclusion guard macro SCM_MAGIC_SNARFER.Thien-Thi Nguyen2002-03-141-2/+0
* * gc.h, gc.c (scm_gc_sweep): Issue deprecation warning when...non-zero is returned from a port or smob free function. (scm_malloc, scm_realloc, scm_strndup, scm_strdup, scm_gc_register_collectable_memory, scm_gc_unregister_collectable_memory, scm_gc_malloc, scm_gc_realloc, scm_gc_free, scm_gc_strndup, scm_gc_strdup): New. * backtrace.c, continuations.c, convert.i.c, coop-threads.c, debug-malloc.c, dynl.c, environments.c, environments.h, extensions.c, filesys.c, fports.c, gc.c, gc.h, gh_data.c, goops.c, guardians.c, hooks.c, init.c, keywords.c, load.c, numbers.c, ports.c, posix.c, procs.c, rdelim.c, regex-posix.c, root.c, smob.c, stime.c, strings.c, struct.c, struct.h, symbols.c, unif.c, vectors.c, weaks.c: Use scm_gc_malloc/scm_malloc and scm_gc_free/free instead of scm_must_malloc and scm_must_free, as appropriate. Return zero from smob and port free functions. * debug-malloc.c (scm_malloc_reregister): Handle "old == NULL". * fports.c (scm_setvbuf): Reset read buffer to saved values when it is pointing to the putback buffer. Marius Vollmer2002-02-111-3/+2
* Remove "face-lift" comment.Thien-Thi Nguyen2001-07-091-2/+0
* replace "scm_*_t" with "scm_t_*".Marius Vollmer2001-06-141-1/+1
* * Fixed some bugs, some reported by Matthias Koeppe.Dirk Herrmann2001-06-081-2/+5
* * Introduce SCM_UNUSED and mark unused function parameters....* Introduce SCM_DEBUG_PAIR_ACCESSES. * Extend the possibilities of SCM_DEBUG_CELL_ACCESSES. Dirk Herrmann2001-06-071-1/+1
* (keyword_print): Substract 1 from length of symbol name, accounting...for the silly dash. Marius Vollmer2001-06-041-2/+2
* (keyword_print): Use scm_print_symbol_name so that...weird names are printed correctly. Marius Vollmer2001-05-301-1/+3
* Merge from mvo-vcell-cleanup-1-branch.Marius Vollmer2001-05-151-8/+5
* Correct, update, improve and clean up a lot of docstrings in order to make...the documentation much more consistent. Martin Grabmüller2001-04-031-1/+2
* * Replaced a lot of calls to SCM_C[AD]R with more appropriate macros....* Minor cleanups to hashtable implementation. * Minor code beautifications. Dirk Herrmann2001-03-301-4/+4
* Remove #include <stdio.h>. Add #include <string.h>.Keisuke Nishida2001-03-091-1/+0
* Remove dump facilities.Keisuke Nishida2001-03-021-23/+0
* Removed redundant code.Keisuke Nishida2001-02-061-2/+4
* Minor modifications.Keisuke Nishida2001-02-051-1/+1
* New dump/undump scheme.Keisuke Nishida2001-02-051-4/+4
* New files: dump.c, dump.h.Keisuke Nishida2001-02-031-0/+20
* New functions: scm_c_make_vector, scm_c_make_hash_table.Keisuke Nishida2001-02-021-2/+2
* * Added missing includes of string.h.Dirk Herrmann2001-01-261-0/+2
* * Initialize symbols using SCM_(GLOBAL_)?SYMBOL instead of scm_sysintern......* Use scm_str2symbol instead of scm_sysintern0. * Garbage collection initialization code now within gc.c only. Dirk Herrmann2000-12-111-3/+6
* Smob-related creanup.Keisuke Nishida2000-12-081-5/+6