bpt/guile.git
13 years agodon't bother catching SIGSEGV et al in top-repl
Andy Wingo [Tue, 22 Jun 2010 21:16:49 +0000 (23:16 +0200)]
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.

13 years agodeprecate named-module-use!, load-emacs-interface, and remove --emacs
Andy Wingo [Tue, 22 Jun 2010 20:34:23 +0000 (22:34 +0200)]
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.

13 years agorequire-extension using syntax-case
Andy Wingo [Tue, 22 Jun 2010 20:25:20 +0000 (22:25 +0200)]
require-extension using syntax-case

* module/ice-9/boot-9.scm (require-extension): Implement using
  syntax-case.

13 years agocond-expand in syntax-case
Andy Wingo [Tue, 22 Jun 2010 20:15:50 +0000 (22:15 +0200)]
cond-expand in syntax-case

* module/ice-9/boot-9.scm: Some spacing improvements.
  (cond-expand): Reimplement in syntax-case.

13 years agomore aspiration in boot-9
Andy Wingo [Tue, 22 Jun 2010 19:47:15 +0000 (21:47 +0200)]
more aspiration in boot-9

* module/ice-9/boot-9.scm: Spacing fixes for local-ref et al.

13 years agobegin-deprecated using syntax-case
Andy Wingo [Tue, 22 Jun 2010 19:43:09 +0000 (21:43 +0200)]
begin-deprecated using syntax-case

* module/ice-9/boot-9.scm (begin-deprecated): In terms of syntax-case.

13 years agoIntegrate complete R6RS standard libraries documentation.
Julian Graham [Tue, 22 Jun 2010 03:10:13 +0000 (23:10 -0400)]
Integrate complete R6RS standard libraries documentation.

* doc/ref/r6rs.texi: Reshuffle Andy Wingo's introductory notes; add more
  detailed @subsubsections for each library.

13 years agorelax restriction on _ in literals
Andy Wingo [Mon, 21 Jun 2010 19:47:42 +0000 (21:47 +0200)]
relax restriction on _ in literals

* module/ice-9/psyntax.scm: Relax restriction on _ in literals.

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

13 years agofix matches? test
Andy Wingo [Mon, 21 Jun 2010 19:06:29 +0000 (21:06 +0200)]
fix matches? test

* test-suite/tests/syntax.test (matches?): Unfortunately this relatively
  recent macro fails due to the underscore-in-literals-list prohibition.
  But, it seems I was in the minority wanting _ for a literal.

13 years agosyntax-case treats _ as placeholder
Andy Wingo [Mon, 21 Jun 2010 18:54:14 +0000 (20:54 +0200)]
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.

13 years agofix compilation with automake < 1.11
Andy Wingo [Mon, 21 Jun 2010 09:02:31 +0000 (11:02 +0200)]
fix compilation with automake < 1.11

* configure.ac: On automake < 1.11, define AM_DEFAULT_VERBOSITY so that
  our custom silent rules work.

13 years agofreshly regenerate psyntax-pp
Andy Wingo [Mon, 21 Jun 2010 09:02:00 +0000 (11:02 +0200)]
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.

13 years agofix rnrs duplicate bindings warnings
Andy Wingo [Sun, 20 Jun 2010 22:07:46 +0000 (00:07 +0200)]
fix rnrs duplicate bindings warnings

* module/rnrs.scm: Fix i/o duplicate bindings warnings by excluding some
  bindings.

13 years agornrs modules #:replace as appropriate
Andy Wingo [Sun, 20 Jun 2010 21:59:57 +0000 (23:59 +0200)]
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.

13 years agoensure unicode-capable rnrs string ports
Andy Wingo [Sun, 20 Jun 2010 21:15:29 +0000 (23:15 +0200)]
ensure unicode-capable rnrs string ports

* module/rnrs/io/ports.scm (open-string-input-port):
  (open-string-output-port): Ensure that the ports are unicode-capable
  by binding %default-port-encoding to "UTF-8".

13 years agoCanonicalize source file names in `primitive-load-path' (fix bug #30170).
Ludovic Courtès [Sun, 20 Jun 2010 14:57:06 +0000 (16:57 +0200)]
Canonicalize source file names in `primitive-load-path' (fix bug #30170).

* libguile/load.c (scm_primitive_load_path): Canonicalize
  FULL_FILENAME.  Fixes bug #30170 ("Auto-compilation erroneously
  recompiles dependencies").

