1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-05-01 04:10:18 +02:00
Commit graph

673 commits

Author SHA1 Message Date
Andy Wingo
c592de96c0 don't bother catching SIGSEGV et al in top-repl
* module/ice-9/boot-9.scm (exit-hook): Move up with the other hooks.
  (top-repl): Don't install handlers for SIGFPE, SIGILL, SIGSEGV, or
  SIGBUS, as they will have no effect.
2010-06-22 23:16:49 +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
6669cd8137 require-extension using syntax-case
* module/ice-9/boot-9.scm (require-extension): Implement using
  syntax-case.
2010-06-22 22:25:20 +02:00
Andy Wingo
1fdd5bec02 cond-expand in syntax-case
* module/ice-9/boot-9.scm: Some spacing improvements.
  (cond-expand): Reimplement in syntax-case.
2010-06-22 22:15:50 +02:00
Andy Wingo
1623ca6849 more aspiration in boot-9
* module/ice-9/boot-9.scm: Spacing fixes for local-ref et al.
2010-06-22 21:47:15 +02:00
Andy Wingo
ec0f307ee9 begin-deprecated using syntax-case
* module/ice-9/boot-9.scm (begin-deprecated): In terms of syntax-case.
2010-06-22 21:43:09 +02:00
Andy Wingo
7cdd1615e0 relax restriction on _ in literals
* module/ice-9/psyntax.scm: Relax restriction on _ in literals.

* module/ice-9/psyntax-pp.scm: Regen.
2010-06-21 21:47:42 +02:00
Andy Wingo
b78d91d517 syntax-case treats _ as placeholder
* module/ice-9/psyntax.scm (underscore?): New helper, like ellipsis?.
  (syntax-case): Treat the _ pattern as a matches-all pattern,
  disallowing it from the keyword list. Another well-thought part of the
  R6RS.
  ($sc-dispatch): Dispatch _ patterns.

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

* test-suite/tests/syncase.test ("_ is a placeholder"): Add a test.
2010-06-21 20:56:05 +02:00
Andy Wingo
77b79cce0c freshly regenerate psyntax-pp
* module/ice-9/psyntax-pp.scm: A fresh regen to get the lowest gensyms
  we can. Needs a better solution in the end.
