1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-04-29 19:30:36 +02:00
Commit graph

187 commits

Author SHA1 Message Date
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
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
3c48c87784 Devolve variable.h from _scm.h.
* libguile/_scm.h: Remove variable.h.
* libguile/backtrace.c:
* libguile/debug.c:
* libguile/dynstack.c:
* libguile/dynwind.c:
* libguile/eval.c:
* libguile/evalext.c:
* libguile/expand.c:
* libguile/feature.c:
* libguile/fluids.c:
* libguile/foreign-object.c:
* libguile/fports.c:
* libguile/frames.c:
* libguile/goops.c:
* libguile/i18n.c:
* libguile/load.c:
* libguile/macros.c:
* libguile/memoize.c:
* libguile/ports.c:
* libguile/print.c:
* libguile/programs.c:
* libguile/random.c:
* libguile/read.c:
* libguile/scmsigs.c:
* libguile/srfi-4.c:
* libguile/strports.c:
* libguile/syntax.c:
* libguile/threads.c:
* libguile/throw.c: Add variable.h.
2018-06-20 11:00:29 +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
730cfd80e2 Devolve pairs.h
* libguile/_scm.h: Remove pairs.h.
* libguile/alist.c:
* libguile/array-handle.c:
* libguile/array-map.c:
* libguile/arrays.c:
* libguile/async.c:
* libguile/bitvectors.c:
* libguile/bytevectors.c:
* libguile/chars.c:
* libguile/continuations.c:
* libguile/control.c:
* libguile/debug.c:
* libguile/deprecation.c:
* libguile/dynwind.c:
* libguile/eq.c:
* libguile/eval.c:
* libguile/evalext.c:
* libguile/expand.c:
* libguile/fdes-finalizers.c:
* libguile/feature.c:
* libguile/filesys.c:
* libguile/fluids.c:
* libguile/foreign.c:
* libguile/fports.c:
* libguile/gc.c:
* libguile/generalized-arrays.c:
* libguile/goops.c:
* libguile/guardians.c:
* libguile/hash.c:
* libguile/hashtab.c:
* libguile/hooks.c:
* libguile/i18n.c:
* libguile/instructions.c:
* libguile/ioext.c:
* libguile/keywords.c:
* libguile/list.c:
* libguile/load.c:
* libguile/loader.c:
* libguile/memoize.c:
* libguile/modules.c:
* libguile/net_db.c:
* libguile/numbers.c:
* libguile/objprop.c:
* libguile/options.c:
* libguile/ports-internal.h:
* libguile/ports.c:
* libguile/posix.c:
* libguile/print.c:
* libguile/print.h:
* libguile/procprop.c:
* libguile/programs.c:
* libguile/random.c:
* libguile/rdelim.c:
* libguile/read.c:
* libguile/regex-posix.c:
* libguile/scmsigs.c:
* libguile/script.c:
* libguile/socket.c:
* libguile/sort.c:
* libguile/srcprop.c:
* libguile/srfi-1.c:
* libguile/srfi-13.c:
* libguile/srfi-14.c:
* libguile/srfi-60.c:
* libguile/stacks.c:
* libguile/stime.c:
* libguile/strings.c:
* libguile/strorder.c:
* libguile/struct.c:
* libguile/symbols.c:
* libguile/threads.c:
* libguile/throw.c:
* libguile/trees.c:
* libguile/values.c:
* libguile/vectors.c:
* libguile/vm.c:
* libguile/weak-list.h:
* libguile/weak-set.c:
* libguile/weak-table.c:
* libguile/weak-vector.c: Add pairs.h.
2018-06-18 22:03:13 +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
Andy Wingo
68d9780ce4 Remove errno.h include from _scm.h.
* libguile/_scm.h: Remove errno.h include.
* libguile/bytevectors.c:
* libguile/debug.c:
* libguile/finalizers.c:
* libguile/loader.c:
* libguile/poll.c:
* libguile/strings.c:
* libguile/threads.c:
* libguile/vm.c: Add errno.h include.  Sort includes as needed.
2018-06-17 19:46:33 +02:00
Andy Wingo
dc2a560264 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).
2016-11-21 23:09:21 +01:00
Andy Wingo
399379bf25 Remove critical section in scm_debug_options
* libguile/debug.c (scm_debug_options): Remove critical section.  There
  is no memory corruption hazard and racing callers to debug options
  won't produce sensible results anyway; or anyway they will be the same
  as racing vector-set!.
2016-11-01 23:07:56 +01:00
Mark H Weaver
856d318a9f Merge branch 'stable-2.0'
Conflicts:
	benchmark-suite/benchmarks/ports.bm
	libguile/async.h
	libguile/bytevectors.c
	libguile/foreign.c
	libguile/gsubr.c
	libguile/srfi-1.c
	libguile/vm-engine.h
	libguile/vm-i-scheme.c
	module/Makefile.am
	module/language/tree-il/analyze.scm
	module/language/tree-il/peval.scm
	module/scripts/compile.scm
	module/scripts/disassemble.scm
	test-suite/tests/asm-to-bytecode.test
	test-suite/tests/peval.test
	test-suite/tests/rdelim.test