14 years agorepl compiles with warnings by default
Andy Wingo [Sat, 19 Jun 2010 18:07:29 +0000 (20:07 +0200)]
repl compiles with warnings by default

* module/system/repl/command.scm (compile): Remove the bitrotten
  options.

* module/system/repl/common.scm (repl-default-options): Add
  'compile-options option.
  (repl-compile-options): Accessor for compile-options.
  (repl-compile): Use repl-compile-options.
  (repl-eval): Adapt to repl-compile interface change.

14 years agoscheme-mode in syntactic records test
Andy Wingo [Sat, 19 Jun 2010 13:40:47 +0000 (15:40 +0200)]
scheme-mode in syntactic records test

* test-suite/tests/r6rs-records-syntactic.test: Add -*- scheme -*-.

14 years agotypo in mutable-strings
Andy Wingo [Sat, 19 Jun 2010 13:40:25 +0000 (15:40 +0200)]
typo in mutable-strings

* module/rnrs/mutable-strings.scm: Fix typo.

14 years ago*unspecified* in rnrs exceptions
Andy Wingo [Sat, 19 Jun 2010 13:40:11 +0000 (15:40 +0200)]
*unspecified* in rnrs exceptions

* module/rnrs/exceptions.scm (rnrs): Import *unspecified*.

14 years agodon't unconditionally restore signals in ensure-batch-mode!
Andy Wingo [Sat, 19 Jun 2010 13:20:02 +0000 (15:20 +0200)]
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.

14 years agoFix SRFI-9 for records without fields
Andreas Rottmann [Sat, 19 Jun 2010 12:52:56 +0000 (14:52 +0200)]
Fix SRFI-9 for records without fields

* module/srfi/srfi-9.scm (define-record-type): Deal with fieldless records.
* test-suite/tests/srfi-9.test: Add a fieldless record definition.

14 years agoIgnore the SRFI name component(s) in R6RS imports
Andreas Rottmann [Sat, 19 Jun 2010 12:52:21 +0000 (14:52 +0200)]
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).

14 years agoice-9 receive without define-macro
Andreas Rottmann [Sat, 19 Jun 2010 12:51:48 +0000 (14:51 +0200)]
ice-9 receive without define-macro

* module/ice-9/receive.scm: Replace define-macro usage with syntax-rules.

14 years agoadd rnrs unicode to the compound rnrs module
Andreas Rottmann [Sat, 19 Jun 2010 12:51:04 +0000 (14:51 +0200)]
add rnrs unicode to the compound rnrs module

* module/rnrs.scm: import rnrs unicode and export all of its procedures.

14 years agofix ^L typo
Andy Wingo [Sat, 19 Jun 2010 12:45:03 +0000 (14:45 +0200)]
fix ^L typo

* module/rnrs/mutable-pairs.scm: Fix ^L typo.

14 years agoset! name (lambda ...) names the lambda
Andy Wingo [Sat, 19 Jun 2010 11:56:16 +0000 (13:56 +0200)]
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.

14 years agodeprecate the-last-stack
Andy Wingo [Sat, 19 Jun 2010 11:43:33 +0000 (13:43 +0200)]
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.

14 years agodon't bind the-last-stack in repl.scm
Andy Wingo [Sat, 19 Jun 2010 11:36:53 +0000 (13:36 +0200)]
don't bind the-last-stack in repl.scm

* module/system/repl/repl.scm (start-repl): Don't bind the-last-stack.

14 years agono the-last-stack in ice-9 threads
Andy Wingo [Sat, 19 Jun 2010 11:36:23 +0000 (13:36 +0200)]
no the-last-stack in ice-9 threads

* module/ice-9/threads.scm (thread-handler): Don't muck with
  the-last-stack.

14 years agoremove the-last-stack from boot-9
Andy Wingo [Sat, 19 Jun 2010 11:35:36 +0000 (13:35 +0200)]
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.

14 years agodeprecate save-stack, stack-saved?
Andy Wingo [Sat, 19 Jun 2010 10:57:31 +0000 (12:57 +0200)]
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).

14 years agoadd support for variable transformers: settable identifier syntax
Andy Wingo [Sat, 19 Jun 2010 10:43:40 +0000 (12:43 +0200)]
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.

14 years agohandle-system-error to scm-style-repl
Andy Wingo [Sat, 19 Jun 2010 09:43:48 +0000 (11:43 +0200)]
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.

