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

2484 commits

Author SHA1 Message Date
Jason Earl
84dfde82ae fix response-body-port for responses without content-length
* module/web/response.scm (response-body-port): Correctly handle cases
  in which EOF terminates the body.
2013-03-10 19:23:31 +01:00
Andy Wingo
19113f1ca7 allow case-lambda expressions with no clauses
* module/ice-9/psyntax-pp.scm:
* module/ice-9/psyntax.scm (case-lambda, case-lambda*): Allow 0
  clauses.

* module/language/scheme/decompile-tree-il.scm (do-decompile):
  (choose-output-names):
* module/language/tree-il.scm (unparse-tree-il):
  (tree-il-fold, post-order!, pre-order!):
* module/language/tree-il/effects.scm (make-effects-analyzer):
* module/language/tree-il/cse.scm (cse):
* module/language/tree-il/debug.scm (verify-tree-il):
* module/language/tree-il/peval.scm (peval): Allow for lambda-body to be
  #f.

* libguile/memoize.c (memoize):
* module/language/tree-il/canonicalize.scm (canonicalize!): Give a body
  to empty case-lambda before evaluating it or compiling it,
  respectively.

* test-suite/tests/optargs.test ("case-lambda", "case-lambda*"): Add
  tests.
2013-03-09 11:16:31 +01:00
Andy Wingo
d0ecf8eb9e support calls and tail-calls with more than 255 formals
* module/language/tree-il/compile-glil.scm (flatten-lambda-case):
  Support calls and tail-calls with more than 255 formals.

* test-suite/tests/tree-il.test ("many args"): Add a test.
2013-03-07 13:59:18 +01:00
Andy Wingo
8d48877d2c ,option evaluates its right-hand-side
* doc/ref/scheme-using.texi (System Commands): Better documentation for
  ,option.

* module/system/repl/command.scm (option): Evaluate the RHS when setting
  an option.  Fixes bug 13076.
2013-03-07 11:29:01 +01:00
Andy Wingo
83dce818ec GUILE_INSTALL_LOCALE=1 during build
* doc/ref/Makefile.am (autoconf-macros.texi):
* libguile/Makefile.am (snarf2checkedtexi):
* module/Makefile.am (ice-9/psyntax-pp.scm.gen, ice-9/psyntax-pp.go):
* test-suite/Makefile.am (GUILE_AUTO_COMPILE):
* test-suite/standalone/Makefile.am (GUILE_INSTALL_LOCALE):
* test-suite/vm/Makefile.am (TESTS_ENVIRONMENT):
* am/guilec (.scm.go): Set GUILE_INSTALL_LOCALE to 1 during the build.
  Fixes bug 12887.
2013-03-07 11:02:33 +01:00
Ludovic Courtès
aacc689677 Fix handling of the *-gnux32 target.
* module/system/base/target.scm (triplet-pointer-size): Fix typo in the
  x32 triplet name.
* test-suite/tests/asm-to-bytecode.test (native-os): New procedure.
  (test-target): Use (native-word-size) only when both the CPU and OS
  match.
2013-02-28 09:42:45 +01:00
Ludovic Courtès
b946e08a6a Recognize the `x86_64.*-gnux32' triplet.
* module/system/base/target.scm (triplet-pointer-size): Add case for
  "^x64_64-.*-gnux32".
* test-suite/tests/asm-to-bytecode.test ("cross-compilation"):
  ["x86_64-unknown-linux-gnux32"]: New test.
2013-02-27 20:40:08 +01:00
Ludovic Courtès
9130ec74cf Check whether a triplet's OS part specifies an ABI.
* module/system/base/target.scm (cpu-word-size): Rename to...
  (triplet-pointer-size): ... this.  Update caller.  Take a triplet as
  the argument.  Check the `triplet-os' part when checking for equality
  with the host.  Add support "mips64.*-gnuabi64".