2014-09-30 03:50:47 -04:00
Eli Zaretskii
5102fc3790 Provide a more reasonable default value for stack limit on MS-Windows.
* libguile/debug.c (init_stack_limit) [__MINGW32__]: Use
  VirtualQuery to compute the stack limit on MS-Windows.
2014-07-03 19:26:21 +03:00
Andy Wingo
dc7a33fa87 Merge commit '60617d819d'
Conflicts:
	libguile/continuations.c
	libguile/eval.c
	libguile/goops.c
	libguile/instructions.c
2014-02-07 15:03:17 +01:00
Mark H Weaver
60617d819d Fix thread-unsafe lazy initializations.
* libguile/backtrace.c (print_exception_var): New static variable.
  (init_print_exception_var): New static function.
  (scm_print_exception): Remove thread-unsafe lazy initialization.
  Call 'init_print_exception_var' using 'scm_i_pthread_once'.
  Use 'print_exception_var'.

* libguile/continuations.c (call_cc): New static variable.
  (init_call_cc): New static function.
  (scm_i_call_with_current_continuation): Remove thread-unsafe lazy
  initialization.  Call 'init_call_cc' using 'scm_i_pthread_once'.

* libguile/debug.c (local_eval_var): New static variable.
  (init_local_eval_var): New static function.
  (scm_local_eval): Remove lazy initialization using mutexes.
  Call 'init_local_eval_var' using 'scm_i_pthread_once'.
  Use 'scm_variable_ref' instead of 'SCM_VARIABLE_REF'.

* libguile/eval.c (map_var, for_each_var): New static variables.
  (init_map_var, init_for_each_var): New static functions.
  (scm_map, scm_for_each): Remove thread-unsafe lazy initializations.
  Call 'init_map_var' (or 'init_for_each_var') using 'scm_i_pthread_once'.
  Use 'map_var' (or 'for_each_var').

* libguile/frames.c (frame_arguments_var): New static variable.
  (init_frame_arguments_var): New static function.
  (scm_frame_arguments): Remove thread-unsafe lazy initialization.
  Call 'init_frame_arguments_var' using 'scm_i_pthread_once'.
  Use 'frame_arguments_var'.  Use 'scm_variable_ref' instead of
  'SCM_VARIABLE_REF'.

* libguile/goops.c (delayed_compile_var): New static variable.
  (init_delayed_compile_var): New static function.
  (make_dispatch_procedure): Remove thread-unsafe lazy initialization.
  Call 'init_delayed_compile_var' using 'scm_i_pthread_once'.
  Use 'delayed_compile_var'.  Use 'scm_variable_ref' instead of
  'SCM_VARIABLE_REF'.

* libguile/instructions.c (instructions_by_name): New static variable.
  (init_instructions_by_name): New static function.
  (scm_lookup_instruction_by_name): Remove thread-unsafe lazy
  initialization.  Call 'init_instructions_by_name' using
  'scm_i_pthread_once'.

* libguile/ports.c (current_warning_port_var)
  (current_warning_port_once): New static variables.
  (init_current_warning_port_var): New static function.
  (scm_current_warning_port): Remove lazy initialization using mutexes.
  Call 'init_current_warning_port_var' using 'scm_i_pthread_once'.
  Use 'current_warning_port_var'.
  (scm_set_current_warning_port): Remove thread-unsafe lazy initialization.
  Call 'init_current_warning_port_var' using 'scm_i_pthread_once'.
  Use 'current_warning_port_var'.

* libguile/strings.c (null_stringbuf): New static variable.
  (init_null_stringbuf): New static function.
  (scm_i_make_string): Remove thread-unsafe lazy initialization.
  Call 'init_null_stringbuf' using 'scm_i_pthread_once'.

* libguile/strports.c (eval_string_var, k_module): New static variables.
  (init_eval_string_var_and_k_module): New static function.
  (scm_eval_string_in_module): Remove lazy initialization using mutexes.
  Call 'init_eval_string_var_and_k_module' using 'scm_i_pthread_once'.
  Use 'eval_string_var'.

* libguile/throw.c (CACHE_VAR): Remove incorrect macro.
  (catch_var, throw_var, with_throw_handler_var): New static variables.
  (scm_catch, scm_catch_with_pre_unwind_handler): Remove thread-unsafe
  lazy initialization.  Use 'catch_var'.
  (init_with_throw_handler_var): New static function.
  (scm_with_throw_handler): Remove thread-unsafe lazy initialization.
  Call 'init_with_throw_handler_var' using 'scm_i_pthread_once'.
  Use 'with_throw_handler_var'.
  (scm_throw): Remove thread-unsafe lazy initialization.
  Use 'throw_var'.
  (scm_init_throw): Initialize 'catch_var' and 'throw_var'.
