Mark H Weaver
0c0a658c56
Improve the documentation for 'nil?'.
...
* libguile/boolean.c (scm_nil_p): Improve docstring.
* doc/ref/api-languages.texi (Nil): Add documentation for 'nil?', along
with a description of how Elisp interprets Scheme booleans and
end-of-list.
2019-05-23 15:53:55 +02:00
Andy Wingo
1234bb1850
Update license notices in all C files
...
Update to newest recommended license notices from the FSF. Everything
stays LGPLv3+ except guile-readline which is GPLv3+.
2018-06-20 20:07:34 +02:00
Andy Wingo
791eb0c01a
Remove (C) from copyright statements
...
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.
2018-06-20 19:17:06 +02:00
Andy Wingo
b8d757732f
Rationalize include order in C files
...
Include config.h first, then system includes, then libguile includes, in
alphabetical order, then the include for the file in question.
2018-06-20 18:31:24 +02:00
Andy Wingo
3068bc7384
Make libguile header inclusion consistent within libguile c files
...
Change from '#include "libguile/foo.h"' and '#include <libguile/foo.h>'
to '#include "foo.h"'.
2018-06-20 17:19:31 +02:00
Andy Wingo
97cc65fee4
Rename __scm.h to scm.h
...
* libguile/scm.h: Rename. Update all includers.
2018-06-20 16:33:33 +02:00
Andy Wingo
d9eafa374c
Inline tags.h into __scm.h
...
* libguile/__scm.h: Inline tags.h, and reformat comments. Before, these
files used to include each other!
* libguile.h:
* libguile/atomic.h:
* libguile/boolean.c:
* libguile/eq.h:
* libguile/gc-malloc.c:
* libguile/gc.c:
* libguile/pairs.c:
* libguile/pairs.h:
* libguile/ports.h:
* libguile/print.c:
* libguile/snarf.h:
* libguile/tags.h: Remove tags.h includes.
2018-06-20 16:10:54 +02:00
Andy Wingo
c495b44714
Remove Emacs local variables comments in Guile source
...
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.
2018-06-20 14:32:28 +02:00
Andy Wingo
40ade0886e
Remove _scm.h
...
* libguile/_scm.h: Remove. An internal header, never installed.
* libguile/__scm.h: Remove horrible documentation.
* libguile/Makefile.am (EXTRA_libguile_@GUILE_EFFECTIVE_VERSION@_la_SOURCES):
Remove _scm.h.
* libguile/alist.c:
* libguile/array-handle.c:
* libguile/array-map.c:
* libguile/arrays.c:
* libguile/async.c:
* libguile/atomic.c:
* libguile/backtrace.c:
* libguile/bitvectors.c:
* libguile/boolean.c:
* libguile/bytevectors.c:
* libguile/chars.c:
* libguile/continuations.c:
* libguile/control.c:
* libguile/debug-malloc.c:
* libguile/debug.c:
* libguile/deprecated.c:
* libguile/deprecation.c:
* libguile/dynl.c:
* libguile/dynstack.c:
* libguile/dynwind.c:
* libguile/eq.c:
* libguile/error.c:
* libguile/eval.c:
* libguile/evalext.c:
* libguile/expand.c:
* libguile/extensions.c:
* libguile/fdes-finalizers.c:
* libguile/feature.c:
* libguile/filesys.c:
* libguile/finalizers.c:
* libguile/fluids.c:
* libguile/foreign-object.c:
* libguile/foreign.c:
* libguile/fports.c:
* libguile/frames.c:
* libguile/gc-malloc.c:
* libguile/gc.c:
* libguile/gen-scmconfig.c:
* libguile/generalized-arrays.c:
* libguile/generalized-vectors.c:
* libguile/gettext.c:
* libguile/goops.c:
* libguile/gsubr.c:
* libguile/guardians.c:
* libguile/hash.c:
* libguile/hashtab.c:
* libguile/hooks.c:
* libguile/i18n.c:
* libguile/init.c:
* libguile/instructions.c:
* libguile/intrinsics.c:
* libguile/ioext.c:
* libguile/keywords.c:
* libguile/list.c:
* libguile/load.c:
* libguile/loader.c:
* libguile/macros.c:
* libguile/mallocs.c:
* libguile/memoize.c:
* libguile/modules.c:
* libguile/net_db.c:
* libguile/null-threads.c:
* libguile/numbers.c:
* libguile/objprop.c:
* libguile/options.c:
* libguile/pairs.c:
* libguile/poll.c:
* libguile/ports-internal.h:
* libguile/ports.c:
* libguile/posix.c:
* libguile/print.c:
* libguile/procprop.c:
* libguile/procs.c:
* libguile/programs.c:
* libguile/promises.c:
* libguile/r6rs-ports.c:
* libguile/random.c:
* libguile/rdelim.c:
* libguile/read.c:
* libguile/regex-posix.c:
* libguile/rw.c:
* libguile/scmsigs.c:
* libguile/script.c:
* libguile/simpos.c:
* libguile/smob.c:
* libguile/socket.c:
* libguile/sort.c:
* libguile/srcprop.c:
* libguile/srfi-1.c:
* libguile/srfi-13.c:
* libguile/srfi-14.c:
* libguile/srfi-4.c:
* libguile/srfi-60.c:
* libguile/stackchk.c:
* libguile/stacks.c:
* libguile/stime.c:
* libguile/strings.c:
* libguile/strorder.c:
* libguile/strports.c:
* libguile/struct.c:
* libguile/symbols.c:
* libguile/syntax.c:
* libguile/threads.c:
* libguile/throw.c:
* libguile/trees.c:
* libguile/unicode.c:
* libguile/uniform.c:
* libguile/values.c:
* libguile/variable.c:
* libguile/vectors.c:
* libguile/version.c:
* libguile/vm.c:
* libguile/vports.c:
* libguile/weak-set.c:
* libguile/weak-table.c:
* libguile/weak-vector.c: Remove _scm.h includes.
2018-06-20 14:26:01 +02:00
Andy Wingo
38385d1359
Devolve strings.h
...
* libguile/_scm.h: Remove strings.h.
* libguile/array-handle.c:
* libguile/boolean.c:
* libguile/generalized-vectors.c:
* libguile/loader.c:
* libguile/unicode.c: Add strings.h.
* libguile/symbols.h: Add strings.h, which was missing from the previous
symbols.h devolution.
2018-06-20 13:49:12 +02:00
Andy Wingo
bf15afa6bf
Move subr snarfing macros to gsubr.h.
...
* libguile/snarf.h: Remove gsubr include and subr snarfers.
* libguile/gsubr.h (SCM_DEFINE_GSUBR, SCM_DEFINE, SCM_PRIMITIVE_GENERIC):
(SCM_DEFINE_PUBLIC, SCM_PROC, SCM_REGISTER_PROC, SCM_GPROC): Move
here.
* libguile/alist.c:
* libguile/array-map.c:
* libguile/arrays.c:
* libguile/async.c:
* libguile/atomic.c:
* libguile/backtrace.c:
* libguile/bitvectors.c:
* libguile/boolean.c:
* libguile/bytevectors.c:
* libguile/chars.c:
* libguile/continuations.c:
* libguile/control.c:
* libguile/debug-malloc.c:
* libguile/debug.c:
* libguile/deprecation.c:
* libguile/dynl.c:
* libguile/eq.c:
* libguile/error.c:
* libguile/error.h:
* libguile/eval.c:
* libguile/evalext.c:
* libguile/expand.c:
* libguile/extensions.c:
* libguile/fdes-finalizers.c:
* libguile/feature.c:
* libguile/filesys.c:
* libguile/finalizers.c:
* libguile/fluids.c:
* libguile/foreign-object.c:
* libguile/foreign.c:
* libguile/fports.c:
* libguile/frames.c:
* libguile/gc.c:
* libguile/generalized-arrays.c:
* libguile/generalized-vectors.c:
* libguile/gettext.c:
* libguile/guardians.c:
* libguile/hash.c:
* libguile/hashtab.c:
* libguile/hooks.c:
* libguile/i18n.c:
* libguile/instructions.c:
* libguile/intrinsics.c:
* libguile/ioext.c:
* libguile/keywords.c:
* libguile/list.c:
* libguile/load.c:
* libguile/loader.c:
* libguile/macros.c:
* libguile/memoize.c:
* libguile/modules.c:
* libguile/net_db.c:
* libguile/numbers.c:
* libguile/objprop.c:
* libguile/pairs.c:
* libguile/poll.c:
* libguile/ports.c:
* libguile/posix.c:
* libguile/print.c:
* libguile/procs.c:
* libguile/programs.c:
* libguile/promises.c:
* libguile/r6rs-ports.c:
* libguile/random.c:
* libguile/rdelim.c:
* libguile/read.c:
* libguile/regex-posix.c:
* libguile/rw.c:
* libguile/scmsigs.c:
* libguile/simpos.c:
* libguile/smob.c:
* libguile/socket.c:
* libguile/sort.c:
* libguile/srcprop.c:
* libguile/srfi-1.c:
* libguile/srfi-13.c:
* libguile/srfi-14.c:
* libguile/srfi-4.c:
* libguile/srfi-60.c:
* libguile/stackchk.c:
* libguile/stacks.c:
* libguile/stime.c:
* libguile/strings.c:
* libguile/strorder.c:
* libguile/strports.c:
* libguile/struct.c:
* libguile/symbols.c:
* libguile/syntax.c:
* libguile/threads.c:
* libguile/throw.c:
* libguile/trees.c:
* libguile/unicode.c:
* libguile/values.c:
* libguile/variable.c:
* libguile/vectors.c:
* libguile/version.c:
* libguile/vm.c:
* libguile/vports.c:
* libguile/weak-table.c:
* libguile/weak-vector.c: Add gsubr includes.
2018-06-20 09:04:55 +02:00
Andy Wingo
5f50309448
Remove includes of validate.h.
...
* guile-readline/readline.c:
* libguile/alist.c:
* libguile/array-map.c:
* libguile/arrays.c:
* libguile/async.c:
* libguile/atomic.c:
* libguile/backtrace.c:
* libguile/boolean.c:
* libguile/bytevectors.c:
* libguile/chars.c:
* libguile/continuations.c:
* libguile/debug.c:
* libguile/dynl.c:
* libguile/eq.c:
* libguile/error.c:
* libguile/eval.c:
* libguile/evalext.c:
* libguile/expand.c:
* libguile/feature.c:
* libguile/filesys.c:
* libguile/fluids.c:
* libguile/fports.c:
* libguile/gc-malloc.c:
* libguile/gc.c:
* libguile/goops.c:
* libguile/goops.h:
* libguile/guardians.c:
* libguile/hash.c:
* libguile/hashtab.c:
* libguile/hashtab.h:
* libguile/hooks.c:
* libguile/i18n.c:
* libguile/ioext.c:
* libguile/keywords.c:
* libguile/list.c:
* libguile/load.c:
* libguile/macros.c:
* libguile/memoize.c:
* libguile/modules.h:
* libguile/net_db.c:
* libguile/numbers.c:
* libguile/pairs.c:
* libguile/poll.c:
* libguile/ports.c:
* libguile/posix.c:
* libguile/print.c:
* libguile/procprop.c:
* libguile/procs.c:
* libguile/promises.c:
* libguile/r6rs-ports.c:
* libguile/random.c:
* libguile/rdelim.c:
* libguile/read.c:
* libguile/regex-posix.c:
* libguile/rw.c:
* libguile/scmsigs.c:
* libguile/script.c:
* libguile/simpos.c:
* libguile/socket.c:
* libguile/sort.c:
* libguile/srcprop.c:
* libguile/srfi-1.c:
* libguile/srfi-4.c:
* libguile/srfi-60.c:
* libguile/stacks.c:
* libguile/stime.c:
* libguile/strings.c:
* libguile/strorder.c:
* libguile/strports.c:
* libguile/struct.c:
* libguile/symbols.c:
* libguile/syntax.c:
* libguile/threads.c:
* libguile/throw.c:
* libguile/trees.c:
* libguile/unicode.c:
* libguile/values.c:
* libguile/variable.c:
* libguile/vectors.c:
* libguile/vports.c:
* libguile/weak-set.c:
* libguile/weak-table.c:
* libguile/weak-vector.c:
* libguile.h: Remove validate.h include.
2018-06-18 10:50:23 +02:00
BT Templeton
9348168ed5
add `nil?' primitive
...
* libguile/boolean.c (scm_nil_p): New function.
* libguile/vm-i-scheme.c (nilp, not_nilp):
* libguile/vm-i-system.c (br_if_nil, br_if_not_nil): New instructions.
Renumber other ops.
* libguile/_scm.h (SCM_OBJCODE_MINOR_VERSION): Increment.
* module/language/assembly/compile-bytecode.scm (compile-bytecode): Add
support for writing `br-if-nil' and `br-if-not-nil' instructions.
* module/language/assembly/disassemble.scm (code-annotation): Add
`br-if-nil' and `br-if-not-nil' to the list of branch instructions.
* module/language/tree-il/compile-glil.scm: Add `nil?' to
`*primcall-ops*'.
(flatten): Use the new branch instructions for `nil?' conditionals.
* module/language/tree-il/primitives.scm: Add `nil?' to
`*interesting-primitive-names*', `*effect-free-primitives', and
`*effect+exception-free-primitives*'.
2012-02-03 18:53:38 -05:00
Andy Wingo
210c0325d3
allow iflags to be constant expressions with typing-strictness==2
...
* libguile/tags.h (SCM_MAKE_ITAG8_BITS): New helper, produces a
scm_t_bits instead of a SCM, because SCM_UNPACK is not a constant
expression with SCM_DEBUG_TYPING_STRICTNESS==2.
(SCM_MAKIFLAG_BITS): Remove SCM_MAKIFLAG, and replace with this, which
returns bits.
(SCM_BOOL_F_BITS, SCM_ELISP_NIL_BITS, SCM_EOL_BITS, SCM_BOOL_T_BITS):
(SCM_UNSPECIFIED_BITS, SCM_UNDEFINED_BITS, SCM_EOF_VAL_BITS):
(SCM_UNBOUND_BITS): New definitions. Defined SCM_BOOL_F, etc in terms
of them.
(SCM_XXX_ANOTHER_BOOLEAN_DONT_USE_0):
(SCM_XXX_ANOTHER_BOOLEAN_DONT_USE_1):
(SCM_XXX_ANOTHER_BOOLEAN_DONT_USE_2):
(SCM_XXX_ANOTHER_LISP_FALSE_DONT_USE): Be bits instead of SCM values.
(SCM_BITS_DIFFER_IN_EXACTLY_ONE_BIT_POSITION):
(SCM_BITS_DIFFER_IN_EXACTLY_TWO_BIT_POSITIONS): Rename from
SCM_VALUES_DIFFER_..., and take unpacked bits as the args.
* libguile/boolean.c: Update verify block to use
SCM_BITS_DIFFER_IN_EXACTLY_TWO_BIT_POSITIONS et al.
* libguile/debug.c (scm_debug_opts):
* libguile/print.c (scm_print_opts):
* libguile/read.c (scm_read_opts): Use iflags bits for initializers.
* libguile/hash.c (scm_hasher): Use _BITS for iflags as case labels.
* libguile/pairs.c: Nil/null compile-time check uses
SCM_ELISP_NIL_BITS.
2011-05-13 13:48:07 +02:00
Andy Wingo
cd038da546
remove libguile/lang.h, deprecate %nil (in favor of #nil)
...
* libguile/Makefile.am:
* libguile/init.c:
* libguile/lang.c:
* libguile/lang.h: Remove lang.c and lang.h.
* libguile/pairs.h (SCM_NIL_P, SCM_NULL_OR_NIL_P): Moved here.
* module/ice-9/deprecated.scm (%nil): %nil definition moved here.
* libguile/alist.c:
* libguile/async.c:
* libguile/backtrace.c:
* libguile/boolean.c:
* libguile/dynl.c:
* libguile/eval.c:
* libguile/filesys.c:
* libguile/fluids.c:
* libguile/list.c:
* libguile/load.c:
* libguile/options.c:
* libguile/posix.c:
* libguile/print.c:
* libguile/promises.c:
* libguile/sort.c:
* libguile/throw.c:
* libguile/trees.c:
* libguile/vectors.c:
* libguile/vm.c:
* libguile/weaks.c:
* srfi/srfi-1.c: <libguile/lang.h> references removed.
2010-04-09 14:26:31 +02:00
Andy Wingo
d38b431ace
nil is false, whee
...
* libguile/boolean.h (scm_is_false): Recognize nil as false, by default.
(scm_is_bool): Recognize nil as a boolean.
* libguile/boolean.c (scm_not, scm_boolean, scm_to_bool, scm_is_bool):
Adapt to treat nil as false.
* libguile/vm-i-system.c (br-if, br-if-not): Just use scm_is_false
instead of specifically mentioning nil.
2010-03-30 10:31:27 +02:00
Mark H Weaver
f60c2c4e10
Renumber IFLAGSs so the first 8 are reserved for lisp booleans.
...
This enables more efficient implementations of several operations,
e.g. scm_is_lisp_bool, canonicalize_boolean, fast_boolean_not,
converting SCM booleans to C booleans, etc.
* libguile/tags.h: Renumber IFLAGs.
* libguile/print.c: Renumber iflagnames to match.
* libguile/boolean.c:
* libguile/boolean.h:
SCM_XXX_ANOTHER_BOOLEAN_DONT_USE --> SCM_XXX_ANOTHER_BOOLEAN_DONT_USE_0
2010-03-28 14:34:19 +02:00
Ludovic Courtès
baedef98ee
Reinstate `scm_is_bool ()' as a function.
...
* libguile/boolean.c (scm_is_bool): New function.
* libguile/boolean.h (scm_is_bool): New function declaration.
2010-01-19 21:41:41 +01:00
Mark H Weaver
45f4cbdf12
the cube of lisp booleans (#f nil () #t)
...
* Renumbers the IFLAG constants.
* Adds several macros related to boolean type tests, null tests, and
boolean-truth testing (including lisp-style boolean-truth tests).
* Adds compile-time checks to verify the necessary IFLAG numbering
properties needed for the checks to work properly.
* Changes some existing code to use the new optimized macros, without
changing the semantics of the code at all (except that scm_is_bool
is changed from a function to a macro).
I added the following macros, whose names explicitly state how %nil
should be handled. See the comments in the patch for more information
about these.
scm_is_false_assume_not_lisp_nil scm_is_true_assume_not_lisp_nil
scm_is_false_and_not_lisp_nil scm_is_true_or_lisp_nil
scm_is_false_or_lisp_nil scm_is_true_and_not_lisp_nil
scm_is_lisp_false scm_is_lisp_true
scm_is_null_assume_not_lisp_nil
scm_is_null_and_not_lisp_nil
scm_is_null_or_lisp_nil
scm_is_bool_and_not_lisp_nil
scm_is_bool_or_lisp_nil
The following already-existing macros are defined as aliases, such
that their semantics is unchanged (although scm_is_bool used to be a
function and is now a macro).
scm_is_null --> scm_is_null_and_not_lisp_nil
scm_is_false --> scm_is_false_and_not_lisp_nil
scm_is_true --> scm_is_true_or_lisp_nil
scm_is_bool --> scm_is_bool_and_not_lisp_nil
(I still believe that these should be changed to versions that handle
%nil properly, but await approval on that point, so these patches do
not make those changes)
Also, if the preprocessor macro SCM_ENABLE_ELISP is not true (this
macro already existed and was used in lang.h), all overheads
associated with %nil handling are eliminated from the above macros.
* libguile/tags.h (SCM_BOOL_F, SCM_BOOL_T, SCM_UNSPECIFIED)
(SCM_UNDEFINED, SCM_UNBOUND, SCM_ELISP_NIL): Renumber, so that a
number of important distinctions (false versus true, end-of-list, etc)
can be made by masking a single bit. Also define a number of
build-time tests to assert that this condition holds.
* libguile/boolean.h (scm_is_false_and_not_nil, scm_is_true_or_nil)
(scm_is_false_assume_not_nil, scm_is_true_assume_not_nil):
(scm_is_false_or_nil, scm_is_true_and_not_nil)
(scm_is_bool_or_nil, scm_is_bool_and_not_nil): New exciting macros to
test certain boolean/end-of-list properties.
(scm_is_false, scm_is_true): Use a restrictive definition, where only
SCM_BOOL_F is false. Should probably change in the future.
(scm_is_bool): Incompatible change: changed to be a macro. Was a
function before. Probably should allow nil as a boolean, but that will
be for a later patch.
(scm_is_lisp_false, scm_is_lisp_true): New macros, implementing the
standard Lisp boolean predicates, where '() is actually false.
* libguile/eval.i.c (CEVAL): Fix a number of false-or-nil and similar
tests to use the new macros.
* libguile/lang.h (SCM_NULL_OR_NIL_P): Use scm_is_null_or_nil.
* libguile/pairs.c: Add a compile-time check that null and nil differ by
only one bit.
* libguile/pairs.h (scm_is_null_and_not_nil, scm_is_null_assume_not_nil)
(scm_is_null_or_nil): New exciting macros!
(scm_is_null): Just be scm_is_null_and_not_nil, for now.
* libguile/print.c: Adapt to the reordering, and print suitably nasty
things for the not-to-be-used values.
2009-10-27 23:25:02 +01:00
Neil Jerram
53befeb700
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/*
)
2009-06-17 00:22:09 +01:00
Ludovic Courtès
dbb605f575
Include <config.h> in all C files; use #ifdef HAVE_CONFIG_H' rather than
#if'.
2008-09-13 15:35:27 +02:00
Kevin Ryde
2b829bbb3d
merge from 1.8 branch
2006-04-17 00:05:42 +00:00
Marius Vollmer
92205699d0
The FSF has a new address.
2005-05-23 19:57:22 +00:00
Marius Vollmer
1fe56d60fd
(scm_is_bool): Fix typo.
...
* 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.
2004-07-06 10:25:37 +00:00
Marius Vollmer
3a684cc6c9
(scm_is_true, scm_is_false, scm_from_bool, scm_to_bool): New.
2004-07-05 17:13:39 +00:00
Marius Vollmer
73be1d9e8e
Changed license terms to the plain LGPL thru-out.
2003-04-05 19:15:35 +00:00
Thien-Thi Nguyen
a6b844c224
Retire inclusion guard macro SCM_MAGIC_SNARFER.
2002-03-14 03:47:43 +00:00
Neil Jerram
c96d76b88d
* First batch of libguile changes for Elisp support.
...
* Fixed a few typos.
* Minor rationalization of macros relating to source breakpoints.
2002-01-22 23:31:39 +00:00
Martin Grabmüller
58ade1022c
* alist.c, arbiters.c, async.h, backtrace.h, boolean.c, chars.c,
...
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.
2001-07-19 21:08:49 +00:00
Thien-Thi Nguyen
a06e3a75b2
Remove "face-lift" comment.
2001-07-09 07:36:48 +00:00
Keisuke Nishida
783e777478
Remove #include <stdio.h>. Add #include <string.h>.
2001-03-09 23:33:41 +00:00
Marius Vollmer
8dc9439fc6
* alist.c, arbiters.c, async.c, backtrace.c, boolean.c, chars.c,
...
continuations.c, debug-malloc.c, debug.c, dynl.c, dynwind.c,
environments.c, eq.c, error.c, eval.c, evalext.c, feature.c,
filesys.c, fluids.c, fports.c, gc.c, goops.c, guardians.c, hash.c,
hashtab.c, hooks.c, ioext.c, iselect.c, keywords.c, lang.c,
list.c, load.c, macros.c, modules.c, net_db.c, numbers.c,
objects.c, objprop.c, options.c, pairs.c, ports.c, posix.c,
print.c, procprop.c, procs.c, properties.c, ramap.c, random.c,
read.c, regex-posix.c, root.c, scmsigs.c, script.c, simpos.c,
socket.c, sort.c, srcprop.c, stackchk.c, stacks.c, stime.c,
strings.c, strop.c, strorder.c, strports.c, struct.c, symbols.c,
tag.c, threads.c, throw.c, unif.c, variable.c, vectors.c,
version.c, vports.c, weaks.c: Makes sure the snarfer output
inclusion is disabled when the snarfer is run on the file. Thanks
to Lars J. Aas!
* Makefile.am: Install guile-procedures.txt in version-specific
directory to enable multiple installed guile versions. Suggested
by Karl M. Hegbloom <karlheg@debian.org, patch by Matthias Koeppe.
2000-11-17 16:25:05 +00:00
Neil Jerram
cdbc74184f
* Docstring fixes - adding texinfo markup and removing extraneous trailing newlines.
2000-08-18 09:30:54 +00:00
Mikael Djurfeldt
f2c9fcb07e
Updated copyrights
2000-06-12 12:28:24 +00:00
Mikael Djurfeldt
a059974535
* Makefile.am (DEFS): Added. automake adds -I options to DEFS,
...
and we don't want that.
(INCLUDES): Removed all -I options except for the root source
directory and the root build directory.
* *.*: Change includes so that they always use the "prefixes"
libguile/, qt/, guile-readline/, or libltdl/.
(Thanks to Tim Mooney.)
2000-04-21 14:16:44 +00:00
Dirk Herrmann
fbd485ba49
Don't use C operators == and != to compare SCM values.
2000-03-29 16:22:57 +00:00
Michael Livshin
89e00824a0
* *.[hc]: add Emacs magic at the end of file, to ensure GNU
...
indentation style.
2000-03-19 19:01:16 +00:00
Greg J. Badros
b6791b2e94
* error.h, error.c: Added `scm_wrong_type_arg_msg' to support
...
displaying the expected type. Use SCM_LISTn in a couple places
instead of scm_cons-ing by hand.
* __scm.h: Added SCM_ASSERT_TYPE macro.
* validate.h, scm_validate.h: Added the former, as a renamed
version of the latter with SCM_ASSERT_TYPE used in
SCM_MAKE_VALIDATE (instead of just SCM_ASSERT)
* Makefile.am: Rename scm_validate.h to validate.h.
* *.c, *.h: Include validate.h, not scm_validate.h (old name's
prefix was superfluous).
2000-03-03 00:09:54 +00:00
Greg J. Badros
da4a1dbab4
* sort.c: typo in comment fixed.
...
* keywords.c: Added documentation.
* guardians.c: Added documentation (could be better).
* gc.c: Added docs for gc-set-debug-check-freelist.
* eq.c: Added docs for eq?, eqv? equal? abridged from R4RS.
* boolean.c: Added docs for `not', `boolean?' (by hand).
2000-01-26 01:17:16 +00:00
Greg J. Badros
3b3b36ddb7
* *.[ch]: Whitespace changes -- added space after SCM_VALIDATE_*
...
macros and SCM_DEFINE macros to match GNU coding standards.
2000-01-05 19:25:37 +00:00
Greg J. Badros
a1ec69163d
*.[ch]: Replace GUILE_PROC w/ SCM_DEFINE.
2000-01-05 19:05:23 +00:00
Greg J. Badros
717050c8d5
Remove leading whitespace before empty docstrings.
1999-12-13 00:44:10 +00:00
Greg J. Badros
156dcb091b
* *.c, srcprop.h: Use SCM_BOOL(f) instead of (f? SCM_BOOL_T:
...
SCM_BOOL_F) and use SCM_NEGATE_BOOL(f) instead of (f? SCM_BOOL_F:
SCM_BOOL_T).
1999-12-12 19:24:29 +00:00
Greg J. Badros
1bbd0b849f
* *.c: Pervasive software-engineering-motivated rewrite of
...
function headers and argument checking. Switched SCM_PROC,
SCM_PROC1 macros to be GUILE_PROC, GUILE_PROC1 (may change names
later, but was useful to keep old versions around while migrate)
that has docstrings and argument lists embedded in the GUILE_PROC
macro invocations that expand into a function header. Use lots of
new SCM_VALIDATE_* macros to simplify error checking and reduce
tons of redundancy. This is very similar to what I did for Scwm.
Note that none of the extraction of the docstrings, nor software
engineering checks of Scwm is yet added to Guile. I'll work on
that tomorrow, I expect.
* Makefile.am: Added scm_validate.h to modinclude_HEADERS.
* chars.c: Added docstrings for the primitives defined in here.
* snarf.h: Added GUILE_PROC, GUILE_PROC1. Added
SCM_REGISTER_PROC to be like old SCM_PROC, though old SCM_PROC
still remains for now. Changed naming convention for the s_foo
string name of the primitive to be s_scm_foo for ease of use with
the macro.
* scm_validate.h: Lots of new SCM_VALIDATE macros to simplify
argument checking through guile. Maybe some of these should be
folded into the header file for the types they check, but for now
it was easiest to just stick them all in one place.
1999-12-12 02:36:16 +00:00
Jim Blandy
82892beda5
* Lots of files: New address for FSF.
1997-05-26 22:34:48 +00:00
Jim Blandy
1cc91f1b29
* __scm.h, alist.c, alist.h, append.c, append.h, appinit.c,
...
arbiters.c, arbiters.h, async.c, async.h, boolean.c, boolean.h,
chars.c, chars.h, continuations.c, continuations.h, debug.c,
debug.h, dynwind.c, dynwind.h, eq.c, eq.h, error.c, eval.c,
eval.h, extchrs.c, extchrs.h, fdsocket.c, fdsocket.h, filesys.c,
filesys.h, fports.c, fports.h, gc.c, gdb_interface.h, gdbint.c,
gdbint.h, genio.c, genio.h, gscm.c, gscm.h, gsubr.c, gsubr.h,
hash.c, hash.h, hashtab.c, hashtab.h, init.c, ioext.c, ioext.h,
kw.c, kw.h, libguile.h, mallocs.c, mallocs.h, markers.c,
markers.h, mbstrings.c, mbstrings.h, numbers.c, numbers.h,
objprop.c, objprop.h, options.c, options.h, pairs.c, pairs.h,
ports.c, ports.h, posix.c, posix.h, print.c, print.h, procprop.c,
procprop.h, procs.c, procs.h, ramap.c, ramap.h, read.c, read.h,
root.c, scmsigs.c, scmsigs.h, sequences.c, sequences.h, simpos.c,
simpos.h, smob.c, socket.c, socket.h, srcprop.c, srcprop.h,
stackchk.c, stackchk.h, stime.c, stime.h, strings.c, strings.h,
strop.c, strop.h, strorder.c, strorder.h, strports.c, strports.h,
struct.c, struct.h, symbols.c, symbols.h, tag.c, tag.h, unif.c,
unif.h, variable.c, variable.h, vectors.c, vectors.h, version.c,
version.h, vports.c, vports.h, weaks.c, weaks.h: Use SCM_P to
declare functions with prototypes. (Patch thanks to Marius
Vollmer.)
1996-10-14 01:33:50 +00:00
Jim Blandy
20e6290e38
C files should #include only the header files they need, not
...
libguile.h (which #includes all the header files); the pointless
recompilation was wasting my time.
* Makefile.in (all .o dependency lists): Regenerated.
* libguile.h: Don't try to get a definition for size_t here...
* __scm.h: Do it here.
* _scm.h: Since this is the internal libguile header, put things
here that all (or a majority) of the libguile files will want.
Don't #include <libguile.h> here; that generates dependencies on
way too much. Instead, get "__scm.h", "error.h", "pairs.h",
"list.h", "gc.h", "gsubr.h", "procs.h", "numbers.h", "symbols.h",
"boolean.h", "strings.h", "vectors.h", "root.h", "ports.h", and
"async.h".
* alist.c: Get "eq.h", "list.h", "alist.h".
* append.c: Get "append.h", "list.h".
* arbiters.c: Get "arbiters.h", "smob.h".
* async.c: Get "async.h", "smob.h", "throw.h", "eval.h".
* boolean.c: Get "boolean.h".
* chars.c: Get "chars.h".
* continuations.c: Get "continuations.h", "dynwind.h", "debug.h",
"stackchk.h".
* debug.c: Get "debug.h", "feature.h", "read.h", "strports.h",
"continuations.h", "alist.h", "srcprop.h", "procprop.h", "smob.h",
"genio.h", "throw.h", "eval.h".
* dynwind.c: Get "dynwind.h", "alist.h", "eval.h".
* eq.c: Get "eq.h", "unif.h", "smob.h", "strorder.h",
"stackchk.h".
* error.c: Get "error.h", "throw.h", "genio.h", "pairs.h".
* eval.c: Get "eval.h", "stackchk.h", "srcprop.h", "debug.h",
"hashtab.h", "procprop.h", "markers.h", "smob.h", "throw.h",
"continuations.h", "eq.h", "sequences.h", "alist.h", "append.h",
"debug.h".
* fdsocket.c: Get "fdsocket.h", "unif.h", "filesys.h".
* feature.c: Get "feature.h".
* files.c: Get "files.h".
* filesys.c: Get "filesys.h", "smob.h", "genio.h".
* fports.c: Get "fports.h", "markers.h".
* gc.c: Get "async.h", "unif.h", "smob.h", "weaks.h",
"genio.h", "struct.h", "stackchk.h", "stime.h".
* gdbint.c: Get "gdbint.h", "chars.h", "eval.h", "print.h",
"read.h", "strports.h", "tag.h".
* genio.c: Get "genio.h", "chars.h".
* gsubr.c: Get "gsubr.h", "genio.h".
* hash.c: Get "hash.h", "chars.h".
* hashtab.c: Get "hashtab.h", "eval.h", "hash.h", "alist.h".
* init.c: Get everyone who has an scm_init_mumble function:
"weaks.h", "vports.h", "version.h", "vectors.h", "variable.h",
"unif.h", "throw.h", "tag.h", "symbols.h", "struct.h",
"strports.h", "strorder.h", "strop.h", "strings.h", "stime.h",
"stackchk.h", "srcprop.h", "socket.h", "simpos.h", "sequences.h",
"scmsigs.h", "read.h", "ramap.h", "procs.h", "procprop.h",
"print.h", "posix.h", "ports.h", "pairs.h", "options.h",
"objprop.h", "numbers.h", "mbstrings.h", "mallocs.h", "load.h",
"list.h", "kw.h", "ioext.h", "hashtab.h", "hash.h", "gsubr.h",
"gdbint.h", "gc.h", "fports.h", "filesys.h", "files.h",
"feature.h", "fdsocket.h", "eval.h", "error.h", "eq.h",
"dynwind.h", "debug.h", "continuations.h", "chars.h", "boolean.h",
"async.h", "arbiters.h", "append.h", "alist.h".
* ioext.c: Get "ioext.h", "fports.h".
* kw.c: Get "kw.h", "smob.h", "mbstrings.h", "genio.h".
* list.c: Get "list.h", "eq.h".
* load.c: Get "load.h", "eval.h", "read.h", "fports.h".
* mallocs.c: Get "smob.h", "genio.h".
* markers.c: Get "markers.h".
* mbstrings.c: Get "mbstrings.h", "read.h", "genio.h", "unif.h",
"chars.h".
* numbers.c: Get "unif.h", "genio.h".
* objprop.c: Get "objprop.h", "weaks.h", "alist.h", "hashtab.h".
* options.c: Get "options.h".
* ports.c: Get "ports.h", "vports.h", "strports.h", "fports.h",
"markers.h", "chars.h", "genio.h".
* posix.c: Get "posix.h", "sequences.h", "feature.h", "unif.h",
"read.h", "scmsigs.h", "genio.h", "fports.h".
* print.c: Get "print.h", "unif.h", "weaks.h", "read.h",
"procprop.h", "eval.h", "smob.h", "mbstrings.h", "genio.h",
"chars.h".
* procprop.c: Get "procprop.h", "eval.h", "alist.h".
* procs.c: Get "procs.h".
* ramap.c: Get "ramap.h", "feature.h", "eval.h", "eq.h",
"chars.h", "smob.h", "unif.h".
* read.c: Get "alist.h", "kw.h", "mbstrings.h", "unif.h",
"eval.h", "genio.h", "chars.h".
* root.c: Get "root.h", "stackchk.h".
* scmsigs.c: Get "scmsigs.h".
* sequences.c: Get "sequences.h".
* simpos.c: Get "simpos.h", "scmsigs.h".
* smob.c: Get "smob.h".
* socket.c: Get "socket.h", "feature.h".
* srcprop.c: Get "srcprop.h", "weaks.h", "hashtab.h", "debug.h",
"alist.h", "smob.h".
* stackchk.c: Get "stackchk.h", "genio.h".
* stime.c: Get "stime.h"."libguile/continuations.h".
* strings.c: Get "strings.h", "chars.h".
* strop.c: Get "strop.h", "chars.h".
* strorder.c: Get "strorder.h", "chars.h".
* strports.c: Get "strports.h", "print.h", "eval.h", "unif.h".
* struct.c: Get "struct.h", "chars.h".
* symbols.c: Get "symbols.h", "mbstrings.h", "alist.h",
"variable.h", "eval.h", "chars.h".
* tag.c: Get "tag.h", "struct.h", "chars.h".
* throw.c: Get "throw.h", "continuations.h", "debug.h",
"dynwind.h", "eval.h", "alist.h", "smob.h", "genio.h".
* unif.c: Get "unif.h", "feature.h", "strop.h", "sequences.h",
"smob.h", "genio.h", "eval.h", "chars.h".
* variable.c: Get "variable.h", "smob.h", "genio.h".
* vectors.c: Get "vectors.h", "eq.h".
* version.c: Get "version.h".
* vports.c: Get "vports.h", "fports.h", "chars.h", "eval.h".
* weaks.c: Get "weaks.h".
1996-09-10 02:26:07 +00:00
Jim Blandy
0f2d19dd46
maintainer changed: was lord, now jimb; first import
1996-07-25 22:56:11 +00:00