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

2036 commits

Author SHA1 Message Date
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
Andy Wingo
3098986b1a recursive repl support
* module/system/repl/common.scm (*repl-level*): New public fluid.
  (repl-prompt): If *repl-level* is a positive integer, add it to the
  prompt.

* module/system/repl/repl.scm (start-repl): The `lang' argument is now
  optional, and defaults to (current-language). New kwargs level and
  welcome; level defaults to 0, or 1+ the existing level, and the
  welcome is a boolean, true if level is 0. Parameterize *repl-level*
  during the dynamic extent of this repl. Also, parameterize
  the-last-stack to #f for the duration of this repl.

* module/system/vm/debug.scm (frame->module, debugger-repl): Stubs of a
  recursive repl implementation. The idea is to be a repl in the lexical
  context of the error; but it would be nice to be able to operate in
  the module of the proc too, for example to export bindings. Hmm.
2010-06-02 22:19:40 +02:00
Andy Wingo
4288533bb3 current-language fluid refactoring
* module/system/base/compile.scm:
* module/system/base/language.scm (*current-language*, current-language):
  Move this fluid and thunk down to (system base language).
2010-06-02 22:19:40 +02:00
Andy Wingo
3ece779a67 boot-9 top-repl tweak
* module/ice-9/boot-9.scm (top-repl): More concisely drill down to
  start-repl.
2010-06-02 22:19:40 +02:00
Andy Wingo
c08adae460 add #:version (6) to rnrs bytevectors and ports
* module/rnrs/bytevectors.scm:
* module/rnrs/io/ports.scm: Add #:version (6) to these modules.

* module/6/rnrs.scm: Add versions to the import specs for bytevectors
  and ports.
2010-06-02 22:19:40 +02:00
Andy Wingo
22cf27c815 fix procedure naming
* module/ice-9/psyntax.scm (define-expansion-accessors): New helper, to
  define accesors for a particular expansion data structure. Use it
  later to define lambda?, lambda-meta, and set-lambda-meta!.
  (maybe-name-value): Update to work with the newly defined accessors.
  (build-global-reference, build-let, build-named-let, build-letrec):
  Re-enable naming of procedures.

* module/ice-9/psyntax-pp.scm: Regenerated.
2010-06-02 16:07:11 +02:00
Andy Wingo
4c06cb2c2d (rnrs bytevectors) fallout
* module/Makefile.am (RNRS_SOURCES): Fix for (rnrs bytevectors) rename.
2010-06-01 14:04:01 +02:00
Andy Wingo
07d22c0259 rename (rnrs bytevector) to (rnrs bytevectors)
* module/rnrs/bytevectors.scm: Rename to (rnrs bytevectors), from (rnrs
  bytevector), to match the name from the R6RS.

* benchmark-suite/benchmarks/bytevectors.bm:
* doc/ref/api-data.texi:
* doc/ref/api-foreign.texi:
* libguile/bytevectors.c:
* module/6/rnrs.scm:
* module/language/assembly.scm:
* module/language/assembly/compile-bytecode.scm:
* module/language/assembly/decompile-bytecode.scm:
* module/language/glil/compile-assembly.scm:
* module/language/tree-il/primitives.scm:
* module/srfi/srfi-4.scm:
* module/srfi/srfi-4/gnu.scm:
* module/system/foreign.scm:
* test-suite/standalone/test-ffi:
* test-suite/tests/asm-to-bytecode.test:
* test-suite/tests/bytevectors.test:
* test-suite/tests/foreign.test:
* test-suite/tests/r6rs-ports.test: Update all referrers.
2010-06-01 13:26:11 +02:00
Julian Graham
04186f2006 Ignore explicit phase specification for imports in `library' form.
* module/ice-9/r6rs-libraries.scm (library): Unwrap the `for' sub-form
  during export resolution the same way that `import' does.
* test-suite/tests/rnrs-libraries.test ("implicit phasing"): New test
  prefix and tests.
2010-05-27 21:32:39 -04:00
No Itisnt
3d82d9a62d Add sources to module/Makefile.am
* module/Makefile.am: add srfi/srfi-9/gnu.scm to SRFI_SOURCES
2010-05-27 14:09:56 -05:00
No Itisnt
167510bc10 Record printer fixes
* doc/ref/srfi-modules.texi: Fix style

* module/srfi/srfi-9/gnu.scm (set-record-type-printer!): renamed from set-record-printer!
2010-05-27 14:09:56 -05:00
Ludovic Courtès
01fded8c77 sxml-match: Handle multiple-value returns.
* module/sxml/sxml-match.ss (sxml-match1): Invoke ESCAPE via
  `call-with-values'.

* test-suite/tests/sxml-match-tests.ss ("test multiple value returns"):
  New test.

* module/sxml/match.scm: Mention the modification.
2010-05-26 23:41:23 +02:00
No Itisnt
40b19fda5c Merge branch 'master' of git.sv.gnu.org:/srv/git/guile 2010-05-26 15:28:11 -05:00
Ludovic Courtès
400a5dcb8b Add (sxml match).
* module/Makefile.am (LIB_SOURCES): Add `sxml/match.scm'.
  (NOCOMP_SOURCES): Add `sxml/sxml-match.ss'.

* module/sxml/match.scm, module/sxml/sxml-match.ss: New files.

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

* test-suite/tests/sxml-match-tests.ss,
  test-suite/tests/sxml.match.test: New files.

* doc/ref/guile.texi (Guile Modules): Include `sxml-match.texi'.

* doc/ref/sxml-match.texi: New file.

* doc/ref/Makefile.am (guile_TEXINFOS): Add `sxml-match.texi'.
2010-05-25 23:31:36 +02:00
Ludovic Courtès
adb8f30600 Add copyight/license header in `compile-psyntax.scm'. 2010-05-25 23:31:36 +02:00
No Itisnt
6942d86409 * doc/ref/srfi-modules.texi:
* module/srfi/srfi-9/gnu.scm: rename `define-record-printer' to
  `set-record-printer!' to reflect the fact that the printer is set at runtime
2010-05-25 15:54:05 -05:00
No Itisnt
e525e4e499 add custom record printers
* doc/ref/srfi-modules.texi: update documentation
* module/srfi/srfi-9/gnu.scm: add `define-record-printer'
2010-05-25 15:47:35 -05:00
Ludovic Courtès
96640816c8 Fix disassembly of free variable lists.
* module/language/assembly/disassemble.scm (disassemble-free-vars):
  Handle FREE-VARS as a list, not a vector.
2010-05-22 23:54:16 +02:00
Andy Wingo
25f4cd87c2 boot-9 comment cleanup
* module/ice-9/boot-9.scm: Remove needless comment.
2010-05-21 23:44:15 +02:00
Andy Wingo
7df2621d72 lambda* in make-mutable-parameter
* module/ice-9/boot-9.scm (make-mutable-parameter): Use lambda*.
2010-05-21 23:43:58 +02:00
Andy Wingo
17ee350cb2 define* in repl-reader
* module/ice-9/boot-9.scm (repl-reader): Use define*.
2010-05-21 23:43:35 +02:00
Andy Wingo
d9113d47c6 define* in try-module-autoload
* module/ice-9/boot-9.scm (try-module-autoload): Use define*.
2010-05-21 23:43:16 +02:00
Andy Wingo
36d58fc31e define* in resolve-interface
* module/ice-9/boot-9.scm (resolve-interface): Use define* with proper
  keyword arguments, for great justice.
2010-05-21 23:42:54 +02:00
Andy Wingo
6b7d701e73 lambda* in resolve-module
* module/ice-9/boot-9.scm (resolve-module): Use lambda*.
2010-05-21 23:42:17 +02:00
Andy Wingo
5a6621244f define* in load-module
* module/ice-9/boot-9.scm (load-module): Use define*.
2010-05-21 23:41:49 +02:00
Andy Wingo
723ae5b370 define* in module-observe-weak
* module/ice-9/boot-9.scm (module-observe-weak): Use define*.
2010-05-21 23:37:54 +02:00
Andy Wingo
d6e70467ba define* in load
* module/ice-9/boot-9.scm (load): Use define*.
2010-05-21 23:37:35 +02:00
Andy Wingo
02851b26c7 case-lambda in dup->{in,out,}port, dup
* module/ice-9/boot-9.scm (dup->port, dup->inport, dup->outport, dup):
  Use case-lambda. Not particularly elegant.
2010-05-21 23:36:47 +02:00
Andy Wingo
52c9a3381d define* in file-set-position
* module/ice-9/boot-9.scm (file-set-position): Use define*.
2010-05-21 23:36:00 +02:00
Andy Wingo
d44a0d12b4 define* in record-constructor
* module/ice-9/boot-9.scm (record-constructor): Use define*.
2010-05-21 23:35:24 +02:00
Andy Wingo
b2669c41a7 define* in make-record-type
* module/ice-9/boot-9.scm (make-record-type): Use define*.
2010-05-21 23:34:54 +02:00
Andy Wingo
a4c8a02e09 lambda* in string-any, string-every
* module/ice-9/boot-9.scm (string-any, string-every): Use lambda*.
2010-05-21 23:34:06 +02:00
Andy Wingo
f31b7b6a1c lambda* in catch
* module/ice-9/boot-9.scm (catch): Use lambda*.
2010-05-21 23:33:28 +02:00
Andy Wingo
d648f56989 lambda* in make-prompt-tag
* module/ice-9/boot-9.scm (make-prompt-tag): Use lambda*.
2010-05-21 23:32:43 +02:00
Julian Graham
b766109224 Explicitly import `*unspecified*' to support R6RS library purification
enhancements.

* module/rnrs/6/hashtables.scm: Add explicit import for `*unspecified*'.
2010-05-20 21:46:12 -04:00
Julian Graham
2470bda772 Explicitly import `@@' to support R6RS library purification enhancements
on `master'.

* module/rnrs/6/conditions.scm:
* module/rnrs/6/exceptions.scm:
* module/rnrs/6/files.scm:
* module/rnrs/6/hashtables.scm:
* module/rnrs/io/6/simple.scm:
* module/rnrs/records/6/inspection.scm: Add explicit import for `@@'.
2010-05-20 21:18:04 -04:00
Julian Graham
5f29551e4d Fix broken imports in `(rnrs r5rs)'.
* module/rnrs/6/r5rs.scm (imports): Import `null-environment' from
  `(ice-9 safe-r5rs)'; import `scheme-report-environment' from
  `(ice-9 r5rs)'.
2010-05-20 21:18:04 -04:00
Julian Graham
d9c40da983 Fix incorrect export names in `(rnrs io simple)'.
* module/rnrs/io/6/simple.scm: with-input-file => with-input-from-file,
  with-output-file => with-output-to-file.
2010-05-20 21:18:04 -04:00
Julian Graham
2d56d2dfdd Implementation for R6RS (rnrs) composite library. (Can't be loaded yet
because of conflict between `syntax-case' transformer binding and
`(rnrs syntax-case)' hierarchical namespace module binding.)

* module/6/rnrs.scm: New file.
* module/Makefile.am: Add 6/rnrs.scm to RNRS_SOURCES.
2010-05-20 21:18:04 -04:00
Julian Graham
8794d769bd Test suite and fixes for R6RS (rnrs arithmetic fixnums).
* module/rnrs/arithmetic/6/fixnums.scm: Fix missing imports;
  (fixnum-width, greatest-fixnum, least-fixnum): Redefine these as
  zero-argument procedures; Fix argument mismatches in several functions.
* test-suite/Makefile.am: Add tests/r6rs-arithmetic-fixnums.test to
  SCM_TESTS.
* test-suite/tests/r6rs-arithmetic-fixnums.test: New file.
2010-05-20 21:18:04 -04:00
Julian Graham
b01818d752 Implementation and test cases for the R6RS (rnrs arithmetic flonums)
library.

* module/Makefile.am: Add rnrs/arithmetic/6/fixnums.scm and
  rnrs/arithmetic/6/flonums.scm to RNRS_SOURCES.
* module/rnrs/6/base.scm: (div-and-mod, div0, mod0, div0-and-mod0): New
  functions; this `div' implementation is not quite right, but we'll come
  back to it later.
* module/rnrs/arithmetic/6/fixnums.scm: New file.
* module/rnrs/arithmetic/6/flonums.scm: New file.
* test-suite/Makefile.am: Add tests/r6rs-arithmetic-flonums.test to
  SCM_TESTS.
* test-suite/tests/r6rs-arithmetic-flonums.test: New file.
2010-05-20 21:18:03 -04:00
Julian Graham
15ce5cafbc Implementation and test case for R6RS (rnrs eval) library.
* module/Makefile.am: Add rnrs/6/eval.scm to RNRS_SOURCES.
* module/rnrs/6/eval.scm: New file
* test-suite/Makefile.am: Add tests/r6rs-eval.test to SCM_TESTS.
* test-suite/tests/r6rs-eval.test: New file.
2010-05-20 21:18:03 -04:00