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

15149 commits

Author SHA1 Message Date
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
9133716faa Fix the exception type of the (begin) test.
* test-suite/tests/syntax.test (exception:zero-expression-sequence): New
  variable.
  ("begin")["legal (begin)"]: Rename to "valid (begin)".
  ["illegal (begin)"]: Ditto.  Expect `exception:zero-expression-sequence'.
2012-01-05 23:49:01 +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
fe2400c993 Fix erroneous check in `set-procedure-properties!'.
* libguile/procprop.c
  (scm_set_procedure_properties_x)[SCM_ENABLE_DEPRECATED == 1]: Pass arguments
  to `scm_assq' in the right order, and check its return value with
  `scm_is_true'.  Reported by Mike Gran <spk121@yahoo.com>.
2012-01-05 22:52:36 +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
4dbd29a9b8 Fix docs of string mutators to do so on a mutable string
* doc/ref/api-data.texi (String Modification): Change
  (define y "abcdefg") => (define y (string-copy "abcdefg"))
  before mutating the string bound to y in the example code.
2012-01-04 13:43:47 -05:00
Mike Gran
34a1045f7d Rework c-api.test to use test lib
The failure path for the c-api.test had been to call the undefined function
'fail', instead of logging the error like the other tests.

* test-suite/tests/c-api.test: modified
2012-01-04 08:02:05 -08:00
Ludovic Courtès
aed9483ba1 doc: Fix typo in `define-wrapped-pointer-type' example.
* doc/ref/api-foreign.texi (Void Pointers and Byte Access): Fix typo in
  `define-wrapped-pointer-type' example.
2012-01-03 23:31:30 +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
Daniel Llorens
848431b6b2 New array-map! and array-for-each tests
* ramap.test: New tests.
  - array-map! with noncompact arrays and more than one argument.
  - array-for-each with noncompact arrays and more than two arguments.
2011-12-22 17:13:07 -05:00
Andy Wingo
2b414e247f fix generalized-vector-{ref,set!} for slices
* libguile/generalized-vectors.c (scm_c_generalized_vector_ref):
  (scm_c_generalized_vector_set_x): Fix for the case in which base was
  not 1, lbnd was not 0, or inc was not 1.

* test-suite/tests/arrays.test (array): Add a test.  Thanks to Daniel
  Llorens for the report.
2011-12-22 17:03:04 -05:00
Andy Wingo
ba20d2629e freebsd itanium support
* libguile/threads.c (scm_ia64_register_backing_store_base)
  (scm_ia64_ar_bsp): Provide implementation of these itanium helpers on
  freebsd.  Thanks to Jim Pryor.
2011-12-22 10:30:45 -05:00
Andy Wingo
c1d5d6d755 freebsd implementation of get_thread_stack_base
* configure.ac: Check for pthread_np.h and pthread_attr_get_np.  Patch
  by Jim Pryor.
* libguile/threads.c (get_thread_stack_base): Provide an implementation
  for FreeBSD.
2011-12-22 10:28:23 -05:00
Andy Wingo
34cf38c3a2 stdlib.h, not malloc.h
* configure.ac: Remove check for malloc.h.

* libguile/gc-malloc.c:
* libguile/gc.c:
* libguile/mallocs.c:
* libguile/smob.c: Use stdlib instead of malloc.h.
2011-12-22 09:54:24 -05:00
Andy Wingo
e0a8221dcf Make the "Dia Primitives" section of the manual more clear.
* doc/ref/libguile-program.texi (Dia Primitives): Use
  scm_assert_smob_type, and update the text.
2011-12-22 09:32:09 -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
52b680f85e fix scm_protects deprecation warning
* libguile/gc.c: Fix warning about scm_protects being deprecated.
2011-12-19 15:55:07 +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
Andreas Schwab
a6ea740b3c FFI: Properly unpack small integer return values in closure call.
Fixes <http://debbugs.gnu.org/10203>.

* libguile/foreign.c (unpack): Add parameter return_value_p.
  Properly store integer return values smaller than int.
  (scm_i_foreign_call): Update call to unpack.
  (invoke_closure): Likewise.
2011-12-19 01:11:56 +01:00
Ludovic Courtès
46e78202f0 doc: Add link from `opendir' to (ice-9 ftw).
* doc/ref/posix.texi (File System): Add link to "File Tree Walk".
2011-12-18 21:27:56 +01:00
Ludovic Courtès
7948c5d9eb doc: Use @deffn {Scheme Procedure}' in misc-modules.texi'.
* doc/ref/misc-modules.texi: Use `@deffn {Scheme Procedure}' instead of
  `@defun'.
2011-12-18 21:25:24 +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
ed4c373966 Arrange to convert command-line arguments from the right encoding.
This is a temporary workaround for the 2.0 stable series.  The next
stable series should have an implicit `setlocale (LC_ALL, "")' call,
which will make this unnecessary.

* libguile/feature.c (progargs_fluid): Rename to...
  (scm_program_arguments_fluid): ... this.  Update users.

* libguile/feature.h (scm_program_arguments_fluid): New internal
  declaration.

* libguile/init.c (invoke_main_func): Call
  `scm_i_set_boot_program_arguments' instead of
  `scm_set_program_arguments'.

* libguile/script.c (locale_arguments_to_string_list,
  scm_i_set_boot_program_arguments): New functions.
  (scm_compile_shell_switches): Use `locale_arguments_to_string_list'.

* libguile/script.h (scm_i_set_boot_program_arguments): New internal
  declaration.

* test-suite/standalone/Makefile.am (check_SCRIPTS, TESTS): Add
  `test-command-line-encoding'.
* test-suite/standalone/test-command-line-encoding: New file.
2011-12-15 01:31:23 +01:00
Ludovic Courtès
c2c2b5a49b Use Gnulib's `localcharset', with local patches.
This follows Bruno Haible's suggestion at
<http://lists.gnu.org/archive/html/guile-devel/2011-11/msg00055.html>.

* m4/gnulib-cache.m4: Add `gl_LOCAL_DIR'; use `localcharset'.

* Makefile.am (EXTRA_DIST): Add gnulib-local/lib/localcharset.[ch].diff.
  (TESTS_ENVIRONMENT): New variable.

* gnulib-local/lib/localcharset.c.diff,
  gnulib-local/lib/localcharset.h.diff: New files.

* test-suite/Makefile.am (TESTS_ENVIRONMENT): Add
  @LOCALCHARSET_TESTS_ENVIRONMENT@.
* test-suite/standalone/Makefile.am (TESTS_ENVIRONMENT): Likewise.
2011-12-15 01:31:16 +01:00
Ludovic Courtès
a00c31bc46 Augment `.gitignore'. 2011-12-14 23:46:22 +01:00
Ludovic Courtès
7f1ea859ee Update Gnulib to v0.0-6703-g4e0358a. 2011-12-14 23:46:22 +01:00
Ludovic Courtès
1002c774e0 Use alignof_type' instead of alignof'.
* libguile/foreign.c: Use `alignof_type' instead of `alignof'; the
  latter was removed from Gnulib's <alignof.h> in
  408e170e3ae81f73fb65686c5834693d89a96594 (Nov. 1 2011).
* libguile/vm-i-scheme.c: Likewise.
2011-12-14 23:46:16 +01:00
Ludovic Courtès
9813088c28 doc: Set document encoding to UTF-8; typeset my surname correctly.
* doc/ref/guile.texi: Add @documentencoding.
* doc/ref/history.texi: Always write "Court@`es".
* doc/ref/preface.texi (Contributors): Likewise.
2011-12-14 22:26:15 +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
Chris K. Jester-Young
4eb286127c fix compilation with gc 7.1
* configure.ac: Add checks for GC_gcollect_and_unmap and
  GC_get_unmapped_bytes.
* libguile/gc-malloc.c (scm_realloc): GC_gcollect() if we don't have
  GC_gcollect_and_unmap.
* libguile/gc.c (GC_get_heap_usage_safe): Likewise, don't
  GC_get_unmapped_bytes if the function doesn't exist.
2011-12-08 21:14:06 +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
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