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

55 commits

Author SHA1 Message Date
Andy Wingo
296004b3ba Merge remote-tracking branch 'origin/stable-2.0'
Conflicts:
	libguile/feature.c
	m4/gnulib-cache.m4
	module/ice-9/deprecated.scm
	module/language/tree-il/peval.scm
2011-12-19 18:00:28 +01:00
Christian Persch
3cc21d7995 Add a deprecated alias for $expt
* module/ice-9/deprecated.scm: Add alias for $expt. $expt was removed
  in commit 6fc4d0124d but no deprecated
  alias was added in ad79736c68 like for
  all the other deprecated $sin, $cos, ... functions.
2011-12-19 01:15:19 +01:00
Andy Wingo
fc7bd367ab remove all deprecated code
* libguile/async.c:
* libguile/async.h:
* libguile/debug.h:
* libguile/deprecated.c:
* libguile/deprecated.h:
* libguile/evalext.h:
* libguile/gc-malloc.c:
* libguile/gc.h:
* libguile/gen-scmconfig.c:
* libguile/numbers.c:
* libguile/ports.c:
* libguile/ports.h:
* libguile/procprop.c:
* libguile/procprop.h:
* libguile/read.c:
* libguile/socket.c:
* libguile/srfi-4.h:
* libguile/strings.c:
* libguile/strings.h:
* libguile/tags.h:
* module/ice-9/boot-9.scm:
* module/ice-9/deprecated.scm: Remove all deprecated code.  CPP defines
  that were not previously issuing warnings were changed so that their
  expansions would indicate the replacement forms to use,
  e.g. scm_sizet__GONE__REPLACE_WITH__size_t.

  The two exceptions were SCM_LISTN, which did not produce warnings
  before, and the string-filter argument order stuff.

  Drops the initial dirty memory usage of Guile down to 2.8 MB on my
  machine, from 4.4 MB.
2011-05-12 14:01:26 +02:00
Andy Wingo
d147fe2e68 all deprecated routines emit warnings
* module/ice-9/deprecated.scm (substring-move-left!)
  (substring-move-right!, dynamic-maybe-call, dynamic-maybe-link)
  (try-module-linked, try-module-dynamic-link)
  ($asinh, $acosh, $atanh, $sqrt, $abs, $exp, $log, $sin, $cos)
  ($tan, $asin, $acos, $atan, $sinh, $cosh, $tanh)
  (process-define-module): Add deprecation warnings.
2011-05-12 13:07:19 +02:00
Andy Wingo
402c35ac81 deprecate process-define-module
* module/ice-9/boot-9.scm:
* module/ice-9/deprecated.scm (process-define-module): Deprecate.
2010-11-19 15:22:44 +01:00
Andreas Rottmann
d458073bc0 Use a fluid for the list of the reader's "hash procedures"
This allows customizing the reader behavior for a dynamic extent more easily.

