summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* Minor evaluator tweakswip-closure-conversionAndy Wingo2014-12-073-7/+23
| | | | | | * libguile/eval.c (eval): Remove unused variable. * libguile/memoize.c (unmemoize): Fix unmemoization. * module/ice-9/eval.scm: Attempt to speed up common box-ref cases.
* Simplify variable resolution in the evaluatorAndy Wingo2014-12-075-211/+155
| | | | | | | | | | | | | | | * libguile/expand.c (convert_assignment): Handle creation of the default lambda-case body here. * libguile/eval.c (eval): * module/ice-9/eval.scm (primitive-eval): * libguile/memoize.h: * libguile/memoize.c (MAKMEMO_BOX_REF, MAKMEMO_BOX_SET): (MAKMEMO_TOP_BOX, MAKMEMO_MOD_BOX): Refactor all global var resolution to go through "resolve". Add "box-ref" and "box-set!". Rename memoize-variable-access! to %resolve-variable, and don't be destructive.
* Closure conversion in evaluatorAndy Wingo2014-12-071-13/+110
| | | | | | | * libguile/memoize.c (MAKMEMO_CAPTURE_ENV, push_nested_link) (push_flat_link, env_link_is_flat, env_link_vars) (env_link_add_flat_var, lookup, capture_flat_env, memoize): Capture flat environments around closures.
* Add capture-env to evaluatorAndy Wingo2014-12-064-1/+40
| | | | | | | | * libguile/eval.c (eval): * libguile/memoize.c (memoized_tags, unmemoize): * libguile/memoize.h (SCM_M_CAPTURE_ENV): * module/ice-9/eval.scm (primitive-eval): Add capture-env memoized expression type.
* Simplify the interpreter for trivial inits and no letrecAndy Wingo2014-12-054-187/+70
| | | | | | | | | | | | | | | | | | * libguile/memoize.c (FULL_ARITY): Serialize "ninits" and the unbound value instead of the init list. (memoize): Adapt to FULL_ARITY changes. Remove LETREC case. (unmemoize): Adapt to memoized code change. * libguile/eval.c (BOOT_CLOSURE_PARSE_FULL): Adapt to parse ninits and unbound instead of inits. (eval): Lexical-ref can no longer raise an error. (prepare_boot_closure_env_for_apply): Adapt to inits change. * module/ice-9/eval.scm (primitive-eval): Adapt to ninits/unbound change. * libguile/expand.c (expand_named_let): Fix lambda-case creation to make lists for opt and inits.
* Assignment conversion in the interpreterAndy Wingo2014-12-054-22/+414
| | | | | | | | | | | | | * libguile/expand.c (compute_assigned, convert_assignment) (scm_convert_assignment): New functions. * libguile/expand.h: Declare scm_convert_assignment. * libguile/memoize.c (scm_memoize_expression): Do assignment conversion before memoization. * test-suite/tests/syntax.test ("letrec"): Detection of unbound letrec variables now works.
* texinfo: fix @url{@@} parsingAndy Wingo2014-11-092-1/+5
| | | | | | | * module/texinfo.scm (texi-command-specs): The body of @url{} can have texinfo commands. * test-suite/tests/texinfo.test ("test-texinfo->stexinfo"): Add tests.
* web: Location header is URI-reference; better URI-reference supportAndy Wingo2014-11-016-49/+421
| | | | | | | | | | | | | | | | | | | | | | | | | | | * module/web/uri.scm (validate-uri): Add reference? keyword argument, for validating references. (build-uri): Clarify comments to indicate that the result is an absolute URI. (build-uri-reference): New interface, to build URI-references. (string->uri-reference): Rename from string->uri*. Fix fragment parsing to not include the #. (string->uri): Adapt to string->uri-reference name change. * module/web/request.scm (request-absolute-uri): Add default-scheme optional argument. Use it if the request-uri has no scheme, or error. * module/web/http.scm (write-uri): Reflow to use "when". Fix writing of URI-reference instances. (declare-uri-reference-header!): Rename from declare-relative-uri-header!. Use string->uri-reference. ("Location"): Declare as a URI-reference header, as per RFC 7231. * module/web/client.scm (open-socket-for-uri): Handle the case in which there is no URI scheme. * test-suite/tests/web-http.test: * test-suite/tests/web-uri.test: Add tests.
* Merge branch 'lloda-array-support'Daniel Llorens2014-10-307-89/+117
|\
| * Intern general arraysDaniel Llorens2014-09-301-3/+28
| | | | | | | | | | * module/system/vm/assembler.scm (intern-constant, link-data): handle the array case.
| * Pack array dimensions in array objectDaniel Llorens2014-09-304-53/+51
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * libguile/arrays.c (scm_i_make_array): redo object layout. * libguile/arrays.h (SCM_I_ARRAY_V, SCM_ARRAY_BASE, SCM_I_ARRAY_DIMS): to match new layout. (SCM_I_ARRAY_SET_V, SCM_ARRAY_SET_BASE): new setters. (SCM_I_ARRAY_MEM, scm_i_t_array): unused, remove. (scm_i_shap2ra, scm_make_typed_array, scm_from_contiguous_typed_array, scm_from_contiguous_array, scm_make_shared_array, scm_transpose_array, scm_array_contents): fix uses of SCM_I_ARRAY_V, SCM_ARRAY_BASE as lvalues. * libguile/array-map.c (make1array, scm_ramapc): fix uses of SCM_I_ARRAY_V, SCM_ARRAY_BASE as lvalues.
| * Run some of arrays.test under both compiler & interpreterDaniel Llorens2014-09-302-33/+38
|/ | | | | | | * test-suite/test-suite/lib.scm (c&e): accept (pass-if exp) clause. * test-suite/tests/arrays.test: use with-prefix/c&e instead of with-prefix where possible.
* Merge branch 'stable-2.0'Mark H Weaver2014-09-3057-492/+1019
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: benchmark-suite/benchmarks/ports.bm libguile/async.h libguile/bytevectors.c libguile/foreign.c libguile/gsubr.c libguile/srfi-1.c libguile/vm-engine.h libguile/vm-i-scheme.c module/Makefile.am module/language/tree-il/analyze.scm module/language/tree-il/peval.scm module/scripts/compile.scm module/scripts/disassemble.scm test-suite/tests/asm-to-bytecode.test test-suite/tests/peval.test test-suite/tests/rdelim.test
| * Add (ice-9 unicode) moduleAndy Wingo2014-09-299-1/+213
| | | | | | | | | | | | | | | | | | | | | | | | | | | | * libguile/unicode.c: * libguile/unicode.h: * test-suite/tests/unicode.test: * module/ice-9/unicode.scm: New files. * module/Makefile.am: * libguile/Makefile.am: * test-suite/Makefile.am: * libguile/init.c: Wire new files into the build. * doc/ref/api-data.texi: Add docs.
| * peval: Handle optional argument inits that refer to previous arguments.Mark H Weaver2014-09-282-20/+160
| | | | | | | | | | | | | | | | | | | | | | | | | | Fixes <http://bugs.gnu.org/17634>. Reported by Josep Portella Florit <jpf@primfilat.com>. * module/language/tree-il/peval.scm (inlined-application): When inlining an application whose operator is a lambda expression with optional arguments that rely on default initializers, expand into a series of nested let expressions, to ensure that previous arguments are in scope when the default initializers are evaluated. * test-suite/tests/peval.test ("partial evaluation"): Add tests.
| * doc: Improve description of vector-unfold and vector-unfold-right.Mark H Weaver2014-09-242-15/+15
| | | | | | | | | | | | | | * doc/ref/srfi-modules.texi (SRFI-43 Constructors)[vector-unfold]: Improve description. * module/srfi/srfi-43.scm (vector-unfold, vector-unfold-right): Improve docstrings.
| * Add 'EXIT_SUCCESS' and 'EXIT_FAILURE'.Ludovic Courtès2014-09-222-2/+14
| | | | | | | | | | | | | | | | Suggested by Frank Terbeck <ft@bewatermyfriend.org>. * libguile/posix.c (scm_init_posix): Define 'EXIT_SUCCESS' and 'EXIT_FAILURE'. * doc/ref/posix.texi (Processes): Document them.
| * guile-readline: Use the current directory if HOME is unset.David Michael2014-09-211-1/+2
| | | | | | | | | | * guile-readline/ice-9/readline.scm (history-file): When the HOME environment variable is unset, use the current directory instead.
| * build: Use 'libtoolize' in autogen.sh.Ludovic Courtès2014-09-201-5/+1
| | | | | | | | | | | | | | Fixes <http://bugs.gnu.org/18470>. Reported by Rob Browning <rlb@defaultvalue.org>. * autogen.sh: Invoke 'libtoolize' instead of 'libtool'.
| * Fix SCM_SMOB_OBJECT{_,_0_,_1_,_2_,_3_}LOC.David Kastrup2014-09-201-5/+5
| | | | | | | | | | | | | | | | | | | | | | Fixes <http://bugs.gnu.org/18495>. * libguile/smob.h (SCM_SMOB_OBJECT_LOC, SCM_SMOB_OBJECT_0_LOC) (SCM_SMOB_OBJECT_1_LOC, SCM_SMOB_OBJECT_2_LOC) (SCM_SMOB_OBJECT_3_LOC): These elementary API macros have been broken by commit 56164dc47f6616b359f0ad23be208f01a77b55fa in 2009. Signed-off-by: David Kastrup <dak@gnu.org>
| * guild disassemble: Use #:prefix instead of #:renamer.Mark H Weaver2014-09-201-3/+2
| | | | | | | | | | * module/scripts/disassemble.scm: Use #:prefix instead of #:renamer in #:use-module clause.
| * Document #:prefix option in use-module clauses.Mark H Weaver2014-09-201-12/+25
| | | | | | | | | | * doc/ref/api-modules.texi (Using Guile Modules): Document #:prefix option.
| * SRFI-43: vector-concatenate: Fix error message.Mark H Weaver2014-09-201-1/+1
| | | | | | | | | | * module/srfi/srfi-43.scm (vector-concatenate): Fix the 'who' of an error message.
| * VM: Use register "a3" for IP_REG on m68k.Mark H Weaver2014-09-201-1/+1
| | | | | | | | | | | | | | Subset of a patch by Andreas Schwab <schwab@linux-m68k.org>. Reported by Rob Browning <rlb@defaultvalue.org>. * libguile/vm-engine.h (IP_REG)[__mc68000__]: Use register "a3".
| * VM: Allow the C compiler to choose FP_REG on ARM.Mark H Weaver2014-09-201-2/+2
| | | | | | | | | | | | | | | | Reported by Rob Browning <rlb@defaultvalue.org>. * libguile/vm-engine.h (IP_REG)[__arm__]: Remove explicit register choice ("r7") for FP_REG, which was reported to cause compilation failures on ARM.
| * Do not assume that 64-bit integers will be 64-bit aligned.Mark H Weaver2014-09-202-6/+7
| | | | | | | | | | | | * libguile/foreign.c (raw_bytecode, objcode_cells): * libguile/gsubr.c (raw_bytecode, objcode_cells): Use SCM_ALIGNED to ensure 64-bit alignment.
| * VM: ASM_MUL for ARM: Add earlyclobber constraint to the SMULL outputs.Mark H Weaver2014-09-201-3/+2
| | | | | | | | | | | | | | Reported by Rob Browning <rlb@defaultvalue.org>. * libguile/vm-i-scheme.c (ASM_MUL)[ARM]: Add earlyclobber (&) constraint to the SMULL output registers.
| * tests: Link test against Gnulib.Ludovic Courtès2014-09-171-1/+2
| | | | | | | | | | | | | | Reported by Eli Zaretskii <eliz@gnu.org>. * test-suite/standalone/Makefile.am (test_scm_take_locale_symbol_LDADD): Add libgnu.la, for the 'strdup' replacement.
| * Thank Franck.Ludovic Courtès2014-08-261-0/+1
| |
| * Handle ~p in 'format' warnings.Ludovic Courtès2014-08-262-1/+56
| | | | | | | | | | | | | | | | | | | | | | Fixes <http://bugs.gnu.org/18299>. Reported by Frank Terbeck <ft@bewatermyfriend.org>. * module/language/tree-il/analyze.scm (format-string-argument-count): Add case for ~p. * test-suite/tests/tree-il.test ("warnings")["format"]("~p", "~p, too few arguments", "~:p", "~:@p, too many arguments", "~:@p, too few arguments"): New tests.
| * On MS-Windows, don't return file names with backslashes from search-path.Eli Zaretskii2014-08-151-1/+2
| | | | | | | | | | * libguile/load.c (search_path): On MS-Windows, convert all backslashes to forward slashes if the file was found on PATH.
| * Copy the result from 'nl_langinfo' before it can be overwritten.Mark H Weaver2014-08-131-10/+18
| | | | | | | | | | | | | | | | | | Based on a patch by Eli Zaretskii <eliz@gnu.org>. * libguile/i18n.c (copy_string_or_null): New static function. (scm_nl_langinfo): Use 'copy_string_or_null' to copy the result from 'nl_langinfo' and 'nl_langinfo_l' before the next call and before releasing the locale mutex.
| * Make temporary file in coding.test work on MS-Windows.Eli Zaretskii2014-08-131-1/+4
| | | | | | | | | | | | | | * test-suite/tests/coding.test (with-temp-file): Instead of hard-coding "/tmp" as the temporary directory, use $TMPDIR or $TEMP from the environment, and fall back on "/tmp" if none of those 2 is defined.
| * doc: "!#" does not need to appear on a line of its own.Ludovic Courtès2014-08-121-2/+3
| | | | | | | | | | * doc/ref/api-evaluation.texi (Block Comments): Remove "which must appear on a line of their own". Reported by David Michael <fedora.dm0@gmail.com>.
| * Clarify that object-properties cannot be reliably applied to numbers.David Kastrup2014-08-101-1/+1
| | | | | | | | | | | | | | * doc/ref/api-utility.texi (Object Properties)[make-object-property]: Clarify that object-properties cannot be reliably applied to numbers. Signed-off-by: David Kastrup <dak@gnu.org>
| * Provide curried version of define*-public.Ian Price2014-07-311-1/+12
| | | | | | | | * module/ice-9/curried-definitions.scm (define*-public): New macro.
| * Prevent add-to-load-path from adding duplicate entriesIan Price2014-07-301-1/+1
| | | | | | | | | | | | * module/ice-9/boot-9.scm (add-to-load-path): Remove argument from %load-path (if it exists) before pushing. This also means that the `elt' will always be at the front of %load-path.
| * Recognize more ARM targets.Ludovic Courtès2014-07-042-2/+14
| | | | | | | | | | | | | | | | | | | | | | Suggested by Dale P. Smith. * module/system/base/target.scm (cpu-endianness): Add cases for "arm.*eb", "^aarch64.*be", and "aarch64". Change "arm" case to "arm.*". (triplet-pointer-size): Allow underscore as in 'aarch64_be'. * test-suite/tests/asm-to-bytecode.test ("cross-compilation")["armeb-unknown-linux-gnu", "aarch64-linux-gnu", "aarch64_be-linux-gnu"]: New tests.
| * Fix bit-count* bugAndy Wingo2014-07-043-2/+6
| | | | | | | | | | | | | | | | | | | | * libguile/bitvectors.c (scm_bit_count_star): Fix typo introduced in 2005 refactor (!) in which the second arg was erroneously taken from the first arg. * test-suite/tests/bitvectors.test: Add test. * doc/ref/api-compound.texi: Fix doc example for u32vector selector.
| * build: Support pthread builds without 'pthread_cancel' support (Android).Ludovic Courtès2014-07-043-2/+23
| | | | | | | | | | | | | | | | | | | | | | | | Reported by Sylvain Beucler <beuc@beuc.net>. * configure.ac: Check for 'pthread_cancel'. * libguile/threads.c (scm_cancel_thread): Conditionalize on !SCM_USE_PTHREAD_THREADS || defined HAVE_PTHREAD_CANCEL. * test-suite/tests/threads.test (require-cancel-thread): New procedure. ("timed joining fails if timeout exceeded", "join-thread returns timeoutval on timeout", "cancel succeeds", "handler result passed to join", "can cancel self"): Use it.
| * build: Use 'LT_LIB_M' to determine whether -lm is needed.Ludovic Courtès2014-07-041-4/+3
| | | | | | | | | | * configure.ac: Use 'LT_LIB_M' instead of 'AC_CHECK_LIB(m, cos)'. Suggested by Sylvain Beucler <beuc@beuc.net>.
| * Recognize arm-* target triplets.Ludovic Courtès2014-07-042-2/+7
| | | | | | | | | | | | | | | | | | Reported by Sylvain Beucler <beuc@beuc.net>. * module/system/base/target.scm (cpu-endianness): Add case where CPU is "arm". * test-suite/tests/asm-to-bytecode.test ("cross-compilation")["arm-unknown-linux-androideabi"]: New test.
| * Remove trailing whitespace from ports.test.Eli Zaretskii2014-07-031-6/+6
| |
| * Untabify some test files.Eli Zaretskii2014-07-033-274/+274
| | | | | | | | | | | | * test-suite/tests/ports.test: Untabify. * test-suite/tests/posix.test: Untabify. * test-suite/tests/r6rs-files.test: Untabify.
| * Fix problems with Windows file names that use backslashes.Eli Zaretskii2014-07-036-11/+67
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * libguile/load.c (scm_i_mirror_backslashes): New function. (scm_init_load_path): Call it to produce MS-Windows file names with forward slashes. (FILE_NAME_SEPARATOR_STRING): Define as "/" on all platforms. * libguile/load.h (scm_i_mirror_backslashes): Add prototype. * libguile/init.c (scm_boot_guile): Call scm_i_mirror_backslashes on argv[0]. * libguile/filesys.c (scm_getcwd): Call scm_i_mirror_backslashes on the directory name returned by getcwd. * test-suite/tests/ports.test ("file name separators"): New test.
| * Fix calculation of CPU set size for getaffinity.Eli Zaretskii2014-07-031-2/+2
| | | | | | | | | | * libguile/posix.c (cpu_set_to_bitvector): Use CPU_SETSIZE, not sizeof, to compute the size of the CPU set.
| * Provide a more reasonable default value for stack limit on MS-Windows.Eli Zaretskii2014-07-031-1/+16
| | | | | | | | | | * libguile/debug.c (init_stack_limit) [__MINGW32__]: Use VirtualQuery to compute the stack limit on MS-Windows.
| * Unconditionally build and test the ice-9/popen module.Eli Zaretskii2014-07-033-18/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * module/Makefile.am (ICE_9_SOURCES): Add ice-9/popen.scm. (ICE_9_SOURCES) [BUILD_ICE_9_POPEN]: Remove conditional addition of ice-9/popen.scm. (SCRIPTS_SOURCES): Add scripts/autofrisk.scm and scripts/scan-api.scm unconditionally. (SCRIPTS_SOURCES) [BUILD_ICE_9_POPEN]: Remove conditional addition of scripts/autofrisk.scm and scripts/scan-api.scm. * configure.ac: Remove the BUILD_ICE_9_POPEN condition. * test-suite/tests/popen.test (if-supported): Don't test for 'fork feature being supported.
| * More fixes for deleting files whose ports are not closed.Eli Zaretskii2014-07-022-1/+4
| | | | | | | | | | | | | | | | * test-suite/tests/r6rs-files.test: Close the port after using it. * test-suite/tests/posix.test ("mkstemp!"): Close the port after using it.
| * Make 'system*' available on MS-Windows.Eli Zaretskii2014-07-021-6/+26
| | | | | | | | | | | | * libguile/simpos.c (scm_system_star) [!HAVE_FORK]: An implementation of 'system*' for MS-Windows, which doesn't have 'fork', but can use 'spawnvp' in this case.