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

13086 commits

Author SHA1 Message Date
Thien-Thi Nguyen
dbd891c712 Update AUTHORS to reflect now-removed guile-snarf-docs-texi; nfc. 2010-07-22 22:55:02 +02:00
Thien-Thi Nguyen
395afce9f2 [maint] Remove unused script guile-doc-snarf.
* doc/ref/tools.texi (Doc Snarfing): Don't mention guile-doc-snarf.

* configure.ac (libguile/guile-doc-snarf): Delete ‘GUILE_CONFIG_SCRIPT’.

* libguile/Makefile.am (noinst_SCRIPTS): Remove guile-doc-snarf.
* libguile/.gitignore: Remove guile-doc-snarf.
* libguile/guile-doc-snarf.in: Delete file.

* module/scripts/doc-snarf.scm: Comment munging; nfc.

* AUTHORS: Update.
2010-07-22 21:10:38 +02:00
Thien-Thi Nguyen
3d9f7bd57e Add copyright notice to acinclude.m4.
* acinclude.m4: Add copyright notice, with years derived from "git log" output.
2010-07-22 14:25:27 +02:00
Thien-Thi Nguyen
39f7ae3135 [build] Move GUILE_CONFIG_SCRIPT to acinclude.m4.
* configure.ac (GUILE_CONFIG_SCRIPT): Move from here...
* acinclude.m4 (GUILE_CONFIG_SCRIPT): ...to here.
2010-07-22 14:24:04 +02:00
Thien-Thi Nguyen
6a6df18794 [maint] Avoid no-op config-subst for libguile/guile-func-name-check.
* configure.ac (libguile/guile-func-name-check): Remove ‘GUILE_CONFIG_SCRIPT’.
* libguile/Makefile.am (.c.doc): Look in $(srcdir) for awk script.
* libguile/guile-func-name-check: Rename from guile-func-name-check.in.
2010-07-22 14:17:26 +02:00
Thien-Thi Nguyen
648da03259 [build] Overhaul <errno.h>, <signal.h> cpp symbol extraction/checking.
* libguile/Makefile.am (BUILT_SOURCES): Delete cpp_err_symbols.c,
  cpp_sig_symbols.c; add cpp-E.c, cpp-SIG.c.
  (EXTRA_DIST): Delete cpp_signal.c, cpp_errno.c, cpp_err_symbols.in,
  cpp_err_symbols.c, cpp_sig_symbols.c, cpp_sig_symbols.in, cpp_cnvt.awk;
  add cpp-E.syms, cpp-E.c, cpp-SIG.syms, cpp-SIG.c.
  (error.x, posix.x): Update prereq list.
  (cpp_err_symbols.c, cpp_sig_symbols.c): Delete targets.
  (check_signals, check_errnos): Likewise.
  (.syms.c): New pattern rule.
  (chknew-E, chknew-SIG): New targets.
  (MOSTLYCLEANFILES): Delete cpp_err_symbols_here, cpp_err_symbols_diff,
  cpp_err_symbols_new, cpp_sig_symbols_here, cpp_sig_symbols_diff,
  cpp_sig_symbols_new.
* libguile/cpp-E.syms: Rename from libguile/cpp_err_symbols.in.
* libguile/cpp-SIG.syms: Rename from libguile/cpp_sig_symbols.in.
* libguile/error.c (scm_init_error): #include "libguile/cpp-E.c".
* libguile/posix.c (scm_init_posix): #include "libguile/cpp-SIG.c".
* libguile/cpp_cnvt.awk: Delete file.
* libguile/cpp_errno.c: Delete file.
* libguile/cpp_signal.c: Delete file.
2010-07-22 13:59:12 +02:00
Andy Wingo
12427934de fix git-version-gen to work with bsd sed and obsolete regexps
* configure.ac: Avoid + in git-version-gen sed script, as it doesn't
  work on BSD sed with obsolete regexps.
2010-07-21 12:34:15 +02:00
Ludovic Courtès
0b7f2eb8bf Start rewriting SRFI-1 in Scheme.
This partially reverts commit e556f8c3c6
(Fri May 6 2005).