14 years ago[build] Use UTC, precise format for ‘buildstamp’ value.
Thien-Thi Nguyen [Tue, 15 Jun 2010 23:01:05 +0000 (01:01 +0200)]
[build] Use UTC, precise format for ‘buildstamp’ value.

* libguile/Makefile.am (libpath.h): For ‘buildstamp’,
  specify date(1) output format precisely, and in UTC.
* doc/ref/api-options.texi (Build Config): Update ‘buildstamp’ doc.

14 years agoadd open-string-{input,output}-port to rnrs io ports
Andy Wingo [Fri, 18 Jun 2010 17:27:52 +0000 (19:27 +0200)]
add open-string-{input,output}-port to rnrs io ports

* module/rnrs/io/ports.scm (open-string-input-port)
  (open-string-output-port): New procedures.

* module/rnrs.scm (rnrs): Export the new (rnrs io ports) procedures.

14 years agoFix `define-condition-type' to use condition-accessors, not record
Julian Graham [Fri, 18 Jun 2010 13:49:30 +0000 (09:49 -0400)]
Fix `define-condition-type' to use condition-accessors, not record
accessors.

* module/rnrs/conditions.scm (define-condition-type): The generated
  accessors should be condition accessors, which know how to unpack a
  compound condition; these can then delegate to the appropriate record
  accessors.
* test-suite/tests/r6rs-conditions.test: New test case to verify above.

14 years ago`(debug)' debugs the current stack.
Andy Wingo [Fri, 18 Jun 2010 11:10:33 +0000 (13:10 +0200)]
`(debug)' debugs the current stack.

* module/system/vm/debug.scm (debug): Change to debug the current stack
  instead of the last stack.

14 years agoremove before-signal-stack
Andy Wingo [Fri, 18 Jun 2010 11:01:14 +0000 (13:01 +0200)]
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.

14 years agohas-shown-debugger-hint? to scm-style-repl
Andy Wingo [Fri, 18 Jun 2010 10:54:22 +0000 (12:54 +0200)]
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.

14 years agoreorder hooks in boot-9
Andy Wingo [Fri, 18 Jun 2010 10:51:43 +0000 (12:51 +0200)]
reorder hooks in boot-9

* module/ice-9/boot-9.scm: Reorder hooks.

14 years agodefault-pre-unwind-handler to scm-style-repl
Andy Wingo [Fri, 18 Jun 2010 10:50:32 +0000 (12:50 +0200)]
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.

14 years agofinish deprecating pre-unwind-handler-dispatch
Andy Wingo [Fri, 18 Jun 2010 10:43:04 +0000 (12:43 +0200)]
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.

14 years agodeprecate `repl'
Andy Wingo [Fri, 18 Jun 2010 10:30:45 +0000 (12:30 +0200)]
deprecate `repl'

* module/ice-9/boot-9.scm:
* module/ice-9/deprecated.scm (repl): Deprecate.

14 years agobatch-mode? in terms of *repl-level*
Andy Wingo [Fri, 18 Jun 2010 10:28:18 +0000 (12:28 +0200)]
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*.

14 years ago*unspecified* is identifier syntax
Andy Wingo [Fri, 18 Jun 2010 09:46:41 +0000 (11:46 +0200)]
*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.

14 years agorepl whitespace fix
Andy Wingo [Fri, 18 Jun 2010 09:44:26 +0000 (11:44 +0200)]
repl whitespace fix

* module/system/repl/repl.scm: Fix whitespace.

14 years agodeprecate set-repl-prompt!
Andy Wingo [Fri, 18 Jun 2010 09:33:16 +0000 (11:33 +0200)]
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.

14 years agoadd repl-default-option-set! in (system repl common)
Andy Wingo [Fri, 18 Jun 2010 09:29:25 +0000 (11:29 +0200)]
add repl-default-option-set! in (system repl common)

* module/system/repl/common.scm (repl-default-option-set!): New
  interface.
  (repl-default-prompt-set!): New procedure, sets the 'prompt property
  in the default env.
  (repl-prompt): Use the 'prompt repl option if available.

14 years agoassert-repl-* and associated state variables to scm-style-repl
Andy Wingo [Fri, 18 Jun 2010 09:15:09 +0000 (11:15 +0200)]
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.

