1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-05-02 13:00:26 +02:00
Commit graph

4577 commits

Author SHA1 Message Date
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
2a8a127bbe compile (ice-9 deprecated) earlier
* module/Makefile.am (ICE_9_SOURCES): Reorder placement of (ice-9
  deprecated), as it's getting bigger, so we should compile it earlier.
2010-06-11 23:04:42 +02:00
Andy Wingo
b920418560 handler of a prompt is in tail context
* module/language/tree-il/analyze.scm (analyze-lexicals): The handler of
  a prompt is in tail context.
2010-06-11 17:16:12 +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
322a36ce9f comment in fix-letrec
* module/language/tree-il/fix-letrec.scm (simple-expression?): Add a
  small FIXME.
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
2bcf97a643 unparse the tag of a prompt
* module/language/tree-il.scm (unparse-tree-il): Properly unparse the
  tag of a prompt.
2010-06-11 16:58:36 +02:00
Andy Wingo
38030bdf5d make-prompt-tag is an effect-free primitive
* module/language/tree-il/primitives.scm
  (*interesting-primitive-names*, *effect-free-primitives*): Recognize
  make-prompt-tag as interesting and effect-free.
2010-06-11 16:58:36 +02:00
Andy Wingo
0e4b781898 add inliner cases for conditionals
* module/language/tree-il/inline.scm (boolean-value, inline!): Add a
  case for inlining conditional expressions.

* test-suite/tests/tree-il.test: Fix conditional tests to have a
  non-inlinable condition.
2010-06-11 16:58:31 +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
Andy Wingo
b38507c1af comments in boot-9
* module/ice-9/boot-9.scm: Add comments.
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
4eeaf67c8c error in terms of case-lambda
* module/ice-9/boot-9.scm (error): Redefine using case-lambda.
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
02b582cef5 comments in boot-9
* module/ice-9/boot-9.scm: Add some comments about the nature of
  properties.
2010-06-11 00:13:12 +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
e979130b66 remove annotation?
* module/ice-9/boot-9.scm (annotation?): Remove unused new definition.
2010-06-10 23:39:19 +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
7e3147666b resolve-module #:ensure argument
* module/ice-9/boot-9.scm (resolve-module): Add #:ensure kwarg,
  defaulting to true. If true we make an empty module if none was found
  (the old behavior). Otherwise we return false.

* test-suite/tests/modules.test ("resolve-module"): Add tests for old
  and new behavior.
2010-06-10 20:03:15 +02:00
Andy Wingo
02fcbf78b2 Fix build bug, manifested as failure to find libguile-srfi-srfi-1-v-4
* module/ice-9/boot-9.scm (top-repl): This use of @ is not safe, because
  it will cause (system repl repl) to be loaded at expand time, which
  will eventually cause (srfi srfi-1) to be loaded, which won't work
  with a fresh build tree because the helper lib isn't compiled. Gross.
  (load): Add a note about why this use of @ is safe.
2010-06-10 17:53:47 +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
974a74d224 remove commented-out code from boot-9
* module/ice-9/boot-9.scm: Remove commented-out code.
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
222a2b19a1 fix error handling when reading debugger args
* module/system/vm/debug.scm (debugger-repl): Errors reading debugger
  args no longer drop us out of the debugger.
2010-06-10 14:15:26 +02:00
Andy Wingo
c7317beca6 bind debugging i/o ports in start-repl
* module/system/repl/repl.scm (start-repl): If the debugging ports are
  unbound, bind them to the current i/o ports. Allows errors within
  with-output-to-foo / with-input-from-foo to be sensibly debugged.
2010-06-10 14:15:26 +02:00
Andy Wingo
7b69cafd0a repl.scm simplifications
* module/system/repl/repl.scm (prompting-meta-read): Use
  call-with-error-handling.

* module/system/vm/debug.scm (call-with-error-handling): Add case for
  #:on-error 'pass. Have the catch handler return the unspecified value.
2010-06-10 14:15:26 +02:00
Andy Wingo
b93c34c0ca start cleaning up repl/debugger error handling
* module/system/repl/repl.scm (prompting-meta-read): Catch and print
  read errors here, returning unspecified in that case.
  (start-repl): Don't enable the debugger while reading expressions.
  Adapt with-backtrace to with-error-handling.

* module/system/vm/debug.scm (run-debugger, debugger-repl): No need to
  take a stack, the frames vector is sufficient.
  (call-with-error-handling, with-error-handling): New public utilities.
  Notably they do not poke the-last-stack.