* test-suite/tests/asm-to-bytecode.test ("cross-compilation")
  [ "mips64el-unknown-linux-gnuabi64"]: New test.
2013-02-27 20:40:08 +01:00
Ludovic Courtès
cc2948aa31 Recognize mips64* as having 32-bit pointers by default.
* module/system/base/target.scm (cpu-word-size): Consider MIPS64 to
  default to n32 or o32.
* test-suite/tests/asm-to-bytecode.test ("cross-compilation")
  ["mips64el-unknown-linux-gnu"]: New test.
2013-02-27 20:40:08 +01:00
Andy Wingo
c085589b1c remove language/glil/decompile-assembly.scm
* module/language/glil/decompile-assembly.scm: Remove.  This module
  never worked, and even failed to compile.

* module/language/glil/spec.scm:
* module/Makefile.am: Remove references to (language glil
  decompile-assembly).
2013-02-24 15:50:09 +01:00
Andy Wingo
72ad03fcbd deprecate (ice-9 mapping)
* module/ice-9/mapping.scm: Add deprecation warning.
2013-02-24 15:11:14 +01:00
Daniel Hartwig
1746b8ffdb fix and update (ice-9 mapping)
* module/ice-9/mapping.scm (mapping-create-handle!): INIT is required.
  (mapping-ref): Rewrite.  Fix problem with DFLT.
  (hash-table-mapping-hooks): Drop DELETE-PROC, hash-table accessors
  only use ASSOC-PROC.  Add INIT to create-handle hook.  Use correct
  hash-table accessors.
  (make-hash-table-mapping): Drop DELETE-PROC.
  (hash-table-mapping): Rewrite.  Drop DELETE-PROC.
2013-02-24 14:41:56 +01:00
Andy Wingo
65fa392306 allow '/' in the prefix of UNC file names on windows
* module/ice-9/boot-9.scm (absolute-file-name?) [WINDOWS]: Allow '/' as
  well as '\' when detecting UNC names.
  (load-in-vicinity): Add a comment about the purpose of
  canonical->suffix.
2013-02-24 13:03:42 +01:00
Andy Wingo
90f51aba0d fix compilation of functions with more than 255 local variables.
* module/language/glil/compile-assembly.scm (glil->assembly): Fix case
  where there are more than 255 local variables.  Whoops!
2013-02-20 16:02:30 +01:00
Eli Zaretskii
854ada4f1a Fix startup of guile.exe on MS-Windows.
* module/system/base/compile.scm (call-with-output-file/atomic):  Call
  close-port before deleting the temporary file name, otherwise deletion
  fails on MS-Windows (cannot delete a file that is still open).
2013-02-19 16:34:50 +01:00
Andy Wingo
0725031fe3 add link to doc about UNC names
* module/ice-9/boot-9.scm (compile-time-case): Add link to docs about
  UNC names.
2013-02-19 15:09:32 +01:00
Andy Wingo
9b6316eabc better handling of windows file name conventions
* libguile/filesys.c (scm_system_file_name_convention): New function.
  Exported to Scheme only.

* module/ice-9/boot-9.scm (file-name-separator?, absolute-file-name?):
  New predicates.
  (file-name-separator-string): New global variable.
  (in-vicinity): Use the new procedures.
  (load-user-init, try-module-autoload): Use file-name-separator-string.
  (load-in-vicinity): Update canonical->suffix.  Consistently use the
  term "file name" throughout.

