summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* Support typed arrays in some sort functionslloda-array-supportDaniel Llorens2016-07-113-83/+152
| | | | | | | | | * libguile/sort.c (sort!, sort, restricted-vector-sort!, sorted?): Support arrays of rank 1, whatever the type. * libguile/quicksort.i.c: Fix accessors to handle typed arrays. * test-suite/tests/sort.test: Test also with typed arrays.
* Remove uniform-array-read!, uniform-array-write from the manualDaniel Llorens2016-07-111-33/+0
| | | | | | | These procedures where removed in fc7bd367ab4b5027a7f80686b1e229c62e43c90b (2011-05-12). * doc/ref/api-compound.texi: Ditto.
* Remove commented stack version of scm_array_for_each_cell()Daniel Llorens2016-07-111-214/+0
| | | | * libguile/array-map.c: Ditto.
* Fix pool version of scm_array_for_each_cell by aligning pointersDaniel Llorens2016-07-111-17/+19
| | | | | * libguile/array-map.c (scm_array_for_each_cell): Align all pointers to pointer size.
* Fix a corner case with empty arrays in (array-for-each-cell)Daniel Llorens2016-07-112-51/+296
| | | | | | | * libguile/array-map.c (scm_array_for_each_cell): Bail out early if any of the sizes is zero. Pack ais at the end of the fake stack. * test-suite/tests/array-map.test: Add regression test.
* Clean up (array-for-each-cell)Daniel Llorens2016-07-117-253/+283
| | | | | | | | | | | | | | | | | | | * libguile/array-map.c (array-for-each-cell, array-for-each-cell-in-order): Moved from libguile/arrays.c. Fix argument names. Complete docstring. * libguile/array-map.h (array-for-each-cell, array-for-each-cell-in-order): Declarations moved from libguile/arrays.h. * test-suite/tests/array-map.test: Renamed from test-suite/tests/ramap.test, fix module name. Add tests for (array-for-each-cell). * test-suite/Makefile.am: Apply rename array-map.test -> ramap.test. * doc/ref/api-compound.texi: Minor documentation fixes.
* Avoid variable stack use in scm_array_for_each_cell()Daniel Llorens2016-07-111-13/+40
| | | | | | * libguile/arrays.c (scm_array_for_each_cell): Allocate all variable sized data at the top of the function using scm_gc_malloc_pointerless().
* Special case for array-map! with three argumentsDaniel Llorens2016-07-111-21/+35
| | | | | | | | | | | | | | | | | | | | | Benchmark: (define type #t) (define A (make-typed-array 's32 0 10000 1000)) (define B (make-typed-array 's32 0 10000 1000)) (define C (make-typed-array 's32 0 10000 1000)) before: scheme@(guile-user)> ,time (array-map! C + A B) ;; 0.792653s real time, 0.790970s run time. 0.000000s spent in GC. after: scheme@(guile-user)> ,time (array-map! C + A B) ;; 0.598513s real time, 0.597146s run time. 0.000000s spent in GC. * libguile/array-map.c (ramap): Add special case with 3 arguments.
* New export (array-for-each-cell-in-order)Daniel Llorens2016-07-112-1/+14
| | | | | | * libguile/arrays.h (array-for-each-cell-in-order): Declare. * libguile/arrays.c (array-for-each-cell-in-order): Define.
* Draft documentation for (array-for-each-cell)Daniel Llorens2016-07-111-45/+116
| | | | | | * doc/ref/api-compound.texi: New section 'Arrays as arrays of arrays'. Move the documentation for (array-from), (array-from*) and (array-amend!) in here. Add documentation for (array-for-each-cell).
* Draft of (array-for-each-cell)Daniel Llorens2016-07-112-2/+192
| | | | | | | | * libguile/arrays.c (scm_i_array_rebase, scm_array_for_each_cell): new functions. Export scm_array_for_each_cell() as (array-for-each-cell). * libguile/arrays.h (scm_i_array_rebase, scm_array_for_each_cell): prototypes.
* Do not use array handles in scm_vectorDaniel Llorens2016-07-113-41/+19
| | | | | | | | | | | | | | | | * libguile/vectors.c (scm_vector): Use SCM_I_VECTOR_WELTS on new vector instead of generic scm_vector_elements; cf. scm_vector_copy(). (scm_vector_elements): Forward to scm_vector_writable_elements(). (scm_vector_writable_elements): Remove special error message for weak vector arg. * libguile/generalized-vectors.c (SCM_VALIDATE_VECTOR_WITH_HANDLE): Remove unused macro. * libguile/array-handle.c (scm_array_handle_elements): Forward to scm_array_handle_writable_elements().
* Remove deprecated and unused generalized-vector functionsDaniel Llorens2016-07-112-37/+2
| | | | | | | * libguile/generalized-vectors.h, libguile/generalized-vectors.c (scm_is_generalized_vector, scm_c_generalized_vector_length, scm_c_generalized_vector_ref, scm_c_generalized_vector_set_x): These functions were deprecated in 2.0.9. Remove.
* Speed up for multi-arg cases of scm_ramap functionsDaniel Llorens2016-07-113-77/+86
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch results in a 20%-40% speedup in the > 1 argument cases of the following microbenchmarks: (define A (make-shared-array #0(1) (const '()) #e1e7)) ; 1, 2, 3 arguments. (define a 0) ,time (array-for-each (lambda (b) (set! a (+ a b))) A) (define a 0) ,time (array-for-each (lambda (b c) (set! a (+ a b c))) A A) (define a 0) ,time (array-for-each (lambda (b c d) (set! a (+ a b c d))) A A A) (define A (make-shared-array (make-array 1) (const '()) #e1e7)) (define B (make-shared-array #0(1) (const '()) #e1e7)) ; 1, 2, 3 arguments. ,time (array-map! A + B) ,time (array-map! A + B B) ,time (array-map! A + B B B) * libguile/array-map.c (scm_ramap): note on cproc arguments. (rafill): assume that dst's lbnd is 0. (racp): assume that src's lbnd is 0. (ramap): assume that ra0's lbnd is 0. When there're more than two arguments, compute the array handles before the loop. Allocate the arg list once and reuse it in the loop. (rafe): like rafe, when there's more than one argument. (AREF, ASET): remove.
* Remove deprecated array functionsDaniel Llorens2016-07-112-277/+0
| | | | | | | | | * libguile/array-map.c (scm_array_fill_int, scm_array_fill_int, scm_ra_eqp, scm_ra_lessp scm_ra_leqp, scm_ra_grp, scm_ra_greqp, scm_ra_sum, scm_ra_difference, scm_ra_product, scm_ra_divide, scm_array_identity): remove deprecated functions. * libguile/array-map.h: remove declaration of deprecated functions.
* Fix compilation of rank 0 typed array literalsDaniel Llorens2016-07-112-2/+10
| | | | | | | | * module/system/vm/assembler.scm (simple-uniform-vector?): array-length fails for rank 0 arrays; fix the shape condition. * test-suite/tests/arrays.test: test reading of #0f64(x) in compilation context.
* Don't use array handles in scm_c_array_rankDaniel Llorens2016-07-114-35/+35
| | | | | | | | | | | * libguile/arrays.c (scm_c_array_rank): moved from libguile/generalized-arrays.c. Don't use array handles, but follow the same type check sequence as the other array functions (shared-array-root, etc). (scm_array_rank): moved from libguile/generalized-arrays.h. * libguile/arrays.h: move prototypes here.
* Rename array-set-from!, scm_array_set_from_x to array-amend!, scm_array_amend_xDaniel Llorens2016-07-114-23/+25
|
* Tests & doc for array-from, array-from*, array-set-from!Daniel Llorens2016-07-112-11/+223
| | | | | | | | * test-suite/tests/arrays.test: tests for array-from, array-from*, array-set-from! * doc/ref/api-compound.texi: document array-from, array-from*, array-set-from!.
* New functions array-from, array-from*, array-set-from!Daniel Llorens2016-07-112-0/+159
| | | | | | | | | * libguile/arrays.h (scm_array_from, scm_array_from_s, scm_array_set_from_x): new declarations. * libguile/arrays.c (scm_array_from, scm_array_from_s, scm_array_set_from_x): new functions, export as array-from, array-from*, array-set-from!.
* Compile in C99 modeDaniel Llorens2016-07-111-17/+16
| | | | * configure.ac: Require C99 flags. Remove -Wdeclaration-after-statement.
* Reuse SCM_BYTEVECTOR_TYPED_LENGTH in scm_array_get_handleDaniel Llorens2016-07-113-16/+14
| | | | | | | | * libguile/bytevectors.h (SCM_BYTEVECTOR_TYPE_SIZE, SCM_BYTEVECTOR_TYPED_LENGTH): moved from libguile/bytevectors.c. * libguile/array-handle.c (scm_array_get_handle): reuse SCM_BYTEVECTOR_TYPED_LENGTH.
* Unuse array 'contiguous' flagDaniel Llorens2016-07-113-49/+36
| | | | | | | | | | | | | | | | | | | | | | SCM_I_ARRAY_FLAG_CONTIGUOUS (arrays.h) was set by all array-creating functions (make-typed-array, transpose-array, make-shared-array) but it was only used by array-contents, which needed to traverse the dimensions anyway. * libguile/arrays.c (scm_make_typed_array, scm_from_contiguous_typed_array): don't set the contiguous flag. (scm_transpose_array, scm_make_shared_array): don't call scm_i_ra_set_contp. (scm_array_contents): inline scm_i_ra_set_contp() here. Adopt uniform type check order. Remove redundant comments. (scm_i_ra_set_contp): remove. * libguile/arrays.h: note. * test-suite/tests/arrays.test: test array-contents with rank 0 array.
* Remove scm_from_contiguous_arrayDaniel Llorens2016-07-112-37/+0
| | | | | | | | | This function is undocumented, unused within Guile, and can be trivially replaced by make-array + array-copy without requiring contiguity. * libguile/arrays.h (scm_from_contiguous_array): remove declaration. * libguile/arrays.c (scm_from_contiguous_array): remove.
* Avoid unneeded internal use of array handlesDaniel Llorens2016-07-112-35/+85
| | | | | | | | | | * libguile/arrays.c (scm_shared_array_root): adopt uniform check order. (scm_shared_array_offset, scm_shared_array_increments): use the array fields directly just as scm_shared_array_root does. * test-suite/tests/arrays.test: tests for shared-array-offset, shared-array-increments.
* Add meta/build-envAndy Wingo2016-07-108-7/+129
| | | | | | | | | | | | | * meta/build-env.in: New file which sets up an environment that does not inherit GUILE_LOAD_PATH / GUILE_LOAD_COMPILED_PATH (unless cross-compiling). * doc/ref/Makefile.am (autoconf-macros.texi): * libguile/Makefile.am (snarf2checkedtexi): * module/Makefile.am (ice-9/psyntax-pp.go): * test-suite/standalone/Makefile.am (GUILE_INSTALL_LOCALE): * am/bootstrap.am (.scm.go): * am/guilec (.scm.go): Use build-env. * configure.ac: Create build-env.
* Avoid Gnulib unistr/* modulesAndy Wingo2016-07-1016-2705/+4
| | | | | | (unistr/base, unistr/u8-mbtouc, unistr/u8-mbtouc-unsafe) (unistr/u8-mbtoucr, unistr/u8-prev unistr/u8-uctomb, unitypes): --avoid these modules.
* Update Gnulib to 68b6ade.Andy Wingo2016-07-07411-2454/+6045
| | | | | Also add --conditional-dependencies to the flags. See: https://lists.gnu.org/archive/html/guile-devel/2016-07/msg00012.html
* Update git-version-gen.diff for current gnulibAndy Wingo2016-07-071-8/+10
| | | | * gnulib-local/build-aux/git-version-gen.diff: Update.
* Update NEWSAndy Wingo2016-06-291-164/+316
| | | | * NEWS: Add 2.0.12 NEWS. Fold 2.1.3 NEWS into main 2.2.0 NEWS.
* tests-suite: resurrect invoking check-guile --coverage.Jan Nieuwenhuizen2016-06-281-1/+1
| | | | * test-suite/guile-test (main): remove (the-vm) from with-code-coverage call.
* psyntax can trace expand-time changes to the current moduleAndy Wingo2016-06-272-106/+124
| | | | | | * module/ice-9/psyntax.scm (expand-top-sequence): Support expand-time changes to the current module. * module/ice-9/psyntax-pp.scm: Regenerate.
* Fix uninstalled-env bug that put prebuilt/ in frontAndy Wingo2016-06-271-7/+2
| | | | | | * meta/uninstalled-env.in (top_builddir): Fix bug whereby meta/uninstalled-env run within meta-uninstalled-env, as happens sometimes, would move the prebuilt dir to the front.
* Fixing GUILE_PROGS wrong versioning checksDavid Pirotte2016-06-271-4/+8
| | | | | | | | | | | * meta/guile.m4: Fixing GUILE_PROGS versioning checks were wrong and incomplete, leading to false errors like: "... checking for Guile version >= 2.0.11... configure: error: Guile 2.0.11 required, but 2.1.3 found". thanks to Colomban Wendling, aka b4n, who also suggested this fix during a chat on #autotools while helping me wrt another autotool related problem I was nvestigating.
* Do not track some test-suite filesDavid Pirotte2016-06-271-0/+1
| | | | | * .gitignore: Adding test-smob-mark-race to the list of the test-suite files we do not track.
* Fix 'monitor' macro.Taylan Ulrich Bayırlı/Kammer2016-06-271-3/+18
| | | | | | * module/ice-9/threads.scm (monitor-mutex-table) (monitor-mutex-table-mutex, monitor-mutex-with-id): New variables. (monitor): Fix it.
* Add -Wmacro-use-before-definitionAndy Wingo2016-06-255-12/+81
| | | | | | | | | | | | | * module/ice-9/boot-9.scm (%auto-compilation-options): * am/guilec (GUILE_WARNINGS): Add -Wmacro-use-before-definition. * module/language/tree-il/analyze.scm (unbound-variable-analysis): Use match-lambda. (<macro-use-info>, macro-use-before-definition-analysis): New analysis. * module/system/base/message.scm (%warning-types): Add macro-use-before-definition warning type. * module/language/tree-il/compile-cps.scm (%warning-passes): Add support for macro-use-before-definition.
* Fix duplicate case in pevalAndy Wingo2016-06-251-1/+0
| | | | | * module/language/tree-il/peval.scm (singly-valued-expression?): Fix duplicate case. Spotted by "mejja" on IRC.
* Add documentation pointer from getopt-long to SRFI-37.Andy Wingo2016-06-251-0/+6
| | | | * doc/ref/mod-getopt-long.texi (getopt-long): Point to SRFI-37.
* Favor "escape continuation" over "one-shot continuation" in manualAndy Wingo2016-06-241-4/+2
| | | | | | * doc/ref/api-control.texi (Prompt Primitives): Remove mention of one-shot continuations, as it's possible to invoke them multiple times if the continuation is re-entered through other means.
* Check for strtod_l before using it.Andy Wingo2016-06-242-3/+3
| | | | | | | | Based on a patch by Andy Stormont <astormont@racktopsystems.com>. * configure.ac: Check for strtod_l. * libguile/i18n.c (scm_locale_string_to_integer): Fix style. (scm_locale_string_to_inexact): Check for strtod_l.
* Constant-folding eq? and eqv? uses deduplicationAndy Wingo2016-06-242-1/+17
| | | | | | * test-suite/tests/peval.test ("partial evaluation"): Add tests. * module/language/tree-il/peval.scm (peval): Constant-fold eq? and eqv? using equal?, anticipating deduplication.
* Prevent (@ (ice-9 boot-9) x)Andy Wingo2016-06-241-0/+5
| | | | | * module/ice-9/boot-9.scm: Prevent re-loading, perhaps via (@ (ice-9 boot-9) foo). (ice-9 boot-9) isn't a module. Fixes #21801.
* On Darwin, skip tests that depend on setrlimitDaniel Llorens2016-06-242-0/+13
| | | | | | | | | On Darwin, setrlimit is ignored, and these tests do not terminate. There doesn't seem to be another way to limit the memory allocated by a process. * test-suite/standalone/test-stack-overflow: Skip this test on Darwin. * test-suite/standalone/test-out-of-memory: Skip this test on Darwin.
* Fix texinfo->html for @acronym, @itemizeAndy Wingo2016-06-243-5/+56
| | | | | | | * module/texinfo/html.scm (itemize, acronym, tag-replacements, rules): Fix HTML serialization of @itemize and @acronym. Fixes #21772. * test-suite/tests/texinfo.html.test: New file. * test-suite/Makefile.am: Add new file.
* Parse bytecode to determine minimum arityAndy Wingo2016-06-245-66/+58
| | | | | | | | | | | | * libguile/programs.c (try_parse_arity): New helper, to parse bytecode to determine the minimum arity of a function in a cheaper way than grovelling through the debug info. Should speed up all thunk? checks and similar. (scm_i_program_arity): Simplify. * libguile/gsubr.h: * libguile/gsubr.c (scm_i_primitive_arity): * libguile/foreign.h: * libguile/foreign.c (scm_i_foreign_arity):
* Fix include-from-path when file found in relative pathAndy Wingo2016-06-242-12/+14
| | | | | | | | * module/ice-9/psyntax.scm (include-from-path): Canonicalize result of %search-load-path. Otherwise a relative path passed to `include' would be treated as relative to the directory of the file that contains the `include-from-path'. Fixes #21347. * module/ice-9/psyntax-pp.scm: Regenerate.
* Avoid stifling readline history when looking up optionsDaniel Llorens2016-06-241-27/+29
| | | | | | With this patch, history is never stifled unless (readline-set!) is used. * src/guile-readline/readline.c (scm_readline_options)
* Fix typo about `keywords' read optionAndy Wingo2016-06-241-1/+1
| | | | | * doc/ref/api-data.texi (Keyword Read Syntax): Fix typo. Thanks to Glenn Michaels for the report and fix.
* Fix ,profile in pure modulesAndy Wingo2016-06-241-2/+4
| | | | | * libguile/scmsigs.c (close_1): Make the async closure in an environment where `lambda' has its usual meaning. Fixes #21013.