14 years agoUse AM_SILENT_RULES to pare down build output, ignore auto-generated files
No Itisnt [Fri, 4 Jun 2010 01:38:01 +0000 (20:38 -0500)]
Use AM_SILENT_RULES to pare down build output, ignore auto-generated files

* .gitignore: Ignore extra gnulib headers.
* am/snarf: Silent SNARF command
* am/guilec: Silent GUILEC command
* configure.ac: Use AM_SILENT_RULES when available
* guile-readline/Makefile.am:
* libguile/Makefile.am:
* srfi/Makefile.am:
* test-suite/standalone/Makefile.am: Silence snarf output

14 years agoDAY_1 nl_langinfo constants don't require <nl_types.h>
U-Cain\Mike [Thu, 17 Jun 2010 20:31:28 +0000 (13:31 -0700)]
DAY_1 nl_langinfo constants don't require <nl_types.h>

There is an incorrect conditional compilation requirement that
<nl_types.h> be present for DAY_1 to be defined.  This doesn't
agree with the LSB and causes make check to fail on Cygwin.

* libguile/i18n.c [HAVE_NL_TYPES_H]: modify conditional compilatiion

14 years agobuild psyntax-pp.go from psyntax.scm
Andy Wingo [Thu, 17 Jun 2010 15:52:11 +0000 (17:52 +0200)]
build psyntax-pp.go from psyntax.scm

* module/Makefile.am (ice-9/psyntax-pp.go): Build from psyntax.scm, so
  we get proper debugging information and variable names.

14 years agofix order of internal definitions
Andy Wingo [Thu, 17 Jun 2010 12:39:32 +0000 (14:39 +0200)]
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.

14 years agocompile-psyntax "optimizes" psyntax-pp
Andy Wingo [Thu, 17 Jun 2010 11:36:18 +0000 (13:36 +0200)]
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.

14 years agotree-il->scheme renders fix as letrec*
Andy Wingo [Thu, 17 Jun 2010 11:34:48 +0000 (13:34 +0200)]
tree-il->scheme renders fix as letrec*

* module/language/tree-il.scm (tree-il->scheme): Expand out to letrec*,
  as it doesn't matter, and this avoids a let when running through the
  evaluator.

14 years agoresolve-primitives tweaks
Andy Wingo [Thu, 17 Jun 2010 11:31:03 +0000 (13:31 +0200)]
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.

14 years agointernal definitions expand out to letrec* instead of letrec
Andy Wingo [Thu, 17 Jun 2010 11:03:01 +0000 (13:03 +0200)]
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.

14 years agocompiler support for letrec*
Andy Wingo [Thu, 17 Jun 2010 10:47:46 +0000 (12:47 +0200)]
compiler support for letrec*

* test-suite/tests/tree-il.test ("letrec"): Add some tests.
* module/language/tree-il/compile-glil.scm (flatten): Add support for
  compiling letrec* in its unoptimized form.