2010-06-21 11:02:00 +02:00
Andy Wingo
1052739b74 rnrs modules #:replace as appropriate
* module/ice-9/boot-9.scm (export!): New syntax, as export is to
  module-export!, export! is to module-replace!. I thought that taking
  up the name `replace' would be presumptuous, hence the name mismatch.

* module/ice-9/r6rs-libraries.scm (library): Calculate not only
  re-exports, but replacements as well.
2010-06-20 23:59:57 +02:00
Andy Wingo
0feb833d22 don't unconditionally restore signals in ensure-batch-mode!
* module/ice-9/boot-9.scm (ensure-batch-mode!): Remove comment about
  restoring signals, and that behavior, as it was making popen.test
  hang. I should investigate further, but instead I'm just going to hope
  that this fixes it.
2010-06-19 15:20:02 +02:00
Andreas Rottmann
b1e5445f77 Ignore the SRFI name component(s) in R6RS imports
* module/ice-9/r6rs-libraries.scm (resolve-r6rs-interface): To avoid having to
  create alias libraries for all the SRFIs, we simply ignore the name
  components, so (srfi :n foo bar) will resolve to (srfi :n).
2010-06-19 14:52:21 +02:00
Andreas Rottmann
e5b218826a ice-9 receive without define-macro
* module/ice-9/receive.scm: Replace define-macro usage with syntax-rules.
2010-06-19 14:51:48 +02:00
Andy Wingo
37620f3f4e set! name (lambda ...) names the lambda
* module/ice-9/psyntax.scm (build-lexical-assignment)
  (build-global-assignment): Maybe name the RHS.

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

* module/ice-9/boot-9.scm (catch, with-throw-handler, throw): Rework to
  use set! instead of define! so that we get names.
2010-06-19 13:56:16 +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
4c5412a288 no the-last-stack in ice-9 threads
* module/ice-9/threads.scm (thread-handler): Don't muck with
  the-last-stack.
2010-06-19 13:36:23 +02:00
Andy Wingo
27ae3651bd remove the-last-stack from boot-9
* module/ice-9/boot-9.scm (false-if-exception): Use syntax-rules. Don't
  muck with the-last-stack, it is going away. Remove a later comment
  about the-last-stack.
2010-06-19 13:35:36 +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
bfccdcd530 add support for variable transformers: settable identifier syntax
* module/ice-9/psyntax.scm (set!): Handle variable transformers; though,
  they cannot produce definitions.
  (make-variable-transformer): New procedure.
  (identifier-syntax): Allow the R6RS form that makes variable
  transformers.

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

* doc/ref/r6rs.texi (R6RS Incompatibilities): Remove letrec* item, and
  add set! restriction.
2010-06-19 12:43:40 +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
48201a94eb remove before-signal-stack
* module/ice-9/boot-9.scm (before-signal-stack): Remove. We're moving
  away from using the-last-stack, so this backup copy is not much use.
  (top-repl): Don't bother saving a before-signal-stack.

* module/ice-9/debugger/command-loop.scm (debugger-handler): No need to
  restore here either.
2010-06-18 13:01:14 +02:00
Andy Wingo
352b99c43d has-shown-debugger-hint? to scm-style-repl
* module/ice-9/boot-9.scm:
* module/ice-9/scm-style-repl.scm (has-shown-debugger-hint?): Move to
  scm-style-repl.
2010-06-18 12:54:22 +02:00
Andy Wingo
8942e7a1d7 reorder hooks in boot-9
* module/ice-9/boot-9.scm: Reorder hooks.
2010-06-18 12:51:43 +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
410e83c012 *unspecified* is identifier syntax
* module/ice-9/boot-9.scm (*unspecified*): Define using
  identifier-syntax. Should also prevent it from being set!.
  (unspecified?): Move up.
2010-06-18 11:46:41 +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
5f8c55ce3b fix order of internal definitions
* module/ice-9/psyntax.scm (chi-body): Whoops, actually render internal
  definitions into a letrec* in the right order.
* module/ice-9/psyntax-pp.scm: Regenerate.

* test-suite/tests/syntax.test: Add some letrec* tests.
2010-06-17 14:39:32 +02:00
Andy Wingo
417ee09802 compile-psyntax "optimizes" psyntax-pp
* module/ice-9/compile-psyntax.scm (source): "Optimize" psyntax-pp
  before writing it out.

* module/ice-9/psyntax-pp.scm: Regenerated.
2010-06-17 13:43:27 +02:00
Andy Wingo
9b3cc65965 resolve-primitives tweaks
* module/ice-9/boot-9.scm (make-struct/no-tail): Define a version of
  this function. Because during optimization we resolve make-struct to
  make-struct/no-tail, we need an implemented make-struct/no-tail if we
  are to be able to run scheme made from tree-il->scheme.

* module/language/tree-il/compile-glil.scm (*primcall-ops*): Remove
  variable-set case, as there is no "variable-set!" primitive.
  (flatten): Add a special hack for variable-set!. Ugly, I know.

* module/language/tree-il/primitives.scm (*effect-free-primitives*): Add
  make-struct/no-tail.
  (*effect+exception-free-primitives*): Remove make-struct, as it could
  raise an exception.
  (variable-set!): Remove expansion to variable-set.
2010-06-17 13:43:26 +02:00
Andy Wingo
0f2b9f6252 internal definitions expand out to letrec* instead of letrec
* module/ice-9/psyntax.scm (chi-body): Internal definitions are now
  letrec* instead of letrec, following the R6RS.

* module/ice-9/psyntax-pp.scm: Regenerated.
2010-06-17 13:43:26 +02:00
Andy Wingo
826373a25d psyntax, primitive expander, and memoizer support for letrec*
* libguile/expand.c (expand_letrec_helper): Factor out common code.
  (expand_letrec): Use expand_letrec_helper.
  (expand_letrec_star): New primitive syntax: letrec*.

* libguile/memoize.c (memoize): Add memoizer support for in-order letrec
  (letrec*).

* module/ice-9/psyntax.scm (build-letrec): Another arg, `in-order?'.
  (chi-body): Adapt to build-letrec change. We don't yet use letrec* for
  internal definitions.
  (letrec): Adapt to build-letrec change.
  (letrec*): New expander.

* module/ice-9/psyntax-pp.scm: Regenerated.
2010-06-17 13:43:26 +02:00
Andy Wingo
fb6e61ca21 beginnings of letrec* support in the expander
* libguile/expand.h (SCM_EXPANDED_LETREC_IN_ORDER_P)
  (SCM_MAKE_EXPANDED_LETREC): Add a new field to letrec, in-order?. Will
  be used to support letrec*.

* libguile/expand.c (LETREC, expand_named_let, expand_letrec): Adapt
  code.