* module/ice-9/psyntax.scm (include): Use global `absolute-file-name?'.

* module/ice-9/psyntax-pp.scm: Regenerate.
2013-02-19 15:00:11 +01:00
Andy Wingo
9b977c836b Merge remote-tracking branch 'origin/stable-2.0'
Conflicts:
	libguile/array-handle.c
	libguile/deprecated.h
	libguile/inline.c
	libguile/inline.h
	module/ice-9/deprecated.scm
	module/language/tree-il/peval.scm
2013-02-18 17:59:38 +01:00
Andy Wingo
118ff892be deprecate generalized vectors in favor of arrays
* libguile/generalized-arrays.h:
* libguile/generalized-arrays.c (scm_c_array_length):
  (scm_array_length): New functions.

* module/ice-9/deprecated.scm:
* libguile/generalized-vectors.c:
* libguile/generalized-vectors.h:
* libguile/deprecated.h:
* libguile/deprecated.c (scm_generalized_vector_p)
  (scm_generalized_vector_length, scm_generalized_vector_ref)
  (scm_generalized_vector_set_x, scm_generalized_vector_to_list):
  Deprecate.

* libguile/uniform.c (scm_uniform_vector_to_list): Use
  scm_array_to_list.

* module/ice-9/boot-9.scm (case): Arrays are generalized vectors.

* module/srfi/srfi-4/gnu.scm (define-any->vector): Use the array
  functions instead of the generalized-vector functions.

* test-suite/tests/arrays.test: Remove generalized-vector->list test;
  covered by array->list test.

* test-suite/tests/bitvectors.test:
* test-suite/tests/bytevectors.test:
* test-suite/tests/srfi-4.test: Adapt to test using array interfaces
  instead of generalized-vector interfaces.

* doc/ref/api-compound.texi: Remove generalized vector docs.
* doc/ref/api-data.texi:
* doc/ref/srfi-modules.texi: Adapt.
2013-02-18 16:57:15 +01:00
Andy Wingo
91c763ee3f local rewrite for apply to a let-bound rest list
* module/language/tree-il/peval.scm (peval): Add a special-case inlining
  pattern for apply to a let-bound rest arg that preserves effect
  ordering.

* test-suite/tests/peval.test ("partial evaluation"): Add a test, and
  update an older test with a better result.
2013-02-15 15:20:40 +01:00
Andy Wingo
85edd670f5 inline call-with-values consumers with optional and/or rest args
* module/language/tree-il/peval.scm (peval): Inline call-with-values
  whose consumers have optional and rest arguments.

* test-suite/tests/peval.test ("partial evaluation"): Add test.
2013-02-15 14:21:21 +01:00
Andy Wingo
8598dd8d28 more rest argument inlining improvements
* module/language/tree-il/peval.scm (peval): Correct comment on
  find-definition, and allow a find-definition to fall back on a source
  expression.  Avoid copying non-constant expressions.

* test-suite/tests/peval.test ("partial evaluation"): Add a test that
  inlining rest arguments works with complicated argument expressions,
  and a test that order of effects in rest args is preserved.
2013-02-15 14:15:19 +01:00
Andy Wingo
d21537efb4 better inlining of `apply' with rest arguments
* module/language/tree-il/peval.scm (peval): Move up the find-definition
  helper.  Use it to speculatively destructure conses and lists into the
  tail position of an `apply' form.

* test-suite/tests/peval.test ("partial evaluation"): Add tests.
2013-02-15 12:11:29 +01:00
Andy Wingo
564f5e7054 procedures with rest arguments can get inlined
* module/language/tree-il/peval.scm (peval): Allow inlining of
  procedures with rest arguments.

* test-suite/tests/peval.test ("partial evaluation"): Add a test.
2013-02-15 11:19:10 +01:00
Andy Wingo
30c3dac7a6 peval can inline let-bound lambdas
* module/language/tree-il/peval.scm (peval): Better inlining of
  complicated operators.

* test-suite/tests/peval.test ("partial evaluation"): Add a couple
  tests.
2013-02-14 17:33:40 +01:00
Andy Wingo
10a467f398 allow (define-macro name (lambda ...))
* module/ice-9/boot-9.scm (define-macro): Allow define-macro NAME
  LAMBDA.  A bugfix.  Thanks to Akop Pogosian.
2013-02-12 09:40:55 +01:00
Andy Wingo
1d14478ffb (texinfo): add a command-spec for @math{}.
* module/texinfo.scm (texi-command-specs): Add `math' as inline-text.
2013-02-09 18:19:28 +01:00
Andy Wingo
ff95e10225 (texinfo docbook): informaltable is a block element.
* module/texinfo/docbook.scm (*sdocbook-block-commands*): informaltable
  is a block element.