* module/language/tree-il/fix-letrec.scm (simple-expression?):
  Parameterize, so that letrec* will not treat `(car x)' as primitive
  (because it could raise an exception).
  (partition-vars): Lump unreferenced vars in with complex vars, when
  compiling letrec*.
  (fix-letrec!): No need to evaluate inits within a let for letrec*.

14 years agoadd effect+exception-free-primitive? predicate
Andy Wingo [Thu, 17 Jun 2010 09:58:31 +0000 (11:58 +0200)]
add effect+exception-free-primitive? predicate

* module/language/tree-il/primitives.scm
  (effect+exception-free-primitive?): New predicate, like
  effect-free-primitive?, but excludes accessors that could raise
  exceptions.

14 years agopsyntax, primitive expander, and memoizer support for letrec*
Andy Wingo [Thu, 17 Jun 2010 09:12:58 +0000 (11:12 +0200)]
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.

14 years agobeginnings of letrec* support in the expander
Andy Wingo [Thu, 17 Jun 2010 08:49:00 +0000 (10:49 +0200)]
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*.

14 years agofix bug in memoize
Andy Wingo [Thu, 17 Jun 2010 08:45:34 +0000 (10:45 +0200)]
fix bug in memoize

* libguile/memoize.c (memoize): Fix a bug where LETREC was being
  accessed as LET, and it just happened to coincide.

14 years agoRemove outdated sponsorship info from `THANKS'.
Ludovic Courtès [Wed, 16 Jun 2010 22:44:34 +0000 (00:44 +0200)]
Remove outdated sponsorship info from `THANKS'.

14 years agoUpdate `THANKS'.
Ludovic Courtès [Wed, 16 Jun 2010 22:42:20 +0000 (00:42 +0200)]
Update `THANKS'.

14 years agoUse Alex Shinn's pattern matcher for (ice-9 match).
Ludovic Courtès [Wed, 16 Jun 2010 22:06:20 +0000 (00:06 +0200)]
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.

14 years agoremove encoding of versions into the file system (for now?)
Andy Wingo [Wed, 16 Jun 2010 20:20:28 +0000 (22:20 +0200)]
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.

14 years agoset module version in module-export-all!
Andy Wingo [Wed, 16 Jun 2010 19:32:52 +0000 (21:32 +0200)]
set module version in module-export-all!

* module/ice-9/boot-9.scm (module-export-all!): Set the interface
  version as well.

14 years agoload modules from within a known environment
Andy Wingo [Wed, 16 Jun 2010 07:38:36 +0000 (09:38 +0200)]
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.

14 years ago[maint] Add configure.ac abstraction: GUILE_CONFIG_SCRIPT
Thien-Thi Nguyen [Tue, 15 Jun 2010 11:19:35 +0000 (13:19 +0200)]
[maint] Add configure.ac abstraction: GUILE_CONFIG_SCRIPT

* configure.ac (GUILE_CONFIG_SCRIPT): New ‘AC_DEFUN’; use it for:
check-guile, benchmark-guile, meta/guile, meta/uninstalled-env,
meta/gdb-uninstalled-guile, meta/guile-tools, libguile/guile-snarf,
libguile/guile-doc-snarf, libguile/guile-func-name-check,
libguile/guile-snarf-docs test-suite/standalone/test-use-srfi,
test-suite/standalone/test-fast-slot-ref.

14 years agoInit shell var properly in git-version-gen.
Thien-Thi Nguyen [Mon, 14 Jun 2010 19:57:01 +0000 (21:57 +0200)]
Init shell var properly in git-version-gen.

* build-aux/git-version-gen: Ensure shell var
is not influenced by an env var of the same name.

14 years agoAdd tmpfile(3) to libguile.
Thien-Thi Nguyen [Fri, 12 Feb 2010 15:01:16 +0000 (16:01 +0100)]
Add tmpfile(3) to libguile.

* libguile/posix.c (scm_tmpfile): New primitive.
* libguile/posix.h (scm_tmpfile): New func decl.

* doc/ref/posix.texi (File System): Document `tmpfile'.

14 years agofix bug in collect
Andy Wingo [Mon, 14 Jun 2010 08:46:02 +0000 (10:46 +0200)]
fix bug in collect

* module/ice-9/deprecated.scm (collect): Fix bug.

14 years agoattempted microoptimization in eval.scm.
Andy Wingo [Sun, 13 Jun 2010 18:17:49 +0000 (20:17 +0200)]
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.

14 years agocompile (ice-9 deprecated) earlier
Andy Wingo [Fri, 11 Jun 2010 21:04:42 +0000 (23:04 +0200)]
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.

14 years agohandler of a prompt is in tail context
Andy Wingo [Fri, 11 Jun 2010 15:16:12 +0000 (17:16 +0200)]
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.

14 years agowhile in terms of syntax-case
Andy Wingo [Fri, 11 Jun 2010 14:57:50 +0000 (16:57 +0200)]
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.

14 years agocomment in fix-letrec
Andy Wingo [Fri, 11 Jun 2010 14:56:56 +0000 (16:56 +0200)]
comment in fix-letrec

* module/language/tree-il/fix-letrec.scm (simple-expression?): Add a
  small FIXME.

14 years agofix lexical call naming bug
Andy Wingo [Fri, 11 Jun 2010 14:28:55 +0000 (16:28 +0200)]
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.

14 years agounparse the tag of a prompt
Andy Wingo [Fri, 11 Jun 2010 14:11:37 +0000 (16:11 +0200)]
unparse the tag of a prompt

* module/language/tree-il.scm (unparse-tree-il): Properly unparse the
  tag of a prompt.

14 years agomake-prompt-tag is an effect-free primitive
Andy Wingo [Fri, 11 Jun 2010 13:33:09 +0000 (15:33 +0200)]
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.

14 years agoadd inliner cases for conditionals
Andy Wingo [Fri, 11 Jun 2010 13:30:55 +0000 (15:30 +0200)]
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.