2014-01-23 23:44:11 -05:00
Andy Wingo
e2cbf527c4 move procedure-name and procedure-source to procprop.c
* libguile/procprop.h:
* libguile/procprop.c (scm_procedure_name, scm_procedure_source): Move
  these functions here, from debug.[ch].
2013-06-09 19:50:33 +02:00
Mark H Weaver
26d148066f Merge remote-tracking branch 'origin/stable-2.0'
Conflicts:
	configure.ac
	libguile/deprecated.c
	libguile/deprecated.h
	libguile/filesys.h
	libguile/fluids.c
	libguile/fports.c
	libguile/gc.c
	libguile/guile.c
	libguile/numbers.c
	libguile/objcodes.c
	libguile/r6rs-ports.c
	libguile/smob.c
	libguile/socket.c
	libguile/threads.h
	module/language/scheme/decompile-tree-il.scm
	module/language/tree-il/peval.scm
	test-suite/tests/syncase.test
2013-03-28 05:09:53 -04:00
Mark H Weaver
f57ea23ac8 Fix thread-unsafe lazy initializations.
* libguile/debug.c (scm_local_eval):
  libguile/ports.c (scm_current_warning_port):
  libguile/strports.c (scm_eval_string_in_module): Perform
  lazy-initialization while holding a mutex.  Use SCM_UNDEFINED as the
  uninitialized value.  Use 'scm_c_*_variable'.

* doc/ref/api-modules.texi (Accessing Modules from C): Fix
  'my_eval_string' example to be thread-safe.
2013-03-05 16:04:55 -05:00
Andy Wingo
dfadcf85cb Merge remote-tracking branch 'origin/stable-2.0'
Conflicts:
	libguile/debug.h
	module/ice-9/psyntax-pp.scm
	module/ice-9/psyntax.scm
	module/language/tree-il/peval.scm
	module/language/tree-il/primitives.scm
2012-01-30 20:27:35 +01:00
Andy Wingo
d062a8c1ee Implement local-eval', local-compile', and `the-environment'
* module/ice-9/local-eval.scm: New module (ice-9 local-eval) which
  exports `the-environment', `local-eval', and `local-compile'.

* libguile/debug.c (scm_local_eval): New C function that calls the
  Scheme implementation of `local-eval' in (ice-9 local-eval).

* libguile/debug.h (scm_local_eval): Add prototype.

* doc/ref/api-evaluation.texi (Local Evaluation): Add documentation.

* test-suite/tests/eval.test (local evaluation): Add tests.

* test-suite/standalone/test-loose-ends.c (test_scm_local_eval):
  Add test.

* module/Makefile.am: Add ice-9/local-eval.scm.

Based on a patch by Mark H Weaver <mhw@netris.org>.
2012-01-26 12:08:58 +01:00
Andy Wingo
8c5bb72920 add SCM_HEAP_OBJECT_P
* 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.
2011-10-24 18:55:43 +02:00
Andy Wingo
b9b9a02804 remove #define STACK_CHECKING from __scm.h.
* libguile/__scm.h: Remove #define STACK_CHECKING and #undef
  NO_CEVAL_STACK_CHECKING.

* libguile/debug.c (scm_debug_options)
* libguile/init.c (scm_i_init_guile):
* libguile/stackchk.c (scm_report_stack_overflow):
* libguile/stackchk.h: Always enable stack checking.
2011-05-15 15:34:15 +02: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
3d27ef4bd3 fix a number of assumptions that a pointer could fit into a long
* libguile/debug.c:
* libguile/eval.c:
* libguile/frames.c:
* libguile/objcodes.c:
* libguile/print.c:
* libguile/programs.c:
* libguile/read.c:
* libguile/struct.c:
* libguile/vm.c: Fix a number of instances in which we assumed we could
  fit a pointer into a long.
2010-11-19 15:22:43 +01:00
Andy Wingo
ab9c9100d2 scm_debug_opts to debug.c, backtrace on by default, scm_*_opts internal linkage
* libguile/eval.c:
* libguile/debug.c (scm_debug_opts): Move here, from eval.c. Change
  SCM_BACKTRACE_P to 1, initially.

* libguile/private-options.h: Make all options vars private.
2010-10-01 13:11:51 +02:00
Andy Wingo
3932bdb3af remove a number of debug options
* libguile/private-options.h (SCM_BREAKPOINTS_P, SCM_TRACE_P)
  (SCM_REC_PROCNAMES_P, SCM_BACKTRACE_INDENT, SCM_N_FRAMES)
  (SCM_BACKTRACE_MAXDEPTH, SCM_DEVAL_P): Remove these internal names.

* libguile/eval.c (scm_debug_opts): Remove the corresponding debug
  options -- breakpoints, trace, procnames, indent, frames, maxdepth,
  and debug.