2013-02-09 18:19:06 +01:00
Andy Wingo
9cdc5cdbe6 (texinfo plain-text): Pass @math{} through as-is.
* module/texinfo/plain-text.scm (tag-handlers): Pass `math' through
  as-is.
2013-02-09 18:18:28 +01:00
Andy Wingo
d4cab459d3 (texinfo serialize): don't break words when wrapping
* module/texinfo/serialize.scm (wrap): Don't break long words by
  default; that could break @-commands.
2013-02-09 18:17:48 +01:00
Mark H Weaver
3a3bea729f Add foreign types: ssize_t and ptrdiff_t.
* libguile/foreign.c (sym_ssize_t, sym_ptrdiff_t): New symbols.
  (scm_init_foreign): Add bindings for ssize_t and ptrdiff_t.

* module/system/foreign.scm: Export ssize_t and ptrdiff_t.

* doc/ref/api-foreign.texi (Foreign Types): Add docs.
2013-02-02 04:13:44 -05:00
Andy Wingo
180ac9d7b0 Merge remote-tracking branch 'origin/stable-2.0'
Conflicts:
	module/ice-9/psyntax-pp.scm
	module/ice-9/psyntax.scm
	module/language/bytecode/spec.scm
	module/language/tree-il/spec.scm
2013-01-31 11:52:42 +01:00
Mark H Weaver
ceb7f9cc12 Do not defer expansion of internal define-syntax forms.
* module/ice-9/psyntax.scm (expand-body): As required by R6RS, evaluate
  the right-hand-sides of internal 'define-syntax' forms and add their
  transformers to the compile-time environment immediately, so that the
  newly-defined keywords may be used in definition context within the
  same lexical contour.  Fixes #13509.
2013-01-31 01:05:58 -05:00
Mark H Weaver
32e3c505c3 Bump copyright year to 2013 in REPL greeting.
* module/system/repl/common.scm: Add not only 2013, but also 2012 to the
  copyright notice at the top of the file, since the file was changed in
  2012.
  (*version*): Bump copyright year to 2013 in REPL greeting.
2013-01-31 00:37:31 -05:00
Andy Wingo
e10c250928 add #:doctype-handler to xml->sxml
* module/sxml/simple.scm (read-internal-doctype-as-string): New helper.
  (xml->sxml): Add #:doctype-handler argument.

* doc/ref/sxml.texi (Reading and Writing XML): Document
  #:doctype-handler.  Fix some other examples, and fix the default value
  of #:declare-namespaces?.

* test-suite/tests/sxml.simple.test: Add all tests from the manual
  here.
2013-01-30 15:29:18 +01:00
Andy Wingo
1260fd0b2c quick fix to ssax.scm
* module/sxml/ssax.scm: Fix previous commit.
2013-01-30 13:55:59 +01:00
Andy Wingo
7e0f26eb0d fix ssax:warn to work as intended
* module/sxml/ssax.scm (ssax:warn): Fix to make more sense.
2013-01-30 13:52:47 +01:00
Ian Price
90baf8cdfe Fix argument count for various format string escape sequences.
* module/language/tree-il/analyze.scm (format-string-argument-count):
  Handle ~t and ~k options case-insensitively.
  ~! ~| ~/ ~q and ~Q should not update the min-count or max-count.
  ~^ returns the min-count and 'any
  + - # and ' should not increase the argument count.
* test-suite/tests/tree-il.test (*): Tests for new parameters.
2013-01-28 14:16:24 +00:00
Andy Wingo
a14b6e1825 xml->sxml argument can be a port or a string
* module/sxml/simple.scm (xml->sxml): Allow the optional arg to be a
  port or a string.
* doc/ref/sxml.texi (Reading and Writing XML): Update docs.
2013-01-28 12:01:16 +01:00
Andy Wingo
1488753a66 make (sxml simple)'s xml->sxml more capable
* module/sxml/simple.scm (xml->sxml): Add #:namespaces,
  #:declare-namespaces?, #:entities, #:default-entity-handler, and
  #:trim-whitespace? arguments.

* doc/ref/sxml.texi (Reading and Writing XML): Document the new
  options.
2013-01-28 11:54:11 +01:00
Andy Wingo
bb0615d015 ssax: treat *DEFAULT* as a fallback handler in entity alist
* module/sxml/upstream/SSAX.scm (ssax:handle-parsed-entity):
  Interpret *DEFAULT* as being a default handler procedure for parsed
  entities.  Includes test.
2013-01-28 10:52:47 +01:00
Andy Wingo
2b6fcf5b1f current-ssax-error-port is a parameter
* module/sxml/ssax.scm (current-ssax-error-port): Change to be a
  parameter.
2013-01-27 21:53:49 +01:00
Mark H Weaver
25645a0ac9 Fix source annotation bug in psyntax 'expand-body'.
* module/ice-9/psyntax.scm (expand-body): Apply source-annotation to an
  expression, not to the expression's compile-time environment.

* module/ice-9/psyntax-pp.scm: Regenerate.
2013-01-27 14:26:00 -05:00
Mark H Weaver
b34e25359a Add 'for-humans?' flag to <language> specifications.
* module/system/base/language.scm (<language>): Add 'for-humans?'
  field, and export new 'language-for-humans?' predicate.

* doc/ref/compiler.texi (Compiler Tower): Document.

* module/language/assembly/spec.scm, module/language/bytecode/spec.scm,
  module/language/glil/spec.scm, module/language/objcode/spec.scm,
  module/language/tree-il/spec.scm, module/language/value/spec.scm:
  Mark these languages as 'for-humans?'.
2013-01-27 10:16:40 -05:00
Ludovic Courtès
ed7c4a5d77 ecmascript: Fix conversion to boolean for non-numbers.
* module/language/ecmascript/base.scm (->boolean): Call `zero?' and
  `nan?' only when X is a number.
* test-suite/tests/ecmascript.test ("compiler"): Add test case.
2013-01-26 19:18:31 +01:00
Ludovic Courtès
4ff2133aa1 Clarify the copyright status of GOOPS.
* module/oop/goops.scm, module/oop/goops/active-slot.scm,
  module/oop/goops/composite-slot.scm, module/oop/goops/describe.scm:
  Add a copyright line for Érick Gallesio.  Mention the STk version
  GOOPS was derived from.  Remove mentions of the ‘COPYRIGHTS’ file.
  Thanks to Karl Berry <karl@freefriends.org> for pointing it out, and
  to Michael Djurfeldt <mikael@djurfeldt.com>.
2013-01-26 15:41:05 +01:00
Mark H Weaver
e70b663c24 Regenerate psyntax-pp.scm.
* module/ice-9/psyntax-pp.scm: Regenerate.  This should have been done
  in commit 84f5a82517 (`include' relative
  paths relative to including file).
2013-01-23 17:25:18 -05:00
Andy Wingo
a3df9ad9e6 oop goops save: fix compile-time availability of write-component
* module/oop/goops/save.scm (write-component)
  (write-component-procedure): Move definitions up so that syntax
  definition is available when compiling the rest of the file.
2013-01-23 16:53:54 +01:00
Andy Wingo
5da51ad78d Merge remote-tracking branch 'origin/stable-2.0' 2013-01-23 16:19:16 +01:00
Andy Wingo
0683c24d32 Merge remote-tracking branch 'origin/stable-2.0' 2013-01-23 16:13:10 +01:00