* libguile/read.c (scm_read_hash_procedures): Renamed to
  `scm_i_read_hash_procedures'.
  (scm_i_read_hash_procedures_ref, scm_i_read_hash_procedures_set_x):
  New (internal) accessor functions for the fluid.
  (scm_read_hash_extend, scm_get_hash_procedure): Use these accessor
  functions.
  (scm_init_read): Create the fluid, named `%read-hash-procedures' instead of
  the previous plain list `read-hash-procedures'.

* test-suite/tests/reader.test: Adapt the "R6RS/SRFI-30 block comment
  syntax overridden" test to make use of the fluid.

* module/ice-9/deprecated.scm (read-hash-procedures):
  New identifier macro -- backward-compatibility shim.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2010-11-03 00:09:57 +01:00
Andy Wingo
e2e2631d75 deprecate turn-on-debugging, it is obsolete
* libguile/script.c (scm_compile_shell_switches): Don't generate calls
  to turn-on-debugging.

* module/ice-9/boot-9.scm (turn-on-debugging): Remove.

* module/ice-9/deprecated.scm (turn-on-debugging): Add deprecated shim.
2010-10-01 13:17:44 +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
dcb68c09d0 module-ref-submodule deprecation fixes
* module/ice-9/boot-9.scm (module-ref-submodule)
  (module-define-submodule!): Pull deprecated shims here, as we need
  them before loading (ice-9 deprecated). Also bugfix to only define the
  module if there is no local variable, even if it is unbound.

* module/ice-9/deprecated.scm: Remove from here.
2010-09-02 21:31:55 -07:00
Andy Wingo
5cc987760b fix #y back-compat shim
* module/ice-9/deprecated.scm (#\y): #y was in fact a syntax for
  s8vectors, not bitvectors. Fix.
2010-08-29 21:01:54 -07:00
Andy Wingo
ca9300a255 remove (ice-9 emacs)
* module/ice-9/emacs.scm: Remove.
* module/ice-9/deprecated.scm (load-emacs-interface): Remove wrapper
  with no callers.
* module/Makefile.am: update.
2010-07-16 17:35:43 +02:00
Andy Wingo
f4b879e03b fix boostrapping error with srfi-1 (for the third time!)
* module/ice-9/deprecated.scm (set-repl-prompt!): Avoid @, so as to
  avoid a bootstrapping error. Horrible.
2010-07-14 19:45:05 +02:00
Andy Wingo
652f48c062 use *repl-stack* instead of *repl-level*
* module/ice-9/boot-9.scm (*repl-stack*): Instead of repl-level, have a
  stack.
  (batch-mode?): Change to poke the stack.

* module/ice-9/deprecated.scm (set-batch-mode?!): Update deprecation
  method.

* module/system/repl/common.scm (repl-prompt): Update to poke
  *repl-stack* to get the level.

* module/system/repl/repl.scm (start-repl): Bind *repl-stack*
  appropriately.
2010-06-26 22:28:21 +02:00
Andy Wingo
ff87b2bd7c top-repl out to its own module
* module/ice-9/boot-9.scm:
* module/ice-9/top-repl.scm: Move top-repl out here.

* module/Makefile.am: Add new file.

* module/ice-9/deprecated.scm (top-repl): Deprecated shim.

* libguile/script.c (scm_compile_shell_switches): Invoke top-repl from
  its new location.
2010-06-22 23:50:27 +02:00
Andy Wingo
049ec20299 deprecate named-module-use!, load-emacs-interface, and remove --emacs
* module/ice-9/boot-9.scm:
* module/ice-9/deprecated.scm (named-module-use!)
  (load-emacs-interface): Deprecate these.

* module/ice-9/gds-client.scm (run-utility): Redefine to not use
  named-module-use!.

* libguile/script.c (scm_shell_usage): Remove --emacs option.
  (scm_compile_shell_switches): Remove support for --emacs.

* module/ice-9/boot-9.scm (top-repl): Don't muck with --emacs.

* doc/ref/scheme-scripts.texi (Invoking Guile): Remove note about
  --emacs.
2010-06-22 22:39:21 +02:00
Andy Wingo
ec16eb7847 deprecate the-last-stack
* libguile/backtrace.h (scm_the_last_stack_fluid_var)
* libguile/backtrace.c (scm_init_backtrace): No more
  scm_the_last_stack_fluid_var. The replacement is to resolve
  `the-last-stack' in (ice-9 stack-catch).
  (scm_backtrace_with_highlights): Accordingly, instead of backtracing
  the last stack, backtrace the current stack.

* libguile/throw.h:
* libguile/throw.c:
* libguile/deprecated.h:
* libguile/deprecated.c (scm_internal_stack_catch): Deprecate this
  function.

* module/ice-9/save-stack.scm (the-last-stack): Move here from boot-9.

* module/ice-9/debug.scm:
* module/ice-9/debugger.scm: Use (ice-9 save-stack) for the-last-stack.

* module/ice-9/deprecated.scm (the-last-stack): Add deprecated shim.
2010-06-19 13:43:33 +02:00
Andy Wingo
d8158b837e deprecate save-stack, stack-saved?
* module/Makefile.am:
* module/ice-9/boot-9.scm:
* module/ice-9/save-stack.scm (stack-saved?, save-stack): Move these
  bindings to their own module.

* module/oop/goops.scm (goops-error):
* module/ice-9/boot-9.scm (error, top-repl): Remove calls to save-stack.

* module/ice-9/deprecated.scm (stack-saved?, save-stack): Add deprecated
  shims.