* libguile/debug.c (scm_debug_options): Remove SCM_N_FRAMES check.

* test-suite/lib.scm (with-debugging-evaluator*):
* module/scripts/summarize-guile-TODO.scm:
* module/statprof.scm (statprof-reset):
* module/ice-9/boot-9.scm (turn-on-debugging): Remove useless
  debug-enable 'debug calls.

* module/ice-9/deprecated.scm (debug-enable): As it seems that 'debug is
  a particulatly common option that we just removed, add a deprecation
  shim.

* doc/ref/api-options.texi (Debugger options): Update the set of debug
  options.
2010-09-24 20:57:01 +02:00
Andy Wingo
925c1bae1f remove evaluator-traps-interface
* libguile/debug.h:
* libguile/debug.c (scm_with_traps):
* libguile/eval.c (scm_evaluator_traps, scm_evaluator_trap_table):
  Remove these procedures. Note that scm_evaluator_traps was known in
  Scheme as `evaluator-traps-interface'.

* libguile/private-options.h (SCM_TRAPS_P, SCM_ENTER_FRAME_P)
  (SCM_APPLY_FRAME_P, SCM_EXIT_FRAME_P, SCM_ENTER_FRAME_HDLR)
  (SCM_APPLY_FRAME_HDLR, SCM_EXIT_FRAME_HDLR, SCM_MEMOIZE_P)
  (SCM_MEMOIZE_HDLR): Remove these private interfaces.

* module/ice-9/boot-9.scm (traps, trap-enable, trap-disable, trap-set!):
  Remove.

* module/ice-9/scm-style-repl.scm (error-catching-loop): Remove
  with-traps wrap.

* doc/ref/api-options.texi (Low level options interfaces):
  (User level options interfaces, Evaluator trap options)
* doc/ref/api-evaluation.texi (Evaluator Behavior): Remove references to
  the evaluator traps interface.
2010-09-24 18:44:21 +02:00
Ludovic Courtès
98f1f9a51a Remove unused symbols.
* libguile/debug.c (scm_sym_procname, scm_sym_dots): Remove.
2010-06-01 22:56:49 +02:00
Andy Wingo
1e23b461ec remove program-name, program-documentation
* libguile/programs.h:
* libguile/programs.c (scm_program_name): Remove. procedure-name is
  sufficient.

* module/system/vm/program.scm (program-name): Remove from exports list.
  (program-documentation): Remove; procedure-documentation is
  sufficient.

* libguile/debug.c (scm_procedure_name): Remove special case for
  programs.

* module/language/tree-il/analyze.scm (validate-arity): Use
  procedure-name.

* module/ice-9/documentation.scm (object-documentation): Just use
  procedure-documentation, without special cases for programs.
2010-04-17 15:21:08 +02:00
Andy Wingo
a6cd355510 %start-stack in Scheme, in terms of prompts
* libguile/debug.h:
* libguile/debug.c (scm_sys_start_stack): Removed, we implement this in
  Scheme now.

* libguile/vm.h:
* libguile/vm.c (scm_vm_call_with_new_stack): Likewise removed.

* module/ice-9/boot-9.scm (%start-stack): Implement in terms of prompts.
  (%stacks): New fluid, for tracking active stacks.
  (start-stack): Implement using syntax-rules.
2010-03-09 21:32:56 +01:00
Andy Wingo
cc7005bc37 remove scm_tc7_gsubr
* libguile/tags.h (scm_tc7_gsubr): Return to the pool of unused tc7s, as
  there are no more gsubrs. Yay :)

* libguile/programs.h (SCM_F_PROGRAM_IS_PRIMITIVE):
  (SCM_PROGRAM_IS_PRIMITIVE): New flag and accessor.

* libguile/gsubr.c (create_gsubr):
* libguile/snarf.h (SCM_STATIC_PROGRAM): Give subrs a PRIMITIVE flag.

* libguile/smob.h:
* libguile/smob.c (scm_i_smob_arity): New internal procedure. Uses the
  old GSUBR type macros, local to the file.

* libguile/procprop.c (scm_i_procedure_arity): Call out to
  scm_i_smob_arity, and remove a gsubr case.

* libguile/gc.c (scm_i_tag_name):
* libguile/evalext.c (scm_self_evaluating_p):
* libguile/goops.c (scm_class_of):
* libguile/vm.c (apply_foreign):
* libguile/hash.c (scm_hasher):
* libguile/debug.c (scm_procedure_name):
* libguile/print.c (iprin1): Remove gsubr cases.

* libguile/gsubr.h (SCM_PRIMITIVE_P): Fix to work with the new VM
  program regimen.
  (SCM_GSUBR_TYPE, SCM_GSUBR_MAKTYPE, SCM_GSUBR_MAX, SCM_GSUBR_REQ)
  (SCM_GSUBR_OPT, SCM_GSUBR_REST): Remove these macros, that are no
  longer useful.
* libguile/gsubr.c (scm_i_gsubr_apply, scm_i_gsubr_apply_list)
  (scm_i_gsubr_apply_array): Remove internal gsubr application
  functions.
2010-01-07 23:49:39 +01:00
Andy Wingo
6c2961a011 fix procedure-name on applicable structs
* libguile/debug.c (scm_procedure_name): Fix for applicable structs.
2010-01-07 23:49:30 +01:00
Andy Wingo
ea68d342f1 procedures-with-setters implemented in terms of structs
* libguile/tags.h (scm_tc7_pws): No more.

* libguile/procs.c (scm_procedure_with_setter_p)
  (scm_make_procedure_with_setter, scm_procedure, scm_setter): Implement
  procedures-with-setters in terms of applicable structs with setters.

* libguile/procs.h: Remove a big, outdated comment, and the deprecated
  macros.

* libguile/deprecated.h (SCM_PROCEDURE_WITH_SETTER_P, SCM_PROCEDURE)
  (SCM_SETTER): Deprecate these. SCM_PROCEDURE and SCM_SETTER are bad
  names.

* libguile/evalext.c (scm_self_evaluating_p):
* libguile/gc.c (scm_i_tag_name):
* libguile/goops.c: (scm_class_of):
* libguile/print.c (iprin1):
* libguile/procprop.c (scm_i_procedure_arity):
* libguile/procs.c (scm_procedure_p):
* libguile/debug.c (scm_procedure_source): Remove a tc7_pws case.

* libguile/goops.h:
* libguile/goops.c (scm_class_procedure_with_setter): Remove this class;
  it is subsumed by applicable_struct_with_setter.

* libguile/struct.h: Update a comment.

* libguile/vm-i-system.c (call, goto/args, mv-call): Remove PWS cases.
2009-12-07 09:56:58 +01:00
Andy Wingo
314b87163e eval.c closures are now applicable smobs, not tc3s
* libguile/debug.c (scm_procedure_name): Remove a SCM_CLOSUREP case and
  some dead code.
  (scm_procedure_module): Remove. This was introduced a few months ago
  for the hygienic expander, but now it is no longer needed, as the
  expander keeps track of this information itself.

* libguile/debug.h: Remove scm_procedure_module.

* libguile/eval.c: Instead of using tc3 closures, define a "boot
  closure" applicable smob type, and represent closures with that. The
  advantage is that after eval.scm is compiled, boot closures take up no
  address space (besides a smob number) in the runtime, and require no
  special cases in procedure dispatch.

* libguile/eval.h: Remove the internal functions scm_i_call_closure_0
  and scm_closure_apply, and the public function scm_closure.

* libguile/gc.c (scm_storage_prehistory): No tc3_closure displacement
  registration.
  (scm_i_tag_name): Remove closure case, and a dead cclo case.

* libguile/vm.c (apply_foreign):
* libguile/print.c (iprin1):
* libguile/procs.c (scm_procedure_p, scm_procedure_documentation);
* libguile/evalext.c (scm_self_evaluating_p):
* libguile/goops.c (scm_class_of): Remove tc3_closure/tcs_closure cases.
* libguile/hash.c (scm_hasher):

* libguile/hooks.c (scm_add_hook_x): Use new scm_i_procedure_arity.

* libguile/macros.c (macro_print): Print all macros using the same code.
  (scm_macro_transformer): Return any procedure, not just programs.

* libguile/procprop.h:
* libguile/procprop.c (scm_i_procedure_arity): Instead of returning a
  list that the caller has to parse, have the same prototype as
  scm_i_program_arity. An incompatible change, but it's an internal
  function anyway.
  (scm_procedure_properties, scm_set_procedure_properties)
  (scm_procedure_property, scm_set_procedure_property): Remove closure
  cases, and use scm_i_program_arity for arity.

* libguile/procs.h (SCM_CLOSUREP, SCM_CLOSCAR, SCM_CODE)
  (SCM_CLOSURE_NUM_REQUIRED_ARGS, SCM_CLOSURE_HAS_REST_ARGS)
  (SCM_CLOSURE_BODY, SCM_PROCPROPS, SCM_SETPROCPROPS, SCM_ENV)
  (SCM_TOP_LEVEL): Remove these macros that pertain to boot closures
  only. Only eval.c should know abut boot closures.
* libguile/procs.c (scm_closure_p): Remove this function. There is a
  simple stub in deprecated.scm now.
  (scm_thunk_p): Use scm_i_program_arity.
* libguile/tags.h (scm_tc3_closure): Remove. Yay, another tc3 to play
  with!
  (scm_tcs_closures): Remove.

* libguile/validate.h (SCM_VALIDATE_CLOSURE): Remove.

* module/ice-9/deprecated.scm (closure?): Add stub.

* module/ice-9/documentation.scm (object-documentation)
* module/ice-9/session.scm (help-doc, arity)
* module/oop/goops.scm (compute-getters-n-setters)
* module/oop/goops/describe.scm (describe)
* module/system/repl/describe.scm (display-object, display-type):
  Remove calls to closure?.
2009-12-04 19:20:11 +01:00
Andy Wingo
f36878ba2d remove cxrs
* libguile/pairs.h:
* libguile/pairs.c: Previously scm_cdadr et al were implemented as
  #defines that called scm_i_chase_pairs, and the Scheme-exposed
  functions themselves were cxr subrs, which got special help in the
  interpreter. Since now the special help is unnecessary (because the
  compiler inlines and expands calls to car, cdadr, etc), the complexity
  is a loss. So just implement cdadr etc using normal functions. There's
  an advantage too, in that the compiler can unroll the cxring, reducing
  branches.

* libguile/tags.h (scm_tc7_cxr): Remove this tag.
  (scm_tcs_subrs): Now there's only one kind of subr, yay!

* libguile/debug.c (scm_procedure_name)
* libguile/evalext.c (scm_self_evaluating_p)
* libguile/gc.c (scm_i_tag_name)
* libguile/goops.c (scm_class_of)
* libguile/hash.c (scm_hasher)
* libguile/print.c (iprin1)
* libguile/procprop.c (scm_i_procedure_arity)
* libguile/procs.c (scm_procedure_p, scm_subr_p)
  (scm_make_procedure_with_setter)
* libguile/vm.c (apply_foreign): Remove cxr cases. Replace uses of
  scm_tcs_subrs with scm_tc7_gsubr.
2009-12-04 16:39:34 +01:00
Andy Wingo
14aa25e410 remove debug frames
* libguile/debug.h (scm_t_debug_frame): Remove this type, as it was
  internal to the old evaluator.
  (SCM_EVALFRAME, SCM_APPLYFRAME, SCM_VOIDFRAME, SCM_MACROEXPF)
  (SCM_TAILREC, SCM_TRACED_FRAME, SCM_ARGS_READY, SCM_DOVERFLOW)
  (SCM_MAX_FRAME_SIZE, SCM_FRAMETYPE)
  (SCM_EVALFRAMEP, SCM_APPLYFRAMEP, SCM_VOIDFRAMEP, SCM_MACROEXPFP)
  (SCM_TAILRECP, SCM_TRACED_FRAME_P, SCM_ARGS_READY_P, SCM_OVERFLOWP)
  (SCM_SET_MACROEXP, SCM_SET_TAILREC, SCM_SET_TRACED_FRAME)
  (SCM_SET_ARGSREADY, SCM_SET_OVERFLOW)
  (SCM_CLEAR_MACROEXP, SCM_CLEAR_TRACED_FRAME, SCM_CLEAR_ARGSREADY):
  Remove macro accessors to scm_t_debug_frame.
  (SCM_DEBUGOBJP, SCM_DEBUGOBJ_FRAME, SCM_SET_DEBUGOBJ_FRAME):
  (scm_debug_object_p, scm_make_debugobj): Remove debugobj accessors.
  (scm_i_unmemoize_expr): Remove unused declaration.

* libguile/debug.c (scm_debug_options): No more max limit on frame
  sizes.
  (scm_start_stack): Just call out to scm_vm_call_with_new_stack.
  (scm_debug_object_p, scm_make_debugobj, scm_init_debug): No more
  debugobj smob type.

* libguile/deprecated.h:
* libguile/deprecated.c (scm_i_deprecated_last_debug_frame)
  (scm_last_debug_frame): Remove deprecated debug-frame bits.

* libguile/stacks.c (scm_make_stack): Rework this function and its
  dependents to only walk VM frames.
  (scm_stack_id): Call out to the holder of the VM frame in question,
  which should be a VM or a VM continuation, for the stack ID. Currently
  this bit is stubbed out.
  (scm_last_stack_frame): Removed. It seems this is mainly useful for a
  debugger, and we need to rewrite the debugger to work on the Scheme
  level.

* test-suite/tests/continuations.test ("continuations"): Remove test for
  last-stack-frame.

* libguile/continuations.h (struct scm_t_contregs):
* libguile/continuations.c (scm_make_continuation):
  (copy_stack_and_call, scm_i_with_continuation_barrier): No need to
  save and restore debug frames.

* libguile/threads.h (scm_i_thread): Don't track debug frames.
  (scm_i_last_debug_frame, scm_i_set_last_debug_frame): Remove macro
  accessors.

* libguile/threads.c (guilify_self_1): Don't track debug frames.

* libguile/throw.c: No need to track debug frames in a jmpbuf.

* libguile/vm-engine.c (vm_engine, VM_PUSH_DEBUG_FRAMES): Don't push
  debug frames.

* libguile/vm.h:
* libguile/vm.c (scm_vm_call_with_new_stack): New function. Currently
  stubbed out though.
2009-12-03 11:03:39 +01:00
Andy Wingo
b7742c6b71 new evaluator, y'all
* 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.
2009-12-01 21:00:26 +01:00
Andy Wingo
b6cf4d0265 a very big commit cleaning up structs & goops. also applicable structs.
I tried to split this one, and I know it's a bit disruptive, but this
stuff really is one big cobweb. So instead we'll pretend like these are
separate commits, by separating the changelog.

Applicable struct runtime support.

* libguile/debug.c (scm_procedure_source):
* libguile/eval.c (scm_trampoline_0, scm_trampoline_1)
  (scm_trampoline_2):
* libguile/eval.i.c (CEVAL):
* libguile/goops.c (scm_class_of):
* libguile/procprop.c (scm_i_procedure_arity):
* libguile/procs.c (scm_procedure_p, scm_procedure, scm_setter): Allow
  for applicable structs. Whee!

* libguile/deprecated.h (scm_vtable_index_vtable): Define as a synonym
  for scm_vtable_index_self.
  (scm_vtable_index_printer): Alias scm_vtable_index_instance_printer.
  (scm_struct_i_free): Alias scm_vtable_index_instance_finalize.
  (scm_struct_i_flags): Alias scm_vtable_index_flags.
  (SCM_STRUCTF_FLAGS): Be a -1 mask, we have a whole word now.
  (SCM_SET_VTABLE_DESTRUCTOR): Implement by hand.

Hidden slots.

* libguile/struct.c (scm_make_struct_layout): Add support for "hidden"
  fields, writable fields that are not visible to make-struct. This
  allows us to add fields to vtables and not break existing make-struct
  invocations.
  (scm_struct_ref, scm_struct_set_x): Always get struct length from the
  vtable. Support hidden fields.

* libguile/goops.c (scm_class_hidden, scm_class_protected_hidden): New
  slot classes, to correspond to the new vtable slots.
  (scm_sys_prep_layout_x): Turn hidden slots into 'h'.
  (build_class_class_slots): Reorder the class slots to account for
  vtable fields coming out of negative-land, for name as a vtable slot,
  and for hidden fields.
  (create_standard_classes): Define <hidden-slot> and
  <protected-hidden-slot>.

Clean up struct.h.

* libguile/struct.h: Lay things out cleaner. There are no more hidden
  (negative) words. Names are nicer. The exposition is nicer. But the
  basics are the same. The incompatibilities are that <vtable> has more
  slots now, and that scm_alloc_struct's signature has changed. The
  former is ameliorated by the "hidden" slots mentioned before, and the
  latter, well, it was always a very internal thing...
  (scm_t_struct_finalize): New type, a finalizer function to be run when
  instances of a vtable are collected.
  (scm_t_struct_free): Removed, structs' data is managed by the GC now,
  and not freed by vtable functions.

* libguile/struct.c: (scm_vtable_p): Now we keep flags on
  vtable-vtables, so this check is cheaper.
  (scm_alloc_struct): No hidden words. Yippee.
  (struct_finalizer_trampoline): Entersify.
  (scm_make_struct): No need to babysit extra words, though now we have
  to babysit flags. Propagate the vtable, applicable, and setter flags
  appropriately.
  (scm_make_vtable_vtable): Update for new simplicity.
  (scm_print_struct): A better printer.
  (scm_init_struct): Define <applicable-struct-vtable>, a magical vtable
  like CL's funcallable-standard-class. Also define
  <applicable-struct-with-setter-vtable>.

Remove foreign object implementation.

* libguile/goops.h:
* libguile/goops.c (scm_make_foreign_object, scm_make_class)
  (scm_add_slot, scm_wrap_object, scm_wrap_component): Remove, these
  were undocumented and unworking.

Clean up goops.h, a little.

* libguile/goops.h:
* libguile/goops.c: Also clean up.
* module/oop/goops/dispatch.scm (hashset-index): Adapt for new hashset
  index.
2009-11-26 00:24:58 +01:00
Andy Wingo
efcebb5b56 fold objects.[ch] into goops.[ch]
Remove objects.h #includes as appropriate.
2009-11-15 20:28:12 +01:00
Andy Wingo
11561496ba remove support for "entities" -- a form of applicable struct
Entities were meant to be a form of applicable struct. Unfortunately,
the implementation is intertwingled with generics. Removing them, for
now, will make it possible to cleanly re-add applicable struct support.

* libguile/struct.h (SCM_STRUCTF_ENTITY): Remove.
  (SCM_STRUCTF_GOOPS_HACK): New flag; sigh.
* libguile/struct.c (scm_make_struct): We make "entity" structs if the
  GOOPS_HACK flag is set. This will be fixed when we rework flags and
  remove hidden words.

* libguile/goops.c (scm_class_of): Structs are not applicable, for now
  at least.
  (scm_sys_inherit_magic_x, scm_basic_basic_make_class)
  (scm_sys_allocate_instance, scm_sys_set_object_setter_x):
  (make_struct_class): Adapt for no more entities (and thus no entity
  flag).
  (create_standard_classes): For some reason, generic functions were
  getting the LIGHT flag set, after the ENTITY flag was removed; so for
  now explicitly clear that flag.
* libguile/goops.h (SCM_GENERIC_SETTER, SCM_SET_GENERIC_SETTER): New
  macros.

* libguile/objects.h:
* libguile/objects.c: Remove code for entities.

* libguile/debug.c: (scm_procedure_source): Only work with generics.

* libguile/eval.c (scm_trampoline_0, scm_trampoline_1)
  (scm_trampoline_2): Only handle generics.

* libguile/eval.i.c (CEVAL): #ifdef out the pieces about entities.

* libguile/procprop.c (scm_i_procedure_arity): Remove support for
  entities.

* libguile/procs.c (scm_procedure_p, scm_procedure, scm_setter): Remove
  entity support.
2009-11-15 20:28:11 +01:00
Andy Wingo
730d8ad9e6 remove operators 2009-11-15 20:28:11 +01:00
Ludovic Courtès
7af531508c Merge branch 'master' into boehm-demers-weiser-gc
Conflicts:
	libguile/Makefile.am
	libguile/bytevectors.c
	libguile/gc-card.c
	libguile/gc-mark.c
	libguile/programs.c
	libguile/srcprop.c
	libguile/srfi-14.c
	libguile/symbols.c
	libguile/threads.c
	libguile/unif.c
	libguile/vm.c
2009-08-28 19:16:46 +02:00
Andy Wingo
2fb924f64f programs have their own tc7 now
* libguile/tags.h (scm_tc7_program):
* libguile/programs.h: Programs now have their own tc7 code. Fix up the
  macros appropriately.

* libguile/programs.c: Remove smobby bits, leaving marking, printing,
  and application for other parts of Guile.

* libguile/debug.c (scm_procedure_source):
* libguile/eval.c (scm_trampoline_0, scm_trampoline_1)
  (scm_trampoline_2): Add cases for tc7_program.
* libguile/eval.i.c (CEVAL, SCM_APPLY):
* libguile/evalext.c (scm_self_evaluating_p):
* libguile/gc-card.c (scm_i_sweep_card, scm_i_tag_name):
* libguile/gc-mark.c (1):
* libguile/print.c (iprin1):
* libguile/procs.c (scm_procedure_p, scm_thunk_p)
* libguile/vm-i-system.c (make-closure): Adapt to new procedure
  representation.

* libguile/procprop.c (scm_i_procedure_arity): Do the right thing for
  programs.
* test-suite/tests/procprop.test ("procedure-arity"): Arity test now
  succeeds.

* libguile/goops.c (scm_class_of): Programs now belong to the class
  <procedure>, not a smob class.

* libguile/vm.h (struct vm, struct vm_cont):
* libguile/vm-engine.c (vm_engine):
* libguile/frames.h (SCM_FRAME_BYTE_CAST, struct vm_frame):
* libguile/frames.c (scm_c_make_vm_frame): Fix usages of scm_byte_t,
  changing them to scm_t_uint8.
2009-08-20 18:52:51 +02:00
Ludovic Courtès
fbb857a472 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
2009-08-18 00:06:45 +02:00
Andy Wingo
ce471ab8b0 rename SCM_SNAME to SCM_SUBR_NAME
* libguile/procs.h: Rename SCM_SNAME to SCM_SUBR_NAME.

* libguile/debug.c:
* libguile/eval.c:
* libguile/eval.i.c:
* libguile/goops.c:
* libguile/gsubr.c:
* libguile/print.c:
* libguile/procs.c: Update callers.
2009-06-19 11:20:34 +02: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
Andy Wingo
69dd78d7c8 no positions when reading psyntax-pp, validation in @/@@, cleanups
* module/ice-9/syncase.scm (old-debug): Re-disable position recording
  when reading psyntax-pp.

* libguile/eval.c (scm_m_at, scm_m_atat): More input validation.

* libguile/debug.c (scm_procedure_module): Use scm_env_module. Remove
  extraneous docstring.
2009-04-17 15:20:19 +02:00
Andy Wingo
4e237f1460 thread the module through syntax-case's expansion
* libguile/debug.h:
* libguile/debug.c (scm_procedure_module): New procedure, returns the
  module that was current when the given procedure was defined. Used by
  syncase to scope free identifiers.

* module/ice-9/psyntax-pp.scm: Recompiled.

* module/ice-9/psyntax.scm: Thread the module through the syntax
  expansion. This is harder than it would appear because in many places
  the different components of syntax objects are destructured.

* module/ice-9/syncase.scm (guile-macro): Adapt to new signature for
  syntax transformer functions.
2009-04-17 15:20:16 +02:00