summaryrefslogtreecommitdiff
path: root/libguile/keywords.h
Commit message (Collapse)AuthorAgeFilesLines
* Implement hashing for keywords, i.e. (hash #:x ...)Rob Browning2020-02-211-0/+2
| | | | | | | | | Add keyword handling to (hash ...). Previously it would just return the same value for all keywords. * libguile/hash.c (scm_raw_ihash): Add scm_tc7_keyword case. * libguile/keywords.h (SCM_I_KEYWORD_HASH): New macro.
* Use 'scm_from_utf8_{string,symbol,keyword}' for C string literals.Mark H Weaver2019-05-231-3/+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.
* Update license notices in all C filesAndy Wingo2018-06-201-17/+17
| | | | | Update to newest recommended license notices from the FSF. Everything stays LGPLv3+ except guile-readline which is GPLv3+.
* Remove (C) from copyright statementsAndy Wingo2018-06-201-1/+1
| | | | | | As the FSF advises, 'There is no legal significance to using the three-character sequence “(C)”, but it does no harm.' It does take up space though! For that reason, we remove it here from our C files.
* Rename __scm.h to scm.hAndy Wingo2018-06-201-1/+0
| | | | * libguile/scm.h: Rename. Update all includers.
* Remove Emacs local variables comments in Guile sourceAndy Wingo2018-06-201-6/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The .dir-locals.el file in the repository is sufficient for Emacs users. * libguile/__scm.h: * libguile/alist.c: * libguile/alist.h: * libguile/array-handle.c: * libguile/array-handle.h: * libguile/array-map.c: * libguile/array-map.h: * libguile/arrays.c: * libguile/arrays.h: * libguile/async.c: * libguile/async.h: * libguile/backtrace.c: * libguile/backtrace.h: * libguile/bitvectors.c: * libguile/bitvectors.h: * libguile/boolean.c: * libguile/boolean.h: * libguile/chars.c: * libguile/chars.h: * libguile/chooks.c: * libguile/chooks.h: * libguile/continuations.c: * libguile/continuations.h: * libguile/control.c: * libguile/conv-integer.i.c: * libguile/debug-malloc.h: * libguile/debug.c: * libguile/debug.h: * libguile/deprecation.c: * libguile/deprecation.h: * libguile/dynl.c: * libguile/dynl.h: * libguile/dynstack.c: * libguile/dynstack.h: * libguile/dynwind.c: * libguile/dynwind.h: * libguile/eq.c: * libguile/eq.h: * libguile/error.c: * libguile/error.h: * libguile/eval.c: * libguile/eval.h: * libguile/evalext.c: * libguile/evalext.h: * libguile/expand.c: * libguile/expand.h: * libguile/extensions.c: * libguile/extensions.h: * libguile/feature.c: * libguile/feature.h: * libguile/filesys.c: * libguile/filesys.h: * libguile/fluids.c: * libguile/fluids.h: * libguile/foreign.c: * libguile/fports.c: * libguile/fports.h: * libguile/frames.c: * libguile/frames.h: * libguile/gc-inline.h: * libguile/gc.c: * libguile/gc.h: * libguile/generalized-arrays.c: * libguile/generalized-arrays.h: * libguile/generalized-vectors.c: * libguile/generalized-vectors.h: * libguile/gettext.c: * libguile/gettext.h: * libguile/goops.c: * libguile/goops.h: * libguile/gsubr.c: * libguile/gsubr.h: * libguile/guardians.c: * libguile/guardians.h: * libguile/guile.c: * libguile/hash.c: * libguile/hash.h: * libguile/hashtab.c: * libguile/hashtab.h: * libguile/hooks.c: * libguile/hooks.h: * libguile/i18n.c: * libguile/i18n.h: * libguile/init.c: * libguile/init.h: * libguile/instructions.c: * libguile/instructions.h: * libguile/intrinsics.c: * libguile/intrinsics.h: * libguile/ioext.c: * libguile/ioext.h: * libguile/iselect.h: * libguile/keywords.c: * libguile/keywords.h: * libguile/list.c: * libguile/list.h: * libguile/load.c: * libguile/load.h: * libguile/loader.c: * libguile/loader.h: * libguile/macros.c: * libguile/macros.h: * libguile/mallocs.c: * libguile/mallocs.h: * libguile/memmove.c: * libguile/memoize.c: * libguile/memoize.h: * libguile/modules.c: * libguile/modules.h: * libguile/net_db.c: * libguile/net_db.h: * libguile/null-threads.c: * libguile/null-threads.h: * libguile/numbers.c: * libguile/numbers.h: * libguile/objprop.c: * libguile/objprop.h: * libguile/options.c: * libguile/options.h: * libguile/pairs.c: * libguile/pairs.h: * libguile/poll.c: * libguile/poll.h: * libguile/ports.c: * libguile/ports.h: * libguile/posix.c: * libguile/posix.h: * libguile/print.c: * libguile/print.h: * libguile/procprop.c: * libguile/procprop.h: * libguile/procs.c: * libguile/procs.h: * libguile/programs.c: * libguile/programs.h: * libguile/promises.c: * libguile/promises.h: * libguile/pthread-threads.h: * libguile/random.c: * libguile/random.h: * libguile/rdelim.c: * libguile/rdelim.h: * libguile/read.c: * libguile/read.h: * libguile/regex-posix.c: * libguile/regex-posix.h: * libguile/rw.c: * libguile/rw.h: * libguile/scmsigs.c: * libguile/scmsigs.h: * libguile/script.c: * libguile/script.h: * libguile/simpos.c: * libguile/simpos.h: * libguile/smob.c: * libguile/smob.h: * libguile/snarf.h: * libguile/socket.c: * libguile/socket.h: * libguile/sort.c: * libguile/sort.h: * libguile/srcprop.c: * libguile/srcprop.h: * libguile/stackchk.c: * libguile/stackchk.h: * libguile/stacks.c: * libguile/stacks.h: * libguile/stime.c: * libguile/stime.h: * libguile/strerror.c: * libguile/strings.c: * libguile/strings.h: * libguile/strorder.c: * libguile/strorder.h: * libguile/strports.c: * libguile/strports.h: * libguile/struct.c: * libguile/struct.h: * libguile/symbols.c: * libguile/symbols.h: * libguile/syntax.c: * libguile/syscalls.h: * libguile/tags.h: * libguile/threads.c: * libguile/threads.h: * libguile/throw.c: * libguile/throw.h: * libguile/trees.h: * libguile/unicode.c: * libguile/unicode.h: * libguile/uniform.c: * libguile/uniform.h: * libguile/values.c: * libguile/values.h: * libguile/variable.c: * libguile/variable.h: * libguile/vectors.c: * libguile/vectors.h: * libguile/version.c: * libguile/vm-engine.c: * libguile/vm-expand.h: * libguile/vm.c: * libguile/vm.h: * libguile/vports.c: * libguile/vports.h: * libguile/weak-list.h: * libguile/weak-set.c: * libguile/weak-set.h: * libguile/weak-table.c: * libguile/weak-table.h: * libguile/weak-vector.c: * libguile/weak-vector.h: Remove needless trailing comments.
* Remove useless "classes: h_files" from Guile headers.Andy Wingo2018-06-201-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * libguile/__scm.h: * libguile/alist.h: * libguile/array-handle.h: * libguile/array-map.h: * libguile/arrays.h: * libguile/async.h: * libguile/backtrace.h: * libguile/bitvectors.h: * libguile/boolean.h: * libguile/chars.h: * libguile/chooks.h: * libguile/continuations.h: * libguile/debug-malloc.h: * libguile/debug.h: * libguile/deprecation.h: * libguile/dynl.h: * libguile/dynstack.h: * libguile/dynwind.h: * libguile/eq.h: * libguile/error.h: * libguile/eval.h: * libguile/evalext.h: * libguile/expand.h: * libguile/extensions.h: * libguile/feature.h: * libguile/filesys.h: * libguile/fluids.h: * libguile/fports.h: * libguile/gc-inline.h: * libguile/gc.h: * libguile/generalized-arrays.h: * libguile/generalized-vectors.h: * libguile/gettext.h: * libguile/goops.h: * libguile/gsubr.h: * libguile/guardians.h: * libguile/hash.h: * libguile/hashtab.h: * libguile/hooks.h: * libguile/i18n.h: * libguile/init.h: * libguile/inline.h: * libguile/ioext.h: * libguile/iselect.h: * libguile/keywords.h: * libguile/list.h: * libguile/load.h: * libguile/macros.h: * libguile/mallocs.c: * libguile/mallocs.h: * libguile/memoize.h: * libguile/modules.h: * libguile/net_db.h: * libguile/null-threads.h: * libguile/numbers.h: * libguile/objprop.h: * libguile/options.h: * libguile/pairs.h: * libguile/poll.h: * libguile/ports.h: * libguile/posix-w32.h: * libguile/posix.h: * libguile/print.h: * libguile/procprop.h: * libguile/procs.h: * libguile/promises.h: * libguile/pthread-threads.h: * libguile/random.h: * libguile/rdelim.h: * libguile/read.h: * libguile/regex-posix.h: * libguile/rw.h: * libguile/scmsigs.h: * libguile/script.h: * libguile/simpos.h: * libguile/smob.h: * libguile/snarf.h: * libguile/socket.h: * libguile/sort.h: * libguile/srcprop.h: * libguile/stackchk.h: * libguile/stacks.h: * libguile/stime.h: * libguile/strings.h: * libguile/strorder.h: * libguile/strports.h: * libguile/struct.h: * libguile/symbols.h: * libguile/syscalls.h: * libguile/tags.h: * libguile/threads.h: * libguile/throw.h: * libguile/trees.h: * libguile/unicode.h: * libguile/uniform.h: * libguile/values.h: * libguile/variable.h: * libguile/vectors.h: * libguile/vports.h: * libguile/weak-list.h: * libguile/weak-set.h: * libguile/weak-table.h: * libguile/weak-vector.h: Remove "classes: h_files". Reformat copyrights if needed.
* Devolve keyword-snarfing macrosAndy Wingo2018-06-201-0/+9
| | | | | * libguile/snarf.h: * libguile/keywords.h (SCM_KEYWORD, SCM_GLOBAL_KEYWORD): Move here.
* Devolve more validate macrosAndy Wingo2018-06-181-1/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * libguile.h: Add chooks.h. * libguile/Makefile.am: Add chooks.h and chooks.c. * libguile/chooks.c: * libguile/chooks.h: New files, for the C implementation of hooks. Broken out to avoid cycles in gc.h includes. * libguile/gc.h: * libguile/gc.c (scm_i_gc_admin_mutex, scm_i_sweep_mutex): Remove unused mutexes. Include chooks instead of hooks in the main header. * libguile/deprecated.h (scm_gc_running_p): Deprecate this macro always defined to 0. (SCM_VALIDATE_VECTOR_OR_DVECTOR): Deprecate this weird one too. * libguile/array-map.c: Add procs.h include. * libguile/threads.h: * libguile/vm.c: * libguile/r6rs-ports.c: Add smob.h include. * libguile/atomic.h (SCM_VALIDATE_ATOMIC_BOX): Devolve. * libguile/deprecation.c (scm_c_issue_deprecation_warning): Remove use of scm_gc_running_p. * libguile/error.c (scm_error_scm): Remove use of scm_gc_running_p. * libguile/filesys.h (SCM_VALIDATE_DIR) * libguile/fluids.h (SCM_VALIDATE_FLUID) * libguile/fports.h (SCM_VALIDATE_FPORT, SCM_VALIDATE_OPFPORT) * libguile/generalized-arrays.h (SCM_VALIDATE_ARRAY) * libguile/hooks.h (SCM_VALIDATE_HOOK) * libguile/keywords.h (SCM_VALIDATE_KEYWORD) * libguile/ports.h (SCM_VALIDATE_PORT, SCM_VALIDATE_INPUT_PORT) (SCM_VALIDATE_OUTPUT_PORT, SCM_VALIDATE_OPINPORT) (SCM_VALIDATE_OPENPORT, SCM_VALIDATE_OPPORT, SCM_VALIDATE_OPOUTPORT) * libguile/procs.h (SCM_VALIDATE_PROC) * libguile/random.h (SCM_VALIDATE_RSTATE) * libguile/regex-posix.h (SCM_VALIDATE_RGXP) * libguile/stacks.h (SCM_VALIDATE_STACK, SCM_VALIDATE_FRAME) * libguile/strports.h (SCM_VALIDATE_OPOUTSTRPORT) * libguile/struct.h (SCM_VALIDATE_STRUCT SCM_VALIDATE_VTABLE) * libguile/symbols.h (SCM_VALIDATE_SYMBOL) * libguile/variable.h (SCM_VALIDATE_VARIABLE) * libguile/vectors.h (SCM_VALIDATE_VECTOR SCM_VALIDATE_VECTOR_LEN): Devolve. * libguile/validate.h: It's empty now! hooks squish
* Keywords have a tc7Andy Wingo2015-01-221-5/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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.
* Implement 'scm_c_bind_keyword_arguments'.Mark H Weaver2013-04-061-0/+12
| | | | | | | | | | | | | | | | | * 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.
* Add scm_from_latin1_keyword and scm_from_utf8_keywordMark H Weaver2011-03-091-2/+4
| | | | | | | | | | | | | | | * 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'.
* 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 `SCM_INTERNAL' macro, use it.Ludovic Courtès2008-05-311-2/+2
|
* merge from 1.8 branchKevin Ryde2006-04-171-1/+1
|
* The FSF has a new address.Marius Vollmer2005-05-231-1/+1
|
* * keywords.h, keywords.c, deprecated.h, deprecated.cMarius Vollmer2004-10-041-7/+7
| | | | | | | | | | | | | | (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.
* Use SCM_SMOB_* instead of SCM_CELL_* as appropriate. UseMarius Vollmer2004-05-061-2/+2
| | | | | SCM_SMOB_FLAGS and SCM_SET_SMOB_FLAGS instead of accessing the zeroth word directly. Use SCM_SMOB_PREDICATE as appropriate.
* Changed license terms to the plain LGPL thru-out.Marius Vollmer2003-04-051-35/+11
|
* Prefixed each each exported symbol with SCM_API.Marius Vollmer2001-11-021-6/+6
|
* * Renamed header macros to the SCM_<filename>_H format.Dirk Herrmann2001-08-311-7/+8
|
* * alist.c, arbiters.c, async.h, backtrace.h, boolean.c, chars.c,Martin Grabmüller2001-07-191-1/+1
| | | | | | | | | | | | | | chars.h, continuations.h, debug-malloc.h, dynl.c, feature.c, feature.h, filesys.h, fluids.h, fports.h, gc_os_dep.c, gdb_interface.h, gh_eval.c, gh_funcs.c, gh_io.c, gh_list.c, gh_predicates.c, gsubr.c, gsubr.h, guardians.h, guile-func-name-check.in, guile-snarf-docs-texi.in, guile-snarf-docs.in, guile-snarf.awk.in, guile-snarf.in, hashtab.h, iselect.h, keywords.h, lang.c, list.h, load.h, objprop.c, objprop.h, options.c, options.h, random.h, regex-posix.h, root.c, root.h, script.c, snarf.h, stackchk.c, strerror.c, strop.h, strports.h, threads.h, values.c, values.h, version.c, version.h: Updated copyright notice.
* Remove "face-lift" comment.Thien-Thi Nguyen2001-07-091-2/+0
|
* replace "scm_*_t" with "scm_t_*".Marius Vollmer2001-06-141-1/+1
|
* Smob-related creanup.Keisuke Nishida2000-12-081-1/+2
|
* Updated copyrightsMikael Djurfeldt2000-06-121-1/+1
|
* * Replace SCM_UNPACK_CAR appropriately.Dirk Herrmann2000-05-251-2/+2
| | | | | * Only access cons cells via SCM_{SET}?C[AD]R. * gc.c: Remove unused struct member variable 'valid'.
* * *.[hc]: add Emacs magic at the end of file, to ensure GNUMichael Livshin2000-03-191-0/+6
| | | | indentation style.
* *** empty log message ***Mikael Djurfeldt2000-03-121-1/+1
|
* * async.c, boolean.h, debug.c, dynl.c, dynwind.c, eval.c, eval.h,Mikael Djurfeldt2000-03-121-1/+1
| | | | | | | | | | | feature.h, filesys.h, fluids.h, fports.c, fports.h, gc.c, gc.h, hash.c, keywords.h, macros.c, numbers.c, numbers.h, objects.c, objects.h, options.c, pairs.h, ports.c, ports.h, print.c, procs.h, ramap.c, read.c, smob.c, smob.h, srcprop.h, stacks.c, stacks.h, strports.c, struct.c, struct.h, tag.c, tags.h, throw.c, unif.c, unif.h, variable.h, vectors.h, weaks.c, weaks.h (SCM_SCM, SCM_BITS, SCM_CARBITS): Renamed from SCM_ASSCM, SCM_ASWORD, SCM_CARW).
* *.[ch]: make a distinction between SCM as a genericGreg J. Badros2000-03-091-1/+1
| | | | | | | name for a Scheme object (now a void*), and SCM as 32 bit word for storing tags and immediates (now a long int). Introduced SCM_ASWORD and SCM_ASSCM for conversion. Fixed various dubious code in the process: arbiter.c (use macros), unif.c (scm_array_p),
* * *.h: Use SCM_NIMP(X) && in all the FOOP macros.Greg J. Badros1999-12-161-1/+4
| | | | | * *.[ch]: Use do { ... } while (0) idiom in macros that expanded to a bare block.
* * keywords.c, keywords.h (scm_c_make_keyword): New function.Mikael Djurfeldt1999-06-231-4/+5
| | | | (We should remove the use of the prefix '-'.)
* * keywords.c, keywords.h: Files renamed from kw.c, kw.h.Mikael Djurfeldt1999-03-141-0/+63