2010-06-10 14:15:26 +02:00
Andy Wingo
11da3f2bd6 hygienic with-backtrace
* module/system/repl/repl.scm (with-backtrace): Make a syntax-rules
  macro.
2010-06-10 14:15:26 +02:00
Julian Graham
dc232ed059 Resolve issues in `find-versioned-module'.
* module/ice-9/boot-9.scm (find-versioned-module): Perform a stable sort on
  version numbers of matched libraries; eliminate extra path separator in
  library file path.
2010-06-09 23:57:25 -04:00
Andy Wingo
ffd48603b0 r6rs `import' accepts multiple clauses
* module/ice-9/r6rs-libraries.scm (import): Accept multiple clauses.

* test-suite/tests/rnrs-libraries.test: Add test.
2010-06-09 08:55:02 +02:00
Andy Wingo
78f79f18e2 modules have field for their filenames, for debugging
* module/ice-9/boot-9.scm (module-filename, set-module-filename!): Add a
  new field to modules, the filename that is associated with the module.
  For debugging purposes.
  (process-define-module): Parse out a #:filename argument.
  (make-module, make-autoload-interface): Adapt to module-constructor
  change.
  (define-module): Init module-filename from (current-source-location).
2010-06-07 00:33:57 +02:00
Andy Wingo
41147ee732 add current-source-location
* module/ice-9/boot-9.scm (current-source-location): New macro, returns
  the, um, current source location.
2010-06-06 23:21:24 +02:00
Andy Wingo
750ae8b7b7 add syntax-source accessor
* module/ice-9/psyntax.scm: Add syntax-source accessor.
* module/ice-9/psyntax-pp.scm: Regenerated.
* module/ice-9/boot-9.scm: Declare syntax-source.
2010-06-06 22:51:03 +02:00
Andy Wingo
de976b75cd srfi-34 #:replace raise fix
* module/srfi/srfi-34.scm: #:replace the binding for `raise'
2010-06-06 22:09:08 +02:00
Andy Wingo
625b43acc7 fix `format' with %f and exact rationals
* module/ice-9/format.scm (format:parse-float): Accept a number, and
  when stringifying the number, first convert to inexact.

* test-suite/tests/format.test ("~f fixed-point"): Add exact rational
  test.
2010-06-06 13:46:53 +02:00
Andy Wingo
f42d8bd8ff simplify macro representation in the wake of module hygiene changes
* module/ice-9/psyntax.scm (chi-install-global, chi-macro)
  (eval-local-transformer): Now that we handle module hygiene through
  syntax objects, there is no more need to record the current module
  when installing syntax transformers.

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

* libguile/_scm.h: Bump objcode version for macro representation change.

* libguile/macros.c (scm_macro_transformer): Adapt to change in macro
  representation.
2010-06-06 13:39:44 +02:00
Andy Wingo
9846796b6a fix module-hygiene corner case by relying more on syntax objects
* module/ice-9/psyntax.scm (chi-macro): Instead of assuming that output
  of a macro should be scoped relative to the module that was current
  when the macro was defined, allow the module information associated
  with the syntax object itself to pass through unmolested. Fixes bug
  29860.
  (datum->syntax): Propagate the module of the identifier through to the
  new syntax object, so that datum->syntax preserves module hygiene in
  addition to lexical hygiene.
  (include, include-from-path): Refactor to plumb though the hygiene
  information from the filename instead of the `include', allowing
  hygiene from the original caller of include-from-path to propagate
  through.

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

* test-suite/tests/syncase.test ("macro-generating macro"): Add test for
  bug 29860.
2010-06-06 13:00:59 +02:00
Andy Wingo
a96434cc33 source location propagation fixes in psyntax
* module/ice-9/psyntax.scm (syntax-type): Add some comments about source
  locations. In calls to chi-macro, pass the source location
  information. Propagate source location information when unpacking
  syntax objects.
  (chi-macro): Add a comment about source locations. Decorate output
  introduced by the macro with the source location of macro use.

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

Fixes bug #29817.
2010-06-05 19:40:43 +02:00
Andy Wingo
615eb45521 brown-paper-bag commit
* module/system/vm/debug.scm (frame->module): In which our author
  misunderstands git's index.
2010-06-02 22:56:10 +02:00
Andy Wingo
9a598c47f7 flesh out recursive repl module with local vars
* module/system/vm/debug.scm (frame->module): Actually bind frame-local
  variables to values in the new anonymous module. Setting settable vars
  should work too :)
2010-06-02 22:52:49 +02:00