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

2036 commits

Author SHA1 Message Date
Andy Wingo
1ace4fbf3d add syntax-module
* module/ice-9/psyntax.scm (syntax-module): New accessor for syntax
  objects.
* module/ice-9/psyntax-pp.scm: Regenerate.

* module/ice-9/boot-9.scm: Declare syntax-module.

* doc/ref/api-macros.texi: Document it.
2012-01-25 20:34:17 +01:00
Andy Wingo
3d51e57cfb add syntax-locally-bound-identifiers
* module/ice-9/boot-9.scm (syntax-locally-bound-identifiers): Declare
  variable.
* module/ice-9/psyntax.scm: Add locally-bound-identifiers helper, and
  define syntax-locally-bound-identifiers.
* module/ice-9/psyntax-pp.scm: Regenerated.
* doc/ref/api-macros.texi: Document the new procedure.
2012-01-25 20:34:16 +01:00
Andy Wingo
e5cf97290c better function prologue disassembly
* module/language/assembly/disassemble.scm (code-annotation): Add an
  annotation for assert-nargs-ee/locals and assert-nargs-ge/locals.
2012-01-25 18:49:43 +01:00
Andy Wingo
d646d81ec1 add another case in which to fold (values FOO) to FOO, for some FOO
* module/language/tree-il/peval.scm (peval): Fold (values
  'singly-valued-expression) to 'singly-valued-expression in contexts
  that expect multiple values, in addition to those that expect single
  values.
2012-01-25 10:42:54 +01:00
Andy Wingo
c3d5344a92 fix values miscompilation in push context with RA
* module/language/tree-il/compile-glil.scm (flatten-lambda-case): Fix
  miscompilation of `values' in a push context with RA.
* test-suite/tests/tree-il.test: Add low-level test for this
  miscompilation.
2012-01-25 10:37:25 +01:00
Ludovic Courtès
228e9ec137 vlist: Use (ice-9 format).
* module/ice-9/vlist.scm: Use (ice-9 format).
2012-01-24 10:03:02 +01:00
Andy Wingo
21ad60a1d2 current-filename canonicalizes path, remove add-to-path
* module/ice-9/boot-9.scm (current-filename): Canonicalize the path, so
  that the result is independent of the current directory, and so
  that `dirname' can traverse up the file system, as in the
  add-to-load-path example.
  (add-to-path): Remove.  The eval-when semantics make this macro too
  tricky to explain -- people will start using it on other path-like
  things, in lexical contours, whereas it only really makes sense with
  load-like paths at the toplevel.

* doc/ref/api-evaluation.texi (Loading): Fix link to load-with-path
  docs, and remove add-to-path docs.
2012-01-23 11:13:12 +01:00
Andy Wingo
925172cf52 add current-filename, add-to-path, add-to-load-path
* module/ice-9/boot-9.scm (current-filename, add-to-path)
  (add-to-load-path): New syntaxen.

* doc/ref/api-evaluation.texi (Loading): Move load-path related
  procedures to a new section:
  (Load Paths): Hither.  Document add-to-path and add-to-load-path.

* doc/ref/api-debug.texi (Source Properties): Document
  current-source-location and current-filename.

* doc/ref/api-modules.texi:
* doc/ref/guile-invoke.texi:
* doc/ref/scheme-using.texi: Update @ref for Load Paths change.
2012-01-21 00:08:17 +01:00
Andy Wingo
fb01fd8772 remove duplicate when/unless definitions
* module/rnrs/control.scm:
* module/sxml/ssax.scm:
* test-suite/lalr/common-test.scm: Remove local `when'/`unless'
  definitions.
2012-01-20 21:16:50 +01:00
Andy Wingo
9accf3d98f add when, unless
* module/ice-9/boot-9.scm (when, unless): New forms.

* doc/ref/api-control.texi (Conditionals): Add docs.  Rename this
  node from "if cond case".

* doc/ref/r6rs.texi:
* doc/ref/scheme-ideas.texi:
* doc/ref/srfi-modules.texi: Update referrers.
2012-01-20 19:51:45 +01:00
Andy Wingo
7d02e25661 avoid gensym when making labels in psyntax
* module/ice-9/psyntax.scm (gen-label): Avoid gensym, as we don't need
  to make symbols.

* module/ice-9/psyntax-pp.scm: Regenerate.
2012-01-19 13:08:19 +01:00
Andy Wingo
9b0975f1dc add syntax-local-binding
* module/ice-9/boot-9.scm (syntax-local-binding): New binding.

* module/ice-9/psyntax.scm: Locally define a fluid that holds the
  "transformer environment".  with-transformer-environment calls a
  procedure with the transformer environment, or raises an error if
  called outside the extent of a transformer.  Bind
  transformer-environment in expand-macro.
  (resolve-identifier): Backport this helper from master.
  (syntax-local-binding): New procedure to return binding information of
  a bound identifier (a lexical, macro, a pattern variable, a displaced
  lexical, a global, or some other form).

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

* doc/ref/api-macros.texi (Syntax Transformer Helpers): Add docs for
  syntax-local-binding, and syntax-source, and move some other
  descriptions to this new section.
2012-01-19 12:38:27 +01:00
Chris K. Jester-Young
222056dcf2 Call scm-error with the correct argument order.
* module/ice-9/boot-9.scm (catch, with-throw-handler): Switch the order
  of the error key and function name arguments.
2012-01-15 12:36:46 -05:00
Mark H Weaver
c5f6c2e47f Don't diverge when serializing cyclic lists during compilation
* module/language/glil/compile-assembly.scm (scheme-list?): Don't
  diverge when serializing cyclic lists.
2012-01-14 04:39:00 -05:00
Mark H Weaver
39eb0b7297 Fix serialization of #nil-terminated lists during compilation
* module/language/glil/compile-assembly.scm (scheme-list?): New
  predicate, like `list?' but requires that the last cdr must be '(),
  not #nil.

  (dump-object, dump-constants): Use `list' opcode to create a list only
  if it is terminated by '().  If it's terminated by #nil, we must use
  the more general `cons' opcode.
2012-01-14 03:27:35 -05: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
Andy Wingo
bbc2364a3e Merge commit 'cc8afa2b36'
Conflicts:
	module/ice-9/psyntax-pp.scm
	module/language/tree-il/peval.scm
2012-01-10 00:21:48 +01:00
Daniel Hartwig
0e947e1d14 permit non-date values for Expires header
* module/web/http.scm ("Expires"): Permit (some) non-date values.
2012-01-09 23:36:59 +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
be96155b50 ftw: Add an error' parameter to file-system-fold'.
* module/ice-9/ftw.scm (errno-if-exception): New macro.
  (file-system-fold): Add an `error' parameter.  Wrap `opendir' and STAT
  calls in `errno-if-exception' and call ERROR when appropriate.
  (file-system-tree): Provide an `error' procedure.  Return #f when
  FILE-NAME is unreadable.
  (scandir): Provide an `error' procedure.

* test-suite/tests/ftw.test (%top-builddir): New variable.
  (make-file-tree, delete-file-tree): New procedures.
  (with-file-tree): New macro.
  ("file-system-fold"): Update tests to add an `error' procedure.
  ["ENOENT", "EACCES", "dangling symlink and lstat", "dangling symlink
  and stat"]: New tests.
  ("file-system-tree")["ENOENT"]: New test.
  ("scandir")["EACCES"]: New test.

* doc/ref/misc-modules.texi (File Tree Walk): Update `file-system-fold'
  documentation.
2012-01-08 16:16:21 +01:00
Ian Price
ab66fb3cd1 `write-request-line' writes absolute paths, not absolute URIs.
* module/web/http.scm (write-request-line): RFC 2616 says that absolute
  paths are used to identify resources on an origin server.
2012-01-07 01:36:34 +01:00
Andy Wingo
eaaf94c4ec remove duplicate write-uri definition
* module/web/http.scm: Remove duplicate write-uri definition.
2012-01-07 01:26:00 +01:00
Andy Wingo
449bf60b81 deprecate fluid-let-syntax in favor of syntax-parameterize
* module/ice-9/psyntax.scm (syntax-parameterize): Rename from
  fluid-let-syntax.

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

* module/ice-9/boot-9.scm (define-inlinable): Use syntax-parameterize
  (and define-syntax-parameter).

* module/ice-9/deprecated.scm (fluid-let-syntax): Add deprecated shim.
2012-01-06 19:36:58 +01:00
Andy Wingo
286dc5e1c3 add define-syntax-parameter, same as define-syntax
* module/ice-9/psyntax.scm (define-syntax-parameter): New toplevel form.
  Will be used to implement syntax parameters, following Barzilay,
  Culpepper, and Flatt's 2011 SFP workshop paper, "Keeping it Clean with
  syntax-parameterize".  Adds a new binding type and definition form.

Conflicts:

	module/ice-9/psyntax.scm
2012-01-06 19:26:47 +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
Ludovic Courtès
a3989357b3 Regenerate `psyntax-pp.scm'.
* module/ice-9/psyntax-pp.scm: Regenerate.
2012-01-05 23:10:02 +01:00
Ludovic Courtès
f78a1ccede Raise an error for (begin) when `--disable-deprecated'.
* module/ice-9/psyntax.scm (define-expansion-constructors)[begin-form]:
  Emit a syntax-violation error for empty sequences when
  --disable-deprecated.

* test-suite/tests/syntax.test (pass-if-syntax-error): Fix typo in error
  message.
2012-01-05 22:38:06 +01:00
Mark H Weaver
2f50d0a897 Fix documentation for vhash-fold and vhash-fold-right
* doc/ref/api-compound.texi (VHashes): Add missing `init' parameter in
  documentation for vhash-fold and vhash-fold-right, and also improve
  description.

* module/ice-9/vlist.scm (vhash-fold, vhash-fold-right): Rename formal
  parameter `seed' to `init', to match documentation.  Improve
  docstrings.
2011-12-30 23:26:32 -05:00
Mark H Weaver
3004fe2624 Fix comment summarizing allocation table
* module/language/tree-il/analyze.scm (analyze-lexicals): Fix comment,
  which describes the compiler's allocation table, to match reality.
2011-12-30 23:15:57 -05: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
61fe8eafc2 HTTP: Fix qstring writing of cache-extension values
* module/web/http.scm ("Cache-Control"): Write string values using the
  default val writer, to get quoting correct.

* test-suite/tests/web-http.test (pass-if-round-trip): New helper.
  ("general headers"): Check that cache-extensions round trip properly.
2011-12-22 08:18:05 -05:00
Daniel Hartwig
321770b2a3 Extend handling of "Cache-Control" header.
* module/web/http.scm ("Cache-Control"): Value for `max-stale' is
  optional.  Strict validation for value-less directives (`no-store',
  etc.).  String values optional for "cache-extension" directives.
* test-suite/tests/web-http.test: Value for `max-stale' is optional.
2011-12-22 08:00:57 -05:00
Andy Wingo
cc8afa2b36 peval fix: (cons 1 #nil) is not (list 1)
* module/language/tree-il/peval.scm (peval): (cons FOO #nil) is not
  (cons FOO '()).

* test-suite/tests/tree-il.test ("partial evaluation"): Add a test.
2011-12-21 22:04:18 -05:00
Andy Wingo
fff39e1aa5 peval minor tweak
* module/language/tree-il/peval.scm (peval): Record residual values in
  both value and values contexts.  No test cases, it just seemed like a
  good idea.
2011-12-21 20:15:57 -05:00
Andy Wingo
dc65d1cf5b document invalidity of (begin) as expression; add back-compat shim
* doc/ref/api-control.texi (begin): Update to distinguish between
  splicing begin and sequencing begin.

* module/ice-9/psyntax.scm (expand-expr): Add a back-compatibility shim
  for `(begin)'.
* module/ice-9/psyntax-pp.scm: Regenerate.

* test-suite/tests/syntax.test: Update to run illegal (begin) test only
  if we are not including deprecated features.
2011-12-21 20:14:59 -05:00
Ludovic Courtès
a2c66014cf ftw: Include sub-directories in the result of `scandir'.
* module/ice-9/ftw.scm (scandir)[skip]: Keep NAME in the resulting list.

* test-suite/tests/ftw.test ("scandir")["top-srcdir"]: New test.
2011-12-19 22:25:30 +01:00
Andy Wingo
296004b3ba Merge remote-tracking branch 'origin/stable-2.0'
Conflicts:
	libguile/feature.c
	m4/gnulib-cache.m4
	module/ice-9/deprecated.scm
	module/language/tree-il/peval.scm
2011-12-19 18:00:28 +01:00
Andy Wingo
7cbadbc43d fix peval to preserve effects when folding (values) forms
* module/language/tree-il/peval.scm (singly-valued-expression?): New
  helper.
  (truncate-values): Use the helper.
  (make-operand): Minor refactor.
  (set-operand-residual-value!): Try to undo the effects of (values
  FOO), if the continuation will check itself for the correct number of
  values.
  (peval): Fold helpers into fold-constant.  Add a constant-expression?
  case for (values FOO).  Add a new context: "values", for contexts in
  which multiple values are allowed, either because of being in a tail
  context relative to a function, or because of let-values.  "value" is
  now for single values.  Don't visit operands for "values", as their
  binding form truncates to one value.  Add a case to fold (values ...)
  forms.  Fix folding of (lambda), to process the cases in values
  context instead of tail context (which could have been "value", which
  would cause the procedure to truncate).
2011-12-19 15:52:05 +01:00
Ludovic Courtès
fa8110f241 ftw: Fix typos/thinkos in file-system-fold' and scandir'.
* module/ice-9/ftw.scm (file-system-fold): Fix reference to STAT instead
  of ST.
  (scandir)[enter?]: Change the argument name to `dir', to avoid
  confusion.
  [skip]: Return RESULT, not #f.
2011-12-19 09:18:42 +01:00
Ludovic Courtès
de92987002 ftw: Clarify the behavior of `scandir' for flat files and unreadable dirs.
* module/ice-9/ftw.scm (scandir)[leaf]: Only add NAME when RESULT is a
  pair.
  [down]: Ignore RESULT.
  Start with #f instead of the empty list.

* test-suite/tests/ftw.test ("scandir")["flat file"]: New test.

* doc/ref/misc-modules.texi (File Tree Walk): Update `scandir'
  documentation accordingly.
2011-12-19 09:11:51 +01:00
Christian Persch
3cc21d7995 Add a deprecated alias for $expt
* module/ice-9/deprecated.scm: Add alias for $expt. $expt was removed
  in commit 6fc4d0124d but no deprecated
  alias was added in ad79736c68 like for
  all the other deprecated $sin, $cos, ... functions.
2011-12-19 01:15:19 +01:00
Ludovic Courtès
1629429d63 ftw: Add `scandir'.
Suggested by Nala Ginrut <nalaginrut@gmail.com>.

* module/ice-9/ftw.scm (scandir): New procedure.
* test-suite/tests/ftw.test ("scandir"): New test prefix.
* doc/ref/misc-modules.texi (File Tree Walk): Document `scandir'.
2011-12-18 21:18:38 +01:00
Ludovic Courtès
af98fafabf ftw: Add an optional stat' parameter to file-system-fold' and `-tree'.
* module/ice-9/ftw.scm (file-system-fold): Add an optional `stat'
  parameter.  Use it instead of `lstat'.  Handle the case where (STAT child)
  fails.
  (file-system-tree): Likewise, and pass it to `file-system-fold'.

* doc/ref/misc-modules.texi (File Tree Walk): Update the documentation
  of these functions.
2011-12-18 20:43:56 +01:00
Ludovic Courtès
243db01e51 Add file-system-fold' and file-system-tree' to (ice-9 ftw).
* module/ice-9/ftw.scm (file-system-fold, file-system-tree): New
  procedures.

* test-suite/tests/ftw.test (%top-srcdir, %test-dir): New variables.
  ("file-system-fold", "file-system-tree"): New test prefixes.

* doc/ref/misc-modules.texi (File Tree Walk): Document
  `file-system-tree' and `file-system-fold'.
2011-12-13 23:56:19 +01:00
Andy Wingo
bfe35b90ff Merge remote-tracking branch 'origin/stable-2.0'
Conflicts:
	configure.ac
2011-12-13 10:20:44 +01:00
Andy Wingo
ac16263bc1 add an apropos-hook to ice-9 session
* module/ice-9/session.scm: #:keyword-ify the define-module form, and
  export apropos-hook.
  (apropos-hook): New hook.
  (apropos, apropos-fold): Run the apropos-hook.
2011-12-12 23:42:04 +01:00
Andy Wingo
9670f238d4 current-input-port et al are srfi-39 parameters
* libguile/ports.c (scm_init_ports): Export the port fluids to Scheme,
  temporarily.

* module/ice-9/boot-9.scm (fluid->parameter): Turn `current-input-port'
  et al into srfi-39 parameters, backed by the exported fluids, then
  remove the fluids from the guile module.
  (%cond-expand-features): Add srfi-39.

* module/srfi/srfi-39.scm: Re-export features from boot-9.

* test-suite/tests/parameters.test: Add tests.
2011-12-10 21:37:19 +01:00
Ludovic Courtès
e7b2efd582 Add an exception printer for `getaddrinfo-error'.
* module/ice-9/boot-9.scm (getaddrinfo-error-printer): New procedure.
  Use it as the `getaddrinfo-error' exception printer.
2011-12-06 21:43:12 +01:00
Ludovic Courtès
bcec8858a8 peval: Truncate multiple values when extending the environment.
Reported by Cédric Cellier <rixed@happyleptic.org>.

* module/language/tree-il/peval.scm (truncate-values): New procedure.
  (make-operand): Call `truncate-values' SOURCE.

* test-suite/tests/tree-il.test ("partial evaluation"): New tests for
  multiple value truncation.
2011-12-06 21:36:49 +01:00