* module/ice-9/emacs.scm:
* module/ice-9/stack-catch.scm:
* module/ice-9/debugger/command-loop.scm:
* module/ice-9/scm-style-repl.scm: Import (ice-9 save-stack).
2010-06-19 12:57:31 +02:00
Andy Wingo
7034da249b handle-system-error to scm-style-repl
* module/ice-9/boot-9.scm:
* module/ice-9/scm-style-repl.scm (handle-system-error): Move here from
  boot-9.

* module/ice-9/deprecated.scm (handle-system-error): Keep a deprecated
  wrapper in the root environment.
2010-06-19 11:43:48 +02:00
Andy Wingo
fede5c8977 default-pre-unwind-handler to scm-style-repl
* module/ice-9/boot-9.scm:
* module/ice-9/deprecated.scm (default-pre-unwind-handler): Deprecate
  root-module definition.

* module/ice-9/scm-style-repl.scm (default-pre-unwind-handler): Move
  here.

* module/ice-9/debugging/traps.scm:
* module/ice-9/debugger.scm:
* module/ice-9/stack-catch.scm: Use default-pre-unwind-handler from
  scm-style-repl.
2010-06-18 12:50:32 +02:00
Andy Wingo
38008a7517 finish deprecating pre-unwind-handler-dispatch
* module/ice-9/boot-9.scm:
* module/ice-9/deprecated.scm (pre-unwind-handler-dispatch): Properly
  deprecate.

* module/ice-9/debugger.scm (debug-on-error):
* module/ice-9/debugging/traps.scm (on-pre-unwind-handler-dispatch):
  Update remaining pre-unwind-handler-dispatch uses.
2010-06-18 12:43:04 +02:00
Andy Wingo
a29e5b632e deprecate `repl'
* module/ice-9/boot-9.scm:
* module/ice-9/deprecated.scm (repl): Deprecate.
2010-06-18 12:30:45 +02:00
Andy Wingo
9346b857af batch-mode? in terms of *repl-level*
* module/ice-9/boot-9.scm (*repl-level*): New global fluid, moved here
  from (system repl common).
  (batch-mode?): Reimplement in terms of *repl-level*.
  (ensure-batch-mode!): A replacement for set-batch-mode?!.

* module/ice-9/deprecated.scm (set-batch-mode?!): Deprecate.

* module/ice-9/popen.scm (open-process): Use ensure-batch-mode!.

* module/ice-9/scm-style-repl.scm (error-catching-loop): Override
  ensure-batch-mode!.

* module/system/repl/common.scm: Remove *repl-level*.
2010-06-18 12:28:18 +02:00
Andy Wingo
4f99a49919 deprecate set-repl-prompt!
* module/ice-9/boot-9.scm:
* module/ice-9/deprecated.scm (set-repl-prompt!): Deprecate, but wrap
  the (system repl common) implementation instead of the scm-style-repl.
2010-06-18 11:33:16 +02:00
Andy Wingo
40f17f1e0a assert-repl-* and associated state variables to scm-style-repl
* module/ice-9/boot-9.scm:
* module/ice-9/scm-style-repl.scm (scm-repl-silent, assert-repl-silence)
  (scm-repl-print-unspecified, assert-repl-print-unspecified)
  (scm-repl-verbose, assert-repl-verbosity)
  (scm-repl-prompt): Move these definitions here from boot-9.scm.

* module/ice-9/deprecated.scm (assert-repl-silence):
  (assert-repl-print-unspecified, assert-repl-verbosity): Deprecated
  wrappers for the functions. I'm not sure if the variables can be
  helped though.
2010-06-18 11:15:18 +02:00
Andy Wingo
1772145c02 fix bug in collect
* module/ice-9/deprecated.scm (collect): Fix bug.
2010-06-14 10:46:02 +02:00
Andy Wingo
5c0450b249 deprecate `collect'
* module/ice-9/boot-9.scm:
* module/ice-9/deprecated.scm (collect): Deprecate, and fix to ensure
  sequential collection.
2010-06-11 16:58:31 +02:00
Andy Wingo
c3aaf3cf7a deprecate get-option, for-next-option, display-usage-report, transform-usage-lambda
* module/ice-9/boot-9.scm:
* module/ice-9/deprecated.scm (get-option, for-next-option)
  (display-usage-report, transform-usage-lambda): Deprecate these
  option-parsing utils. We can revive them in a non-deprecated module if
  there is interest, but I suspect there will be no interest.