* module/srfi/srfi-1.scm (xcons, list-tabulate, not-pair?, car+cdr,
  last, fold, list-index): New procedures.

* srfi/srfi-1.c (srfi1_module): New variable.
  (CACHE_VAR): New macro.
  (scm_srfi1_car_plus_cdr, scm_srfi1_fold, scm_srfi1_last,
  scm_srfi1_list_index, scm_srfi1_list_tabulate, scm_srfi1_not_pair_p,
  scm_srfi1_xcons): Rewrite as proxies of the corresponding Scheme
  procedure.

* test-suite/tests/srfi-1.test ("list-tabulate")["-1"]: Change exception
  type to `exception:wrong-type-arg'.

* benchmark-suite/benchmarks/srfi-1.bm: New file.

* benchmark-suite/Makefile.am (SCM_BENCHMARKS): Add
  `benchmarks/srfi-1.bm'.

* test-suite/standalone/Makefile.am (test_srfi_1_SOURCES,
  test_srfi_1_CFLAGS, test_srfi_1_LDADD): New variables.
  (check_PROGRAMS): Add `test-srfi-1'.
  (TESTS): Ditto.

* test-suite/standalone/test-srfi-1.c: New file.
2010-07-21 01:07:56 +02:00
Ludovic Courtès
927bf5e8cc Add vhash-fold*' in (ice-9 vlist)'.
* module/ice-9/vlist.scm (%vhash-fold*): New inline procedure.
  (vhash-fold*, vhash-foldq*, vhash-foldv*): New procedures.

* test-suite/tests/vlist.test ("vhash")["vhash-fold*", "vhash-fold*
  tail", "vhash-fold* interleaved", "vhash-foldq* degenerate"]: New
  tests.

* doc/ref/api-compound.texi (VHashes): Add `vhash-fold*' & co.
2010-07-21 00:28:58 +02:00
Andreas Rottmann
442eaa681b Fix random number generator on 64-bit platforms
* libguile/random.c (scm_c_random): On platforms where `unsigned long' has 64
  bit, generate up to 64 bit of randomness. This is expected by
  scm_c_random_bignum(), and hence was a serious distortion of the random value
  distribution for values exceeding 2^32. This change also fixes a crash when
  the `m' argument is a value above 2^32.
2010-07-19 22:40:56 +02:00
Andy Wingo
d68a81e038 recommend #:replace
* doc/ref/api-modules.texi (Creating Guile Modules): Update text to
  recommend #:replace.
* module/srfi/srfi-19.scm (current-time): #:replace.
2010-07-17 13:31:06 +02:00
Andy Wingo
1c05a2a16d use scm_malloc_pointerless to alloc aligned blocks in fallback
* libguile/continuations.c (SCM_DECLARE_STATIC_ALIGNED_ARRAY)
  (SCM_STATIC_ALIGNED_ARRAY)
* libguile/control.c (SCM_DECLARE_STATIC_ALIGNED_ARRAY)
  (SCM_STATIC_ALIGNED_ARRAY): Tweak backslashes. Use
  scm_malloc_pointerless to ensure alignment.
2010-07-17 13:31:06 +02:00
Andy Wingo
6f8d7b12bb SCM_I_FLUID_P -> SCM_FLUID_P
* libguile/fluids.h (SCM_FLUID_P): Change from SCM_I_FLUID_P.
  (SCM_I_FLUID_NUM, SCM_I_DYNAMIC_STATE_P, SCM_I_DYNAMIC_STATE_FLUIDS):
  Wrap in BUILDING_LIBGUILE ifdef.
2010-07-17 13:31:06 +02:00
Michael Gran
0f3a70cfa8 Enable character hex escapes by default
R6RS character hex escapes do not conflict with legacy Guile octal
character escapes, so they can be enabled by default.