* module/language/elisp/compile-tree-il.scm (compile-pair):
* module/ice-9/psyntax.scm (build-named-let, build-letrec): Pass #f for
  in-order? to `make-letrec'.

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

* module/language/tree-il.scm: Add letrec-in-order? accessor.
  (parse-tree-il, unparse-tree-il): Parse and unparse an in-order?
  letrec as `letrec*'.
  (tree-il->scheme): Serialize letrec*.
2010-06-17 13:43:26 +02:00
Ludovic Courtès
d967913f05 Use Alex Shinn's pattern matcher for (ice-9 match).
* module/ice-9/match.scm: Rewrite to simply load `match.upstream.scm'.

* module/ice-9/match.upstream.scm: New file.

* module/Makefile.am (NOCOMP_SOURCES): Add `ice-9/match.upstream.scm'.

* test-suite/Makefile.am (SCM_TESTS): Add `tests/match.test'.

* test-suite/tests/match.test: New file.
2010-06-17 00:45:21 +02:00
Andy Wingo
e44d2e4d98 remove encoding of versions into the file system (for now?)
* module/ice-9/boot-9.scm (find-versioned-module): Remove. Still had
  some bugs (e.g. for "." in the path and in finding compiled files),
  did too much computation and statting, and we don't really want to
  promote versioning. Nor do we want to hard-code a particular encoding
  of versions in the file-system. Perhaps the real way to do this is to
  be extensible somehow.
  (try-module-autoload): Just dispatch to primitive-load-path in all cases.

* module/rnrs
* module/rnrs.scm:
* module/rnrs/arithmetic/bitwise.scm:
* module/rnrs/arithmetic/fixnums.scm:
* module/rnrs/arithmetic/flonums.scm:
* module/rnrs/base.scm:
* module/rnrs/conditions.scm:
* module/rnrs/control.scm:
* module/rnrs/enums.scm:
* module/rnrs/eval.scm:
* module/rnrs/exceptions.scm:
* module/rnrs/files.scm:
* module/rnrs/hashtables.scm:
* module/rnrs/io/simple.scm:
* module/rnrs/lists.scm:
* module/rnrs/mutable-pairs.scm:
* module/rnrs/mutable-strings.scm:
* module/rnrs/programs.scm:
* module/rnrs/r5rs.scm:
* module/rnrs/records/inspection.scm:
* module/rnrs/records/procedural.scm:
* module/rnrs/records/syntactic.scm:
* module/rnrs/sorting.scm:
* module/rnrs/syntax-case.scm:
* module/rnrs/unicode.scm: Move these files, eliding the "6/" infix, so
  that they are in the normal (unversioned) module path.
2010-06-16 22:20:28 +02:00
Andy Wingo
e5602ce73e set module version in module-export-all!
* module/ice-9/boot-9.scm (module-export-all!): Set the interface
  version as well.
2010-06-16 21:32:52 +02:00
Andy Wingo
393929957d load modules from within a known environment
* module/ice-9/boot-9.scm (try-module-autoload): Init the module
  excursion with a fresh user module.
2010-06-16 09:38:36 +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
bb0c815741 attempted microoptimization in eval.scm.
* module/ice-9/eval.scm (primitive-eval): Try using list-ref instead of
  cdring in the vm. We'll check the hydra build times to see if this has
  any actual merit. Surely the best solution is another representation
  of environments, though.
2010-06-13 20:17:49 +02:00
Andy Wingo
10e69149f6 while in terms of syntax-case
* module/ice-9/boot-9.scm (while): Reimplement in terms of syntax-case.
  Prompt inlining is coming later.

* test-suite/tests/syntax.test ("while"): Update the expected syntax
  errors.
2010-06-11 16:58:36 +02:00
Andy Wingo
d71cc612c3 fix lexical call naming bug
* module/ice-9/psyntax.scm: Fix bug in which the whole syntax object was
  being recorded as the name of the operator in a lexical call, instead
  of just the symbolic name.
* module/ice-9/psyntax-pp.scm: Regenerated.
2010-06-11 16:58:36 +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
122f296ddc define-option-interface in terms of syntax-rules
* module/ice-9/boot-9.scm (define-option-interface): Rewrite using
  syntax-rules.
2010-06-11 16:58:31 +02:00
Andy Wingo
47aabe86ca a failed resolve-interface does not leave behind an empty module
* module/ice-9/boot-9.scm (resolve-interface): Pass #:ensure #f to
  resolve-module, so that in the case of module-not-found we don't leave
  behind an empty module without an interface.
2010-06-11 16:58:31 +02:00
Andy Wingo
befd1df991 cleanups to version-matches?
* module/ice-9/boot-9.scm (version-matches?): Some cleanups: use
  and-map, or-map; prefer case to cond; abbreviate and scope helper
  functions.
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