14 years agodeprecate `collect'
Andy Wingo [Fri, 11 Jun 2010 11:24:14 +0000 (13:24 +0200)]
deprecate `collect'

* module/ice-9/boot-9.scm:
* module/ice-9/deprecated.scm (collect): Deprecate, and fix to ensure
  sequential collection.

14 years agodefine-option-interface in terms of syntax-rules
Andy Wingo [Fri, 11 Jun 2010 11:14:03 +0000 (13:14 +0200)]
define-option-interface in terms of syntax-rules

* module/ice-9/boot-9.scm (define-option-interface): Rewrite using
  syntax-rules.

14 years agoa failed resolve-interface does not leave behind an empty module
Andy Wingo [Fri, 11 Jun 2010 10:55:44 +0000 (12:55 +0200)]
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.

14 years agocleanups to version-matches?
Andy Wingo [Fri, 11 Jun 2010 10:50:49 +0000 (12:50 +0200)]
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.

14 years agodeprecate get-option, for-next-option, display-usage-report, transform-usage-lambda
Andy Wingo [Fri, 11 Jun 2010 10:16:45 +0000 (12:16 +0200)]
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.

14 years agodeprecate `scheme-file-suffix'
Andy Wingo [Fri, 11 Jun 2010 09:40:31 +0000 (11:40 +0200)]
deprecate `scheme-file-suffix'

* module/ice-9/boot-9.scm:
* module/ice-9/deprecated.scm (scheme-file-suffix): Deprecate.

14 years agocomments in boot-9
Andy Wingo [Fri, 11 Jun 2010 09:36:57 +0000 (11:36 +0200)]
comments in boot-9

* module/ice-9/boot-9.scm: Add comments.

14 years agodeprecate `bad-throw'
Andy Wingo [Fri, 11 Jun 2010 09:31:21 +0000 (11:31 +0200)]
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.

14 years agoerror in terms of case-lambda
Andy Wingo [Fri, 11 Jun 2010 09:17:44 +0000 (11:17 +0200)]
error in terms of case-lambda

* module/ice-9/boot-9.scm (error): Redefine using case-lambda.

14 years agodeprecate has-suffix?
Andy Wingo [Thu, 10 Jun 2010 23:35:41 +0000 (01:35 +0200)]
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?.

14 years agocomments in boot-9
Andy Wingo [Thu, 10 Jun 2010 22:13:12 +0000 (00:13 +0200)]
comments in boot-9

* module/ice-9/boot-9.scm: Add some comments about the nature of
  properties.

14 years agodeprecate apply-to-args
Andy Wingo [Thu, 10 Jun 2010 21:55:35 +0000 (23:55 +0200)]
deprecate apply-to-args

* module/ice-9/boot-9.scm:
* module/ice-9/deprecated.scm (apply-to-args): Deprecate.

14 years agoremove annotation?
Andy Wingo [Thu, 10 Jun 2010 21:39:19 +0000 (23:39 +0200)]
remove annotation?

* module/ice-9/boot-9.scm (annotation?): Remove unused new definition.

14 years agoscm-style-repl -> (ice-9 scm-style-repl)
Andy Wingo [Thu, 10 Jun 2010 21:28:23 +0000 (23:28 +0200)]
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.

14 years agoresolve-module #:ensure argument
Andy Wingo [Thu, 10 Jun 2010 17:59:17 +0000 (19:59 +0200)]
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.

14 years agoexpt / integer-expt fixes
Andy Wingo [Thu, 10 Jun 2010 16:14:02 +0000 (18:14 +0200)]
expt / integer-expt fixes

* libguile/numbers.c (scm_integer_expt): Validate the first arg as a
  number.
  (scm_expt): Delegate to scm_integer_expt iff x is exact. Fixes
  fractions.test, which I broke recently

* test-suite/tests/numbers.test ("integer-expt"): Add test for
  (integer-expt #t 0).

14 years agoFix build bug, manifested as failure to find libguile-srfi-srfi-1-v-4
Andy Wingo [Thu, 10 Jun 2010 15:53:47 +0000 (17:53 +0200)]
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.

14 years agobrown-paper-bag to uninstalled-env
Andy Wingo [Thu, 10 Jun 2010 15:29:48 +0000 (17:29 +0200)]
brown-paper-bag to uninstalled-env

* meta/uninstalled-env.in: Fix lack of test.