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

531 commits

Author SHA1 Message Date
Andy Wingo
d489998364 Merge remote-tracking branch 'origin/stable-2.0'
There are a some failures currently:

    FAIL: tree-il.test: warnings: format: non-literal format string with forward declaration
    ERROR: srfi-18.test: current-exception-handler: current handler returned at top level - arguments: ((wrong-type-arg "car" "Wrong type argument in position ~A (expecting ~A): ~S" (1 "pair" #<unspecified>) (#<unspecified>)))
    ERROR: srfi-18.test: current-exception-handler: multiple levels of handler nesting - arguments: ((wrong-type-arg "car" "Wrong type argument in position ~A (expecting ~A): ~S" (1 "pair" #<unspecified>) (#<unspecified>)))
    ERROR: srfi-18.test: current-exception-handler: exception handler installation is thread-safe - arguments: ((wrong-type-arg "car" "Wrong type argument in position ~A (expecting ~A): ~S" (1 "pair" #<unspecified>) (#<unspecified>)))

Conflicts:
	module/language/tree-il/peval.scm
	module/language/tree-il/primitives.scm
	test-suite/tests/tree-il.test
2012-03-02 17:20:47 +01:00
Mark H Weaver
e082b13b66 pmatch: always wrap with let, even if the expression appears atomic
* module/system/base/pmatch.scm (pmatch): Always wrap with 'let', even
  if the expression appears atomic, because in the presence of
  'identifier-syntax', we cannot know what an atomic expression will
  later expand to.  Also use '#:export-syntax' instead of '#:export'
  to export 'pmatch'.
2012-03-01 16:16:27 -05:00
Andy Wingo
2988685d84 Merge remote-tracking branch 'origin/stable-2.0'
Conflicts:
	module/ice-9/psyntax-pp.scm
2012-02-15 23:04:53 +01:00
Mark H Weaver
db24306887 Fix typo in comment in message.scm: 'know' to 'known' warning types
* module/system/base/message.scm (%warning-types): Fix typo.
2012-02-14 23:39:22 -05:00
Andy Wingo
a41bed83ab Merge remote-tracking branch 'origin/stable-2.0'
Conflicts:
	libguile/read.c
	test-suite/tests/tree-il.test
2012-02-11 18:14:48 +01:00
Mark H Weaver
e7cf0457d7 Support => within case, and improve error messages for cond and case
* module/ice-9/boot-9.scm (cond, case): Reimplement using syntax-case,
  with improved error messages and support for '=>' within 'case' as
  mandated by the R7RS.  Add warnings for duplicate case datums and
  case datums that cannot be meaningfully compared using 'eqv?'.

* module/system/base/message.scm (%warning-types): Add 'bad-case-datum'
  and 'duplicate-case-datum' warning types.

* test-suite/tests/syntax.test (cond, case): Update tests to reflect
  improved error reporting.  Add tests for '=>' within 'case'.

* test-suite/tests/tree-il.test (partial evaluation): Update tests to
  reflect changes in how 'case' is expanded.

* doc/ref/api-control.texi (Conditionals): Document '=>' within 'case'.
2012-02-08 16:27:48 -05:00
Andy Wingo
dfadcf85cb Merge remote-tracking branch 'origin/stable-2.0'
Conflicts:
	libguile/debug.h
	module/ice-9/psyntax-pp.scm
	module/ice-9/psyntax.scm
	module/language/tree-il/peval.scm
	module/language/tree-il/primitives.scm
2012-01-30 20:27:35 +01:00
Mark H Weaver
505afe2832 Update user-visible copyright dates in manual and REPL to 2012
* doc/ref/guile.texi, module/system/repl/common.scm: Update
  user-visible copyright dates to 2012.
2012-01-30 00:33:31 -05:00
Ludovic Courtès
f5e772b2ba Fix a couple of warnings.
* module/scripts/list.scm: Use SRFI-1.
* module/system/repl/error-handling.scm: Use (ice-9 format).
2012-01-26 00:37:23 +01:00
Ludovic Courtès
60273407f9 Add warnings for unsupported `simple-format' options.
* module/language/tree-il/analyze.scm
  (format-analysis)[check-simple-format-args]: New procedure.  Use it.
  Add support for applications of <module-ref>.

* module/system/base/message.scm (%warning-types): Handle the `format
  simple-format' warning.

* module/language/scheme/spec.scm (scheme)[make-default-environment]:
  Use `simple-format' as the default `format'.

* test-suite/tests/tree-il.test ("warnings")["format"]: Explicitly use
  (@ (ice-9 format) format) where needed.
  ("simple-format"): New test prefix.
2012-01-26 00:35:46 +01:00
Andy Wingo
91ee7515da Merge remote-tracking branch 'origin/stable-2.0'
Conflicts:
	libguile/__scm.h
	libguile/array-map.c
	libguile/procprop.c
	libguile/tags.h
	module/ice-9/deprecated.scm
	module/ice-9/psyntax-pp.scm
	module/ice-9/psyntax.scm
	test-suite/standalone/test-num2integral.c
	test-suite/tests/regexp.test
2012-01-10 00:41:42 +01:00
Andy Wingo
0bdd43515e Merge commit 'f78a1ccede' 2012-01-10 00:23:49 +01:00
Ludovic Courtès
9d608ede96 Have `cpu-word-size' error out on unknown CPUs; add support for MIPSEL.
* module/system/base/target.scm (cpu-word-size): Add support for
  `mipsel'.  Call `error' when CPU is unknown.
2012-01-09 23:25:02 +01:00
Ludovic Courtès
b3da54d181 Placate a number of `syntax-check' verifications.
- "filesystem" -> "file system"
  - remove doubled words
  - use EXIT_* macros instead of literal numbers
  - update `syntax-check' exclusion files
2012-01-05 23:38:10 +01:00
Mark H Weaver
b72ab481cd Update comment: ~/.guile-ccache => ~/.cache/guile/ccache
* module/system/base/compile.scm: Update comment to match
  where the ccache dir now lives: ~/.cache/guile/ccache
2011-12-30 23:07:15 -05:00
Andy Wingo
04ec290f8b Merge remote-tracking branch 'origin/stable-2.0'
Conflicts:
	libguile/deprecation.c
	libguile/load.c
	libguile/print.c
2011-12-06 19:14:50 +01:00
Andy Wingo
2c27dd57c7 warnings written to warning port
* libguile/deprecation.c (scm_c_issue_deprecation_warning):
* libguile/load.c (auto_compile_catch_handler):
  (scm_sys_warn_auto_compilation_enabled, scm_primitive_load_path):
* module/ice-9/boot-9.scm (warn, %load-announce, duplicate-handlers)
  (load-in-vicinity):
* module/system/base/message.scm (warning): Write to the warning port.
  (*current-warning-port*): Alias the warning port.
2011-12-05 18:11:24 +01:00
Andy Wingo
2aef6c2ba9 ,language at REPL sets current-language
* module/system/repl/command.scm (language): Set the
  *current-language*.
* module/system/repl/repl.scm (start-repl): Create a new dynamic scope
  for *current-language*.
2011-12-04 21:56:13 +01:00
Andy Wingo
b2208d2e98 Merge remote-tracking branch 'origin/stable-2.0'
Conflicts:
	configure.ac
	libguile/fluids.c
	libguile/gc.c
	libguile/gc.h
	libguile/objcodes.c
	libguile/procprop.c
	libguile/vm.c
	module/ice-9/psyntax-pp.scm
	module/ice-9/psyntax.scm
2011-12-01 23:31:50 +01:00
Andy Wingo
9447207f0c Use default value for make-fluid in Scheme files
* module/ice-9/boot-9.scm (%exception-handler)
  (%running-exception-handlers, read-eval?, *repl-stack*)
  (make-mutable-parameter):
* module/ice-9/getopt-long.scm (%program-name):
* module/language/elisp/runtime.scm (built-in-macro, defspecial):
* module/srfi/srfi-39.scm (make-parameter/helper):
* module/system/base/language.scm (*current-language*):
* module/system/base/message.scm (*current-warning-port*):
  (*current-warning-prefix*):
* module/system/base/target.scm (%target-type, %target-endianness)
  (%target-word-size):
* module/texinfo/plain-text.scm (*indent*, *itemizer*):
* benchmark-suite/lib.scm (prefix-fluid):
* test-suite/lib.scm (prefix-fluid): Give fluids a useful default
  value.
2011-11-23 12:54:09 +01:00
Ludovic Courtès
de2c0a10fe Complete cross-compilation support.
* module/system/base/target.scm (%target-endianness, %target-word-size):
  New fluids.
  (%native-word-size): New variable.
  (with-target): Set these fluids.
  (cpu-endianness, cpu-word-size, triplet-cpu, triplet-vendor,
  triplet-os): New procedures.
  (target-cpu, target-vendor, target-os): Use them.
  (target-endianness, target-word-size): Refer to the corresponding
  fluid.

* libguile/objcodes.c (target_endianness_var, target_word_size_var): New
  global variables.
  (NATIVE_ENDIANNESS): New macro.
  (target_endianness, target_word_size, to_native_order): New functions.
  (make_objcode_from_file): Use `scm_bytecode_to_native_objcode' instead
  of `scm_bytecode_to_objcode'.
  (bytecode_to_objcode): New function, based on `scm_bytecode_to_objcode',
  with the addition of an `endianness' and `word_size' parameters.
  (scm_bytecode_to_objcode): Use it.
  (scm_bytecode_to_native_objcode): New function.
  (scm_write_objcode): Use `target_word_size' and `target_endianness'.
  Convert OBJCODE's len and meta-len to native byte order.
  (scm_init_objcodes): Initialize `target_endianness_var' and
  `target_word_size_var'.

* libguile/objcodes.h (scm_bytecode_to_native_objcode): New declaration.

* libguile/vm.c (really_make_boot_program): Use
  `scm_bytecode_to_native_objcode' instead of `scm_bytecode_to_objcode'.

* test-suite/tests/asm-to-bytecode.test (%objcode-cookie-size): New
  variable.
  (test-target): New procedure.
  ("cross-compilation"): Add `test-target' calls and the "unknown
  target" test.
2011-11-22 00:22:46 +01:00
Ludovic Courtès
e0a9f02224 Fix `validate-target' in (system base target).
* module/system/base/target.scm (validate-target): Accept any tuple with
  at least 3 parts.

* test-suite/tests/asm-to-bytecode.test (test-triplet): New procedure.
  ("cross-compilation"): New test prefix.
2011-11-22 00:22:46 +01:00
Andy Wingo
46e0923d35 fix bug in make-repl when lang is actually a language
* module/system/repl/common.scm (make-repl): Fix to accept language
  objects in addition to symbols.  Fixes http://debbugs.gnu.org/9857.
  Thanks to Tristan Colgate for the report.
2011-11-16 19:49:50 +01:00
Andy Wingo
4938d3cb74 Merge remote-tracking branch 'origin/stable-2.0'
Conflicts:
	GUILE-VERSION
	libguile/deprecated.c
	libguile/gc-malloc.c
	module/language/tree-il/peval.scm
2011-10-27 13:45:04 +02:00
Andy Wingo
c4e83f74c2 remove a stale comment
* module/system/foreign.scm (define-wrapped-pointer-type): Remove stale
  comment.
2011-10-24 12:48:36 +02:00
BT Templeton
74e4dd2798 set width for `,trace' command
* module/system/repl/command.scm (trace): Set trace width to terminal
  width by default.
2011-10-22 12:46:56 +02:00
Andy Wingo
d62dd76685 add ,expand and ,optimize
* module/system/repl/command.scm (*command-table*, expand, optimize):
  New meta-commands.
* module/system/repl/common.scm (repl-expand, repl-optimize): New
  helpers.

* doc/ref/scheme-using.texi (Compile Commands): Document.
2011-10-10 17:01:11 +02:00
Andy Wingo
0c65f52c6d more define-syntax-rule usage
* module/ice-9/boot-9.scm:
* module/ice-9/control.scm:
* module/ice-9/futures.scm:
* module/ice-9/optargs.scm:
* module/ice-9/poll.scm:
* module/ice-9/receive.scm:
* module/ice-9/threads.scm:
* module/ice-9/vlist.scm:
* module/language/assembly/compile-bytecode.scm:
* module/language/ecmascript/compile-tree-il.scm:
* module/language/tree-il.scm:
* module/oop/goops.scm:
* module/oop/goops/simple.scm:
* module/oop/goops/stklos.scm:
* module/srfi/srfi-1.scm:
* module/srfi/srfi-35.scm:
* module/srfi/srfi-39.scm:
* module/srfi/srfi-45.scm:
* module/srfi/srfi-67/compare.scm:
* module/sxml/match.scm:
* module/system/repl/error-handling.scm:
* module/system/repl/repl.scm:
* module/system/vm/inspect.scm:
* module/texinfo.scm:
* module/web/server.scm: Use define-syntax-rule, where it makes sense.
2011-09-02 11:36:14 +02:00
Andy Wingo
c1e3e9aaff more precision for ,time
* module/system/repl/command.scm (time): Use the high-precision timers
  instead of stime(2).  Changes the output format of `,time' too;
  perhaps there is a better way.
2011-07-07 09:57:19 +02:00
Andy Wingo
6934d9e75f fix generation of auto-compiled file names on mingw systems
* libguile/load.c (canonical_to_suffix, scm_primitive_load_path):
* module/ice-9/boot-9.scm (load-in-vicinity):
* module/system/base/compile.scm (compiled-file-name): If the canonical
  path of a file is a DOS-style path with a drive letter, turn it into a
  path suffix it by removing the colon and prefixing a "/".

Inspired by a patch from Jan Nieuwenhuizen.
2011-06-30 16:07:17 +02:00
Andy Wingo
c245d16a5b current-language really defaults to Scheme.
* module/system/base/language.scm (current-language): Default to 'scheme
  here, rather than relying on *current-language* always being bound.

Thanks to 亚光唐 <texnician@gmail.com> for the report.
2011-06-17 19:57:24 +02:00
Andy Wingo
42090217cf add (system base target)
* module/Makefile.am:
* module/system/base/target.scm: Add a minimal module to parameterize
  the target system type and inspect properties on it like cpu, vendor,
  os, endianness, and word size.
2011-05-31 11:18:28 +02:00
Andy Wingo
adf43b3f08 ignore SIGPIPE in (system repl server)
* module/system/repl/server.scm (run-server): Ignore SIGPIPE when we run
  a server, as otherwise a rudely disconnected client could cause the
  server to quit.  Thanks to John Proctor for the report, and Detlev
  Zundel for the debugging.
2011-04-11 10:13:48 +02:00
Andy Wingo
fb6df3ea13 fix error message on ,disassemble "non-procedure"
* module/language/objcode/spec.scm (decompile-value): Don't assume that
  `error' will handle format strings appropriately.
* module/system/repl/command.scm (disassemble): A more human error when
  you disassemble a non-procedure.

Bug reported by Andrew Horton.
2011-03-29 12:38:18 +02:00
Andy Wingo
56dbc8a899 rewrite ensure-writable-dir to not be racy
* module/system/base/compile.scm (ensure-writable-dir): Rewrite to not
  be racy.
2011-03-29 11:40:05 +02:00
Mark H Weaver
8099352769 Do not enter the debugger if the thrown key is in `pass-keys'
* module/system/repl/error-handling.scm (call-with-error-handling):
  Do _not_ enter the debugger if the thrown key is in `pass-keys'.
  Previously, for example, (throw 'quit) entered the debugger when run
  from the REPL, despite the fact that 'quit is in `pass-keys'.
2011-03-22 11:45:53 -04:00
Andy Wingo
bb455e4f94 allow ,option on-error report instead of debug
* module/system/repl/command.scm:
* module/system/repl/debug.scm (terminal-width): Move terminal-width
  here, make it thread-local, and export it.
  (print-locals, print-frame, print-frames): Default width to
  terminal-width.

* module/system/repl/error-handling.scm (call-with-error-handling): Add
  `report' and `backtrace' on-error handlers.

* module/system/repl/common.scm (repl-default-options): Add on-error
  REPL option, defaulting to `debug', but which may be changed.

* module/system/repl/repl.scm (run-repl): Pass the #:on-error REPL
  option to call-with-error-handling.
2011-03-17 12:39:59 +01:00
Andy Wingo
148c331769 add pointer->scm, scm->pointer
* libguile/foreign.c (scm_pointer_to_scm, scm_scm_to_pointer): New
  functions, useful to pass and receive SCM values to and from foreign
  functions.

* module/system/foreign.scm: Export the new functions.

* doc/ref/api-foreign.texi (Foreign Variables): Add docs.

* test-suite/tests/foreign.test ("pointer<->scm"): Tests.
2011-03-17 10:39:02 +01:00
Ludovic Courtès
ca33b501a9 Work around weak-value hash table bug in `define-wrapped-pointer-type'.
* module/system/foreign.scm (define-wrapped-pointer-type)[wrap]: Use
  `hash-ref' and `hash-set!' instead of `hash-create-handle!' and
  `set-cdr!'.
2011-03-13 16:09:55 +01:00
Andy Wingo
090f14b890 repl: terminal-width by default
* module/system/repl/command.scm (terminal-width): New parameter that
  will use the true terminal width if unset.
  (backtrace, locals): Default to (terminal-width).
  (width): Simplify.
2011-03-04 11:16:15 +01:00
Michael Gran
47b86dbf4d Add ,width meta-command to set screen width in debug output
This meta-command allows one to set the default number of columns
that output from ,backtrace and ,locals shall occupy.

* doc/ref/scheme-using.texi (Debug Commands): document ,width
* module/system/repl/command.scm (*width*): new var
  (backtrace, locals): use *width* in optarg
  (width): new meta-command
2011-03-04 11:01:48 +01:00
Andy Wingo
c7d6f8b279 fix ,stat
* module/system/repl/command.scm (statistics): Fix for BDW-GC.
  Unfortunately we still don't have mallocation or time taken.
2011-03-04 10:33:51 +01:00
Andy Wingo
65fa60ca7a repl.scm understands comments
* module/system/repl/repl.scm (read-comment, read-scheme-line-comment)
  (read-scheme-datum-comment): New helpers.
  (meta-reader): Take a language instead of a reader.  If we have a
  nonwhitespace char, first check to see that it's a comment, and if so,
  read it off and loop.
  (prompting-meta-read): Call meta-reader with the lang.
2011-03-03 23:51:20 +01:00
Andy Wingo
859e58ae8a repl.scm refactor
* module/system/repl/repl.scm (flush-leading-whitespace): Rename from
  next-char.
  (meta-reader): Use flush-leading-whitespace.
  (run-repl): Use flush-to-newline after the evaluation, which seems to
  be the same as what we did before.
2011-03-03 23:19:35 +01:00
Andy Wingo
dcb7c7ddf5 flush all input on a read error
* module/system/repl/repl.scm (flush-all-input): New helper.
  (prompting-meta-read): Flush all input on a read error, as we could be
  within some expression or a string or something.
2011-02-27 23:26:08 +01:00
Ludovic Courtès
d215190e5c Leave the default `*current-warning-prefix*' at the REPL.
* module/system/repl/common.scm (repl-compile): Leave the default
  `*current-warning-prefix*'.
2011-02-14 13:47:20 +01:00
Ludovic Courtès
5a79300f85 Add %auto-compilation-options', used by compile-file' when auto-compiling.
* module/ice-9/boot-9.scm (%auto-compilation-options): New variable.
  (load-in-vicinity): Honor it.

* libguile/load.c (kw_opts, sym_compile_file,
  sym_auto_compilation_options): New variables.
  (do_try_auto_compile): Honor %AUTO-COMPILATION-OPTIONS.

* module/system/repl/common.scm (repl-default-options): Have
  `compile-options' default to %AUTO-COMPILATION-OPTIONS.
2011-02-13 19:18:02 +01:00
Ludovic Courtès
a4060f6710 Add `*current-warning-prefix*'.
* module/system/base/message.scm (*current-warning-prefix*): New
  variable.
  (%warning-types): Honor `*current-warning-prefix*'.

* module/scripts/compile.scm (compile): Use an empty
  `*current-warning-prefix*'.

* module/system/repl/common.scm (repl-compile): Likewise.

* test-suite/tests/tree-il.test (call-with-warnings): Likewise.
2011-02-13 19:13:36 +01:00
Andy Wingo
6f06e8d35f autocompile -> auto-compile
* NEWS:
* check-guile.in:
* doc/guile.1:
* doc/ref/scheme-scripts.texi:
* libguile/init.c:
* libguile/load.c:
* libguile/load.h:
* libguile/script.c:
* module/Makefile.am:
* module/ice-9/boot-9.scm:
* module/scripts/compile.scm:
* module/system/base/compile.scm:
* test-suite/Makefile.am:
* test-suite/tests/popen.test: Change "autocompile" to "auto-compile" or
  "auto_compile", as appropriate, in variable names, function names,
  command line arguments, and the documentation.
2011-02-13 15:06:11 +01:00
Mark H Weaver
1a3152f7df Bump copyright date in REPL version string
* module/system/repl/common.scm (*version*): Add 2011 to copyright
  date range.
2011-02-12 13:00:43 +01:00