2010-06-11 16:58:31 +02:00
Andy Wingo
0bbe199d4d deprecate `scheme-file-suffix'
* module/ice-9/boot-9.scm:
* module/ice-9/deprecated.scm (scheme-file-suffix): Deprecate.
2010-06-11 16:58:31 +02:00
Andy Wingo
4100dc5dee deprecate `bad-throw'
* module/ice-9/boot-9.scm:
* module/ice-9/scm-style-repl.scm (bad-throw): Move here. This function
  was never documented, but has been around since guile-ii. It's not
  used with current code though.

* module/ice-9/deprecated.scm: Provide bad-throw in default env.

* module/ice-9/debugger/commands.scm: Import bad-throw from
  scm-style-repl.
2010-06-11 16:58:31 +02:00
Andy Wingo
010b159f56 deprecate has-suffix?
* module/ice-9/boot-9.scm:
* module/ice-9/deprecated.scm (has-suffix?): Deprecate.

* test-suite/guile-test:
* benchmark-suite/guile-benchmark: Fix uses of deprecated has-suffix?.
2010-06-11 16:58:24 +02:00
Andy Wingo
0f509ab5e3 deprecate apply-to-args
* module/ice-9/boot-9.scm:
* module/ice-9/deprecated.scm (apply-to-args): Deprecate.
2010-06-10 23:55:35 +02:00
Andy Wingo
b2e27da35b scm-style-repl -> (ice-9 scm-style-repl)
* module/Makefile.am:
* module/ice-9/scm-style-repl.scm: New file, to hold the old
  scm-style-repl.

* module/ice-9/deprecated.scm: Provide scm-style-repl and
  error-catching-loop and error-catching-repl in the default env, but
  with deprecation warnings.
2010-06-10 23:28:23 +02:00
Andy Wingo
4ae3d5aae8 deprecate error-catching-loop, error-catching-repl
* module/ice-9/deprecated.scm (error-catching-loop)
  (error-catching-repl): Deprecate.
2010-06-10 14:15:26 +02:00
Andy Wingo
03af6e0953 deprecate scm-style-repl
* module/ice-9/deprecated.scm (scm-style-repl): Deprecate.
2010-06-10 14:15:26 +02:00
Andy Wingo
4e48b4950e module-public-interface is a field in the module record
* module/ice-9/boot-9.scm (module-public-interface)
  (set-module-public-interface!): Instead of using
  '%module-public-interface, use a field in the module instead.
  (make-module, make-autoload-interface): Adapt.

* module/ice-9/deprecated.scm (module-public-interface):
  (set-module-public-interface!): Add shims so that manually munging
  %module-public-interface should continue to work.
2010-04-24 17:43:59 +02:00
Andy Wingo
81fc66cfb6 add submodule binders
* module/ice-9/boot-9.scm (module-submodule-binder)
  (set-module-submodule-binder!): New field on modules.
  (make-module, make-autoload-interface): Adapt.
  (module-ref-submodule): If we miss the submodules table, call the
  submodules binder, if any.

* module/ice-9/deprecated.scm (module-ref-submodule): Check the
  submodule binder before the deprecated look into the obarray.
2010-04-24 17:42:01 +02:00
Andy Wingo
f6a5308b03 module-{ref,define}-submodule use the submodules table
* module/ice-9/boot-9.scm (module-ref-submodule)
  (module-define-submodule!): Implement in terms of the
  module-submodules table, instead of looking for bindings in the value
  namespace.

* module/ice-9/deprecated.scm (module-ref-submodule):
  (module-define-submodule!): Define deprecated versions of these that
  duplicate the submodules table in the normal values namespace, for
  back compatibility.
2010-04-24 17:42:01 +02:00
Andy Wingo
635a8b36b1 deprecated %app shims use module-define-submodule!
* module/ice-9/deprecated.scm (%app, app, modules): Don't use the module
  interface to provide %app shims, use module-define-submodule! directly
  to side-effect the root module.
2010-04-24 17:42:00 +02:00
Andy Wingo
cb67c838f5 deprecate %app
* module/ice-9/boot-9.scm (module-name): Don't rely on (%app modules),
  use other tricks to name anonymous modules.
  (resolve-module): Instead of relying on %app, close over the root of
  the module hierarchy -- the module that was '(%app modules).

* module/ice-9/deprecated.scm (%app): Provide a compatible %app shim.
2010-04-22 15:37:04 +02:00
Andy Wingo
c9904ab040 formally deprecate `app'
* module/ice-9/deprecated.scm (app): Deprecate.
* module/ice-9/boot-9.scm: Remove app definition.
2010-04-22 15:31:02 +02:00
Andy Wingo
0abc210944 deprecate @bind
* module/ice-9/boot-9.scm:
* module/ice-9/deprecated.scm (@bind): Deprecate @bind, which was a
  thread-unsafe dynamic scoping mechanism, used in the old elisp
  support. Fluids are more correct, and are probably faster, given the
  VM support for with-fluids.

* test-suite/tests/dynamic-scope.test: Remove.
* test-suite/tests/fluids.test: Move relevant tests from
  dynamic-scope.test here, recast in terms of with-fluids.
2010-04-19 14:00:23 +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
Ludovic Courtès
e63dda67d7 Move feature?' to deprecated.scm'.
* module/ice-9/boot-9.scm (feature?): Move to...

* module/ice-9/deprecated.scm (feature?): ... here.
2010-01-11 01:21:14 +01:00
Ludovic Courtès
0ea72faa4e Make `(ice-9 deprecated)' a module of its own.
* module/ice-9/boot-9.scm: Load `deprecated.scm' with
  `resolve-interface' instead of `primitive-load-path'.

* module/ice-9/deprecated.scm: Turned into a module, `(ice-9
  deprecated)'.
2010-01-11 01:21:14 +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
ad79736c68 implement transcendental sin, cos etc in c; deprecate $sin, $cos, etc
* libguile/deprecated.h:
* libguile/deprecated.c (scm_asinh, scm_acosh, scm_atanh): Deprecate
  these stand-ins for the C99 asinh, acosh, and atanh functions. Guile
  is not gnulib.
  (scm_sys_atan2): Deprecate as well, in favor of scm_atan.

* libguile/numbers.h:
* libguile/numbers.c (scm_sin, scm_cos, scm_tan)
  (scm_sinh, scm_cosh, scm_tanh)
  (scm_asin, scm_acos, scm_atan)
  (scm_sys_asinh, scm_sys_acosh, scm_sys_atanh): New functions,
  replacing the combination of dsubrs and boot-9 wrappers with C subrs
  that handle complex values. The latter three have _sys_ in their names
  due to the name conflict with the deprecated scm_asinh et al.

  Remove the $abs, $sin etc "dsubrs".

* module/ice-9/boot-9.scm: Remove transcendental functions, as this all
  happens in C now.

* module/ice-9/deprecated.scm: Add aliases for $sin et al.

* test-suite/tests/ramap.test ("array-map!"): Adjust "dsubr" tests to
  use sqrt, not $sqrt. They don't actually test dsubrs now. In the
  two-source test, I'm pretty sure the dsubr array-map! should have been
  failing, as indeed it does now; I've changed the test case to expect
  the failure. I'd still like to know why it was succeeding before.
2009-12-03 15:27:35 +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
b0fae4ecaa bitvector tweaks
* libguile/arrays.c (scm_from_contiguous_typed_array):
* libguile/bytevectors.c (scm_uniform_array_to_bytevector): Error if the
  uniform element size is more than 8 bits, but not divisible by 8 --
  because our math could overflow in that case.

* module/ice-9/deprecated.scm (#\y): Indeed, #* is the valid bitvector
  syntax :)
2009-10-16 11:59:30 +02:00
Ludovic Courtès
cd48c32cf4 Fix compilation of literal bitvectors.
* libguile/arrays.c (scm_from_contiguous_typed_array): Fix BYTE_LEN
  sanity check for bitvectors.

* test-suite/tests/unif.test ("syntax")["bitvector is self-evaluating"]:
  New test.

* module/ice-9/deprecated.scm (#\y): Fix deprecation comment: `#*' is
  not a read syntax.
2009-10-15 23:29:50 +02:00
Andy Wingo
10fab72449 add back support for #y bitvector read syntax
* module/ice-9/deprecated.scm (#\y): Add deprecated support for
  #y(1 0 1 ...) bitvectors.
2009-10-15 15:05:36 +02:00