summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2016-07-11Support typed arrays in some sort functionslloda-array-supportDaniel Llorens3-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.
2016-07-11Remove uniform-array-read!, uniform-array-write from the manualDaniel Llorens1-33/+0
These procedures where removed in fc7bd367ab4b5027a7f80686b1e229c62e43c90b (2011-05-12). * doc/ref/api-compound.texi: Ditto.
2016-07-11Remove commented stack version of scm_array_for_each_cell()Daniel Llorens1-214/+0
* libguile/array-map.c: Ditto.
2016-07-11Fix pool version of scm_array_for_each_cell by aligning pointersDaniel Llorens1-17/+19
* libguile/array-map.c (scm_array_for_each_cell): Align all pointers to pointer size.
2016-07-11Fix a corner case with empty arrays in (array-for-each-cell)Daniel Llorens2-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.
2016-07-11Clean up (array-for-each-cell)Daniel Llorens7-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.
2016-07-11Avoid variable stack use in scm_array_for_each_cell()Daniel Llorens1-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().
2016-07-11Special case for array-map! with three argumentsDaniel Llorens1-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.
2016-07-11New export (array-for-each-cell-in-order)Daniel Llorens2-1/+14
* libguile/arrays.h (array-for-each-cell-in-order): Declare. * libguile/arrays.c (array-for-each-cell-in-order): Define.
2016-07-11Draft documentation for (array-for-each-cell)Daniel Llorens1-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).
2016-07-11Draft of (array-for-each-cell)Daniel Llorens2-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.
2016-07-11Do not use array handles in scm_vectorDaniel Llorens3-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().
2016-07-11Remove deprecated and unused generalized-vector functionsDaniel Llorens2-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.
2016-07-11Speed up for multi-arg cases of scm_ramap functionsDaniel Llorens3-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.
2016-07-11Remove deprecated array functionsDaniel Llorens2-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.
2016-07-11Fix compilation of rank 0 typed array literalsDaniel Llorens2-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.
2016-07-11Don't use array handles in scm_c_array_rankDaniel Llorens4-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.
2016-07-11Rename array-set-from!, scm_array_set_from_x to array-amend!, scm_array_amend_xDaniel Llorens4-23/+25
2016-07-11Tests & doc for array-from, array-from*, array-set-from!Daniel Llorens2-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!.
2016-07-11New functions array-from, array-from*, array-set-from!Daniel Llorens2-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!.
2016-07-11Compile in C99 modeDaniel Llorens1-17/+16
* configure.ac: Require C99 flags. Remove -Wdeclaration-after-statement.
2016-07-11Reuse SCM_BYTEVECTOR_TYPED_LENGTH in scm_array_get_handleDaniel Llorens3-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.
2016-07-11Unuse array 'contiguous' flagDaniel Llorens3-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.
2016-07-11Remove scm_from_contiguous_arrayDaniel Llorens2-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.
2016-07-11Avoid unneeded internal use of array handlesDaniel Llorens2-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.
2016-07-10Add meta/build-envAndy Wingo8-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.
2016-07-10Avoid Gnulib unistr/* modulesAndy Wingo16-2705/+4
(unistr/base, unistr/u8-mbtouc, unistr/u8-mbtouc-unsafe) (unistr/u8-mbtoucr, unistr/u8-prev unistr/u8-uctomb, unitypes): --avoid these modules.
2016-07-07Update Gnulib to 68b6ade.Andy Wingo411-2454/+6045
Also add --conditional-dependencies to the flags. See: https://lists.gnu.org/archive/html/guile-devel/2016-07/msg00012.html
2016-07-07Update git-version-gen.diff for current gnulibAndy Wingo1-8/+10
* gnulib-local/build-aux/git-version-gen.diff: Update.
2016-06-29Update NEWSAndy Wingo1-164/+316
* NEWS: Add 2.0.12 NEWS. Fold 2.1.3 NEWS into main 2.2.0 NEWS.
2016-06-28tests-suite: resurrect invoking check-guile --coverage.Jan Nieuwenhuizen1-1/+1
* test-suite/guile-test (main): remove (the-vm) from with-code-coverage call.
2016-06-27psyntax can trace expand-time changes to the current moduleAndy Wingo2-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.
2016-06-27Fix uninstalled-env bug that put prebuilt/ in frontAndy Wingo1-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.
2016-06-27Fixing GUILE_PROGS wrong versioning checksDavid Pirotte1-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.
2016-06-27Do not track some test-suite filesDavid Pirotte1-0/+1
* .gitignore: Adding test-smob-mark-race to the list of the test-suite files we do not track.
2016-06-27Fix 'monitor' macro.Taylan Ulrich Bayırlı/Kammer1-3/+18
* module/ice-9/threads.scm (monitor-mutex-table) (monitor-mutex-table-mutex, monitor-mutex-with-id): New variables. (monitor): Fix it.
2016-06-25Add -Wmacro-use-before-definitionAndy Wingo5-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.
2016-06-25Fix duplicate case in pevalAndy Wingo1-1/+0
* module/language/tree-il/peval.scm (singly-valued-expression?): Fix duplicate case. Spotted by "mejja" on IRC.
2016-06-25Add documentation pointer from getopt-long to SRFI-37.Andy Wingo1-0/+6
* doc/ref/mod-getopt-long.texi (getopt-long): Point to SRFI-37.
2016-06-24Favor "escape continuation" over "one-shot continuation" in manualAndy Wingo1-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.
2016-06-24Check for strtod_l before using it.Andy Wingo2-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.
2016-06-24Constant-folding eq? and eqv? uses deduplicationAndy Wingo2-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.
2016-06-24Prevent (@ (ice-9 boot-9) x)Andy Wingo1-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.
2016-06-24On Darwin, skip tests that depend on setrlimitDaniel Llorens2-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.
2016-06-24Fix texinfo->html for @acronym, @itemizeAndy Wingo3-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.
2016-06-24Parse bytecode to determine minimum arityAndy Wingo5-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):
2016-06-24Fix include-from-path when file found in relative pathAndy Wingo2-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.
2016-06-24Avoid stifling readline history when looking up optionsDaniel Llorens1-27/+29
With this patch, history is never stifled unless (readline-set!) is used. * src/guile-readline/readline.c (scm_readline_options)
2016-06-24Fix typo about `keywords' read optionAndy Wingo1-1/+1
* doc/ref/api-data.texi (Keyword Read Syntax): Fix typo. Thanks to Glenn Michaels for the report and fix.
2016-06-24Fix ,profile in pure modulesAndy Wingo1-2/+4
* libguile/scmsigs.c (close_1): Make the async closure in an environment where `lambda' has its usual meaning. Fixes #21013.