* libguile/read.c (scm_read_character): modified
* test-suite/tests/reader.test: modify character escape tests
* doc/ref/api-data.texi: modified
* doc/ref/api-options.texi: modified
2010-07-17 04:16:57 -07:00
Michael Gran
211683cc5c open-file should handle binary mode and coding declarations
The open-file port should use the 8-bit ISO-8859-1 encoding when
a file is opened using mode "b".  Also, it should honor a "coding:"
declaration at the top of a file when reading files where it is present.

* libguile/fports.c (scm_open_file): modified
* test-suite/tests/ports.test: more tests for open-file
* doc/ref/api-io.texi (File Ports): more documentation for open-file
2010-07-17 03:50:52 -07:00
Andy Wingo
2e67eb6f2d remove (system vm debug)
* module/system/vm/debug.scm: Remove.
* module/Makefile.am: Update.

* module/system/repl/debug.scm: Add some TODOs and a commented-out
  function here.
2010-07-16 17:35:43 +02: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
cd8e32c5cd gut ice-9 debug
* module/ice-9/debug.scm: Gut, though we keep the module around for code
  Out There that uses it.

* module/ice-9/top-repl.scm (top-repl): Don't import (ice-9 debug)

* module/ice-9/debugger/commands.scm:
* module/ice-9/debugging/trace.scm:
* module/ice-9/emacs.scm: Remove ice-9 debug includes.
2010-07-16 17:35:43 +02:00
Andy Wingo
21476d8472 update tour.texi examples
* doc/ref/tour.texi (Running Guile Interactively): Update examples for
  formatting.
2010-07-16 17:35:43 +02:00
Andy Wingo
04ca20430b tour.texi updates
* doc/ref/tour.texi: Update Guile prompts for
  scheme@(guile-user)>. Update output to assume value-history is on. Lop
  and crop the bug reporting section -- it was too long.
2010-07-16 17:35:43 +02:00
Andy Wingo
3c0b7725ef update debugger docs
* doc/ref/api-debug.texi (Debug on Error): Update xref.
* doc/ref/scheme-using.texi (REPL Commands): New subsection.
  (Interactive Debugging): Rename from Interactive Debugger, to indicate
  that debugging is just part of the REPL. Update docs.
2010-07-16 17:35:43 +02:00
Andy Wingo
019fdc97d9 updates to system repl command
* module/system/repl/command.scm (help): Update docs on how to get help
  on a particular command.
  (load): Remove #:f flag.
2010-07-16 17:35:43 +02:00
Andy Wingo
720a91c131 lower fill-column in .dir-locals.el
* .dir-locals.el: Fill-columns back down to 72.
2010-07-16 17:35:43 +02:00
Michael Gran
e50d921bd8 read-line should use port's encoding, not locale's encoding
* libguile/rdelim.c (scm_read_line): modified, use port's encoding
* test-suite/test/ports.test: new test
2010-07-16 06:44:59 -07:00
Michael Gran
daedbca7de More explicit variable names in scm_i_scan_for_encoding
Note especially that the variable 'i' has two different uses in this
function, and they get confused.

* libguile/read.c (scm_i_scan_for_encoding): cleanup
2010-07-16 05:39:52 -07:00
Ludovic Courtès
63479112d6 Remove heap allocations in scm_getc', scm_ungetc', and `find_valid_encoding'.
* libguile/ports.c (scm_getc): Provide `u32_conv_from_encoding' with the
  RESULT_BUF stack-allocated buffer to avoid heap allocation.
  (find_valid_encoding): Likewise.
  (scm_ungetc): Ditto with `u32_conv_to_encoding'.
2010-07-15 23:12:57 +02:00
Ludovic Courtès
d14418a535 Expose `scm_encoding_error'.
* libguile/strings.c (scm_encoding_error): Make public.

* libguile/strings.h (scm_encoding_error): New internal declaration.
2010-07-15 23:12:57 +02:00
Ludovic Courtès
88e41e94d3 sxml-match: Always use the same prompt tag.
* module/sxml/match.scm (%call/ec-prompt): New variable.
  (call/ec): Use it instead of creating a new prompt tag.
2010-07-15 23:12:57 +02:00
Ludovic Courtès
736aff0086 Declare `ice-9/psyntax-pp.scm.gen' as a phony target.
* module/Makefile.am (.PHONY): Add `ice-9/psyntax-pp.scm.gen'.
2010-07-15 23:12:57 +02:00
Andy Wingo
d286c8ce34 don't re-print the error by default in call-with-error-handling
* module/system/repl/error-handling.scm (call-with-error-handling):
  Previous post-error changed to "report"; now "catch", the default,
  doesn't re-print the error.
2010-07-15 12:47:58 +02:00
Andy Wingo
45f84beaf1 error-handling tweak
* module/system/repl/error-handling.scm (call-with-error-handling):
  Remove extra newline.
2010-07-15 12:46:02 +02:00
Andy Wingo
41e49280f3 better error reporting from the vm
* libguile/vm-engine.c: Add func_name local, for error reporting.
  (vm_error_apply_to_non_list): New error case.
  (vm_error_wrong_type_arg): Remove this generic error case.
  (vm_error_wrong_type_apply): Remove FUNC_NAME -- no sense in seeing
  "vm-debug-engine" in the error report.
  (vm_error_not_a_pair, vm_error_not_a_bytevector)
  (vm_error_not_a_struct, vm_error_not_a_thunk): Use func_name instead
  of FUNC_NAME, so we can indicate what caused the error.

* libguile/vm-i-scheme.c (VM_VALIDATE_CONS, car, cdr, set-car!)
  (set-cdr!): Indicate provenance of errors.
  (VM_VALIDATE_STRUCT, struct-vtable):
  (VM_VALIDATE_BYTEVECTOR, BV_FIXABLE_INT_REF, BV_INT_REF)
  (BV_FLOAT_REF, BV_FIXABLE_INT_SET, BV_INT_SET, BV_FLOAT_SET): Same.

* libguile/vm-i-system.c (apply, tail-apply): Use
  vm_error_apply_to_non_list.
2010-07-15 12:44:15 +02:00
Andy Wingo
867961f979 pass a frame to display-error in system repl error-handling
* module/system/repl/error-handling.scm (call-with-error-handling): Pass
  a frame to display-error.
2010-07-15 12:13:15 +02:00
Andy Wingo
218d580ab4 display-error takes a frame, shows source if possible
* libguile/backtrace.h:
* libguile/backtrace.c (scm_display_error): Change "stack" arg to
  "frame". Still accept stacks for backward compatibility.
  (display_header, display_error_body): Show the source of the error, if
  possible.
2010-07-15 12:11:34 +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
Julian Graham
3fdc1d05ae Fix argument passing for external hash functions in `(rnrs hashtables)'.
Guile implements this library in terms of SRFI-69, which is a bit vague on
the arity of hash functions, whereas `(rnrs hashtables)' explicitly
specifies unary ones.

* module/rnrs/hashtables.scm (wrap-hash-function): Assume SRFI-69 will pass
  the table capacity as the second argument; return the result of proc
  modulo the capacity.

* test-suite/tests/r6rs-hashtables.test (make-hashtable): New test case for
  hash functions that return large values.
2010-07-14 01:16:19 -04:00
Andy Wingo
5b69315ed3 fix '(] infinite loop
* libguile/read.c (scm_read_sexp): Fix reader infinite loop. Thanks to
  Bill Schottstaedt for the report.
* test-suite/tests/reader.test: Add test.
2010-07-13 21:53:41 +02:00
Andy Wingo
aa77dace40 fix psyntax-pp.go dependency
* module/Makefile.am (ice-9/psyntax-pp.go): Fix dep.
2010-07-13 10:48:19 +02:00
Andy Wingo
2f26a2266a ctrl-d with readline exits one recursive repl instance
* module/ice-9/buffered-input.scm (make-buffered-input-port): Instead of
  always returning EOF once EOF is seen once, call the producer again.
  Allows Ctrl-D to cause one EOF at the REPL, returning once from a
  recursive edit, but input continues normally. Thanks to Andrew
  Bagdanov for a clue that led to the fix.
2010-07-13 10:42:52 +02:00
Andy Wingo
dbb39d9c8b don't automatically generate psyntax-pp.scm any more
* module/Makefile.am (ice-9/psyntax-pp.scm.gen): No longer automatically
  regenerate psyntax-pp.scm, as the gensym dance is getting too
  complicated. Instead when you change psyntax.scm now you should make
  ice-9/psyntax-pp.scm.gen.
2010-07-13 10:42:52 +02:00
Ludovic Courtès
bd2057ff19 Have `benchmark-guile' honor the current $GUILE_LOAD_PATH.
* benchmark-guile.in (GUILE_LOAD_PATH): Extend the current value instead
  of overwriting it completely.
2010-07-13 00:08:09 +02:00
Ludovic Courtès
410f2f0ddc Add missing benchmark files to the distribution.
* benchmark-suite/Makefile.am (SCM_BENCHMARKS): Add
  `benchmarks/chars.bm' and `benchmarks/srfi-13.bm'.
2010-07-13 00:08:09 +02:00
Ludovic Courtès
7614c983a5 Fix type-checking in the optimized path of `string=?'.
* libguile/srfi-13.c (scm_string_eq): Properly type-check S1 and S2.

* test-suite/tests/strings.test ("string=?")["1st argument EOF", "2nd
  argument EOF"]: New tests exposing the problem.
2010-07-13 00:08:09 +02:00
Andy Wingo
0803914395 print column numbers in backtraces
* module/system/repl/debug.scm (print-frame): Print column numbers too.
2010-07-10 12:32:24 +02:00
Andy Wingo
5273854080 finally, backtraces only showing frames for the computation
* module/system/repl/repl.scm (run-repl): Run the thunk in a stack in a
  prompt, similar to the default prompt. Gives proper backtraces.

* module/system/repl/error-handling.scm (call-with-error-handling):
  Narrow one more outer frame, for the %start-stack thunk invocation.

* module/ice-9/boot-9.scm (%start-stack): Reindent.
2010-07-10 12:21:50 +02:00
Andy Wingo
dc3b266118 update manual for value history on by default
* doc/ref/compiler.texi: Update for new ,pp meta-command.
* doc/ref/scheme-using.texi (Using Guile Interactively): Show value
  history in examples.
  (Value Historyx): Update docs to mention the repl option and the
  programmatic interface.
2010-07-10 11:38:47 +02:00
Andy Wingo
c27d140ab4 validating repl options; value-history on by default
* module/system/repl/common.scm: Use (ice-9 history). Turns on value
  history by default.
  (repl-default-options): Expand the format of options to include an
  optional value transformer, run when setting a value. Add prompt and
  value-history options.
  (repl-prepare-eval-thunk): Use repl-option-ref.
  (repl-option-ref): Error if the option is unknown.
  (repl-option-set!, repl-default-option-set!): Error if the option is
  unknown. Pass the val through the transformer procedure.
  (repl-default-prompt-set!): Just use repl-default-option-set!.

* module/system/repl/command.scm (option): Update for the new options
  format.
2010-07-10 11:19:19 +02:00
Andy Wingo
8c8a13ecf5 value-history-enabled? accessor
* module/ice-9/history.scm (value-history-enabled?): Add accessor.
  (enable-value-history!, disable-value-history!): Adapt.
2010-07-10 11:16:16 +02:00
Andy Wingo
2b12193df2 heap/literal fixes for repl-default-options
* module/system/repl/common.scm (repl-default-options): Heap-allocate
  the repl-default-options, to avoid mutating a literal.
  (make-repl): Copy repl-default-options.
2010-07-10 10:49:01 +02:00
Andy Wingo
a38dd31ffc add utils to turn value history on and off, and to clear it
* module/ice-9/history.scm (enable-value-history!)
  (disable-value-history!, clear-value-history!): New exports.
2010-07-10 10:44:29 +02:00