summaryrefslogtreecommitdiff
path: root/module
Commit message (Collapse)AuthorAgeFilesLines
* Placate a number of `syntax-check' verifications.Ludovic Courtès2012-01-057-10/+11
| | | | | | | - "filesystem" -> "file system" - remove doubled words - use EXIT_* macros instead of literal numbers - update `syntax-check' exclusion files
* Regenerate `psyntax-pp.scm'.Ludovic Courtès2012-01-051-11424/+11458
| | | | * module/ice-9/psyntax-pp.scm: Regenerate.
* Raise an error for (begin) when `--disable-deprecated'.Ludovic Courtès2012-01-051-6/+10
| | | | | | | | | * 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.
* Fix documentation for vhash-fold and vhash-fold-rightMark H Weaver2011-12-301-9/+12
| | | | | | | | | | * 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.
* Fix comment summarizing allocation tableMark H Weaver2011-12-301-1/+2
| | | | | * module/language/tree-il/analyze.scm (analyze-lexicals): Fix comment, which describes the compiler's allocation table, to match reality.
* Update comment: ~/.guile-ccache => ~/.cache/guile/ccacheMark H Weaver2011-12-301-1/+1
| | | | | * module/system/base/compile.scm: Update comment to match where the ccache dir now lives: ~/.cache/guile/ccache
* HTTP: Fix qstring writing of cache-extension valuesAndy Wingo2011-12-221-1/+1
| | | | | | | | * 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.
* Extend handling of "Cache-Control" header.Daniel Hartwig2011-12-221-3/+9
| | | | | | | * 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.
* peval fix: (cons 1 #nil) is not (list 1)Andy Wingo2011-12-211-1/+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.
* peval minor tweakAndy Wingo2011-12-211-1/+1
| | | | | | * 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.
* document invalidity of (begin) as expression; add back-compat shimAndy Wingo2011-12-212-6993/+7155
| | | | | | | | | | | | * 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.
* ftw: Include sub-directories in the result of `scandir'.Ludovic Courtès2011-12-191-1/+1
| | | | | | * module/ice-9/ftw.scm (scandir)[skip]: Keep NAME in the resulting list. * test-suite/tests/ftw.test ("scandir")["top-srcdir"]: New test.
* fix peval to preserve effects when folding (values) formsAndy Wingo2011-12-191-67/+77
| | | | | | | | | | | | | | | | | | | * 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).
* ftw: Fix typos/thinkos in `file-system-fold' and `scandir'.Ludovic Courtès2011-12-191-5/+5
| | | | | | | | * 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.
* ftw: Clarify the behavior of `scandir' for flat files and unreadable dirs.Ludovic Courtès2011-12-191-4/+5
| | | | | | | | | | | | * 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.
* Add a deprecated alias for $exptChristian Persch2011-12-191-0/+5
| | | | | | | * module/ice-9/deprecated.scm: Add alias for $expt. $expt was removed in commit 6fc4d0124d633d1b3ddc5af82967f23bd17556f8 but no deprecated alias was added in ad79736c68a803a59814fbfc0cb4b092c2b4cddf like for all the other deprecated $sin, $cos, ... functions.
* ftw: Add `scandir'.Ludovic Courtès2011-12-181-1/+31
| | | | | | | | 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'.
* ftw: Add an optional `stat' parameter to `file-system-fold' and `-tree'.Ludovic Courtès2011-12-181-18/+20
| | | | | | | | | | * 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.
* Add `file-system-fold' and `file-system-tree' to (ice-9 ftw).Ludovic Courtès2011-12-131-2/+128
| | | | | | | | | | | * 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'.
* add an apropos-hook to ice-9 sessionAndy Wingo2011-12-121-10/+17
| | | | | | | * 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.
* current-input-port et al are srfi-39 parametersAndy Wingo2011-12-102-94/+40
| | | | | | | | | | | | | | * 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.
* Add an exception printer for `getaddrinfo-error'.Ludovic Courtès2011-12-061-1/+6
| | | | | * module/ice-9/boot-9.scm (getaddrinfo-error-printer): New procedure. Use it as the `getaddrinfo-error' exception printer.
* peval: Truncate multiple values when extending the environment.Ludovic Courtès2011-12-061-1/+44
| | | | | | | | | | 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.
* allow URIs of the form file:///etc/hostsAndy Wingo2011-12-061-8/+12
| | | | | | * module/web/uri.scm (parse-authority): Allow empty authorities, so that we accept URIs of the form, file:///etc/hosts. * test-suite/tests/web-uri.test ("string->uri"): Add tests.
* Update a comment in (web client)Andy Wingo2011-12-061-1/+1
| | | | * module/web/client.scm: Update a comment.
* warnings written to warning portAndy Wingo2011-12-052-14/+16
| | | | | | | | | | * libguile/deprecation.c (scm_c_issue_deprecation_warning): * libguile/load.c (auto_compile_catch_handler): (scm_sys_warn_auto_compilation_enabled, scm_primitive_load_path): * module/ice-9/boot-9.scm (warn, %load-announce, duplicate-handlers) (load-in-vicinity): * module/system/base/message.scm (warning): Write to the warning port. (*current-warning-port*): Alias the warning port.
* add current-warning-portAndy Wingo2011-12-051-0/+15
| | | | | | | | | | * libguile/ports.h: * libguile/ports.c (scm_current_warning_port) (scm_set_current_warning_port): New functions, wrapping the Scheme parameter. * module/ice-9/boot-9.scm (current-warning-port): New parameter, defining a port for warnings.
* setting a parameter returns the previous valueAndy Wingo2011-12-051-1/+3
| | | | | * module/ice-9/boot-9.scm (make-parameter): Setting a parameter by invoking it with an argument now returns the previous value.
* add srfi-39 parameters to boot-9Andy Wingo2011-12-051-0/+47
| | | | | | | | | | | * module/ice-9/boot-9.scm (<parameter>, make-parameter, parameter?) (parameter-fluid, parameter-converter, parameterize): New top-level bindings, implementing SRFI-39 parameters. Currently, current-input-port and similar procedures are not yet parameters. * test-suite/Makefile.am: * test-suite/tests/parameters.test: Add tests, taken from srfi-39 tests.
* ice-9/poll: verify sizeof(struct pollfd)Andy Wingo2011-12-041-0/+3
| | | | | * libguile/poll.c (scm_init_poll): Define %sizeof-struct-pollfd. * module/ice-9/poll.scm: Check %sizeof-struct-pollfd.
* ,language at REPL sets current-languageAndy Wingo2011-12-042-1/+5
| | | | | | | * module/system/repl/command.scm (language): Set the *current-language*. * module/system/repl/repl.scm (start-repl): Create a new dynamic scope for *current-language*.
* fix validators for various list-style headersDaniel Hartwig2011-11-231-8/+18
| | | | | | | | | | | | * module/web/http.scm (default-val-validator): Valid with no value. (key-value-list?): Keys are always symbols, do not accept strings. (validate-param-list): Apply `valid?' to list elements. (validate-credentials): Validate param for Basic scheme, which is parsed as a string. (declare-symbol-list-header!): `list-of?' args were in wrong order. ("Cache-Control"): Replace `default-val-validator' with more specific procedure. ("Accept"): Validate on first param which has no value.
* Allow $GUILE_FOR_BUILD to use its own environment when cross-compiling.Ludovic Courtès2011-11-231-1/+4
| | | | | | | | | * am/guilec (.scm.go): Use `-L' to specify the search path. * module/Makefile.am (ice-9/psyntax-pp.go): Likewise. * meta/uninstalled-env.in (top_builddir): Leave $GUILE_LOAD_PATH, $GUILE_SYSTEM_PATH, and $GUILE_SYSTEM_EXTENSIONS_PATH unchanged when cross-compiling.
* Use default value for make-fluid in Scheme filesAndy Wingo2011-11-238-81/+62
| | | | | | | | | | | | | | | | | | * module/ice-9/boot-9.scm (%exception-handler) (%running-exception-handlers, read-eval?, *repl-stack*) (make-mutable-parameter): * module/ice-9/getopt-long.scm (%program-name): * module/language/elisp/runtime.scm (built-in-macro, defspecial): * module/srfi/srfi-39.scm (make-parameter/helper): * module/system/base/language.scm (*current-language*): * module/system/base/message.scm (*current-warning-port*): (*current-warning-prefix*): * module/system/base/target.scm (%target-type, %target-endianness) (%target-word-size): * module/texinfo/plain-text.scm (*indent*, *itemizer*): * benchmark-suite/lib.scm (prefix-fluid): * test-suite/lib.scm (prefix-fluid): Give fluids a useful default value.
* optional default-value arg to make-fluidAndy Wingo2011-11-231-3/+1
| | | | | | | | | | | | | | | | | | | | | | | | * libguile/fluids.c (grow_dynamic_state, new_fluid): Arrange for the default value in the dynamic-state vector to be SCM_UNDEFINED instead of SCM_BOOL_F. If the value in the dynamic-state is #f, default to a value attached to the fluid instead. This allows useful default values. (scm_make_fluid_with_default): New function, allows the user to specify a default value for the fluid. Defaults to #f. Bound to `make-fluid' on the Scheme side. (scm_make_unbound_fluid): Use SCM_UNDEFINED as the default in all threads. (scm_fluid_unset_x): Also unset the default value. Not sure if this is the right thing. (fluid_ref): Update to the new default-value strategy. * libguile/threads.c (scm_i_reset_fluid): Reset to SCM_UNDEFINED. * libguile/threads.h: Remove extra arg to scm_i_reset_fluid. * libguile/vm-i-system.c (fluid-ref): Update to new default-value strategy. * module/ice-9/vlist.scm (block-growth-factor): Default to 2 in all threads. Fixes http://debbugs.gnu.org/10093.
* Build `psyntax-pp.go' with `--target=$(host)'.Ludovic Courtès2011-11-221-3/+4
| | | | * module/Makefile.am (ice-9/psyntax-pp.go): Pass `--target=$(host)'.
* Add a `--target' option to `guild compile'.Ludovic Courtès2011-11-221-7/+17
| | | | | | | | * module/scripts/compile.scm (%options)["--target"]: New option. (show-version): Update copyright year. (compile): Use `with-target' to install the target. * doc/ref/api-evaluation.texi (Compilation): Mention `--target' option.
* Complete cross-compilation support.Ludovic Courtès2011-11-221-19/+67
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * module/system/base/target.scm (%target-endianness, %target-word-size): New fluids. (%native-word-size): New variable. (with-target): Set these fluids. (cpu-endianness, cpu-word-size, triplet-cpu, triplet-vendor, triplet-os): New procedures. (target-cpu, target-vendor, target-os): Use them. (target-endianness, target-word-size): Refer to the corresponding fluid. * libguile/objcodes.c (target_endianness_var, target_word_size_var): New global variables. (NATIVE_ENDIANNESS): New macro. (target_endianness, target_word_size, to_native_order): New functions. (make_objcode_from_file): Use `scm_bytecode_to_native_objcode' instead of `scm_bytecode_to_objcode'. (bytecode_to_objcode): New function, based on `scm_bytecode_to_objcode', with the addition of an `endianness' and `word_size' parameters. (scm_bytecode_to_objcode): Use it. (scm_bytecode_to_native_objcode): New function. (scm_write_objcode): Use `target_word_size' and `target_endianness'. Convert OBJCODE's len and meta-len to native byte order. (scm_init_objcodes): Initialize `target_endianness_var' and `target_word_size_var'. * libguile/objcodes.h (scm_bytecode_to_native_objcode): New declaration. * libguile/vm.c (really_make_boot_program): Use `scm_bytecode_to_native_objcode' instead of `scm_bytecode_to_objcode'. * test-suite/tests/asm-to-bytecode.test (%objcode-cookie-size): New variable. (test-target): New procedure. ("cross-compilation"): Add `test-target' calls and the "unknown target" test.
* Fix `validate-target' in (system base target).Ludovic Courtès2011-11-221-1/+1
| | | | | | | | * module/system/base/target.scm (validate-target): Accept any tuple with at least 3 parts. * test-suite/tests/asm-to-bytecode.test (test-triplet): New procedure. ("cross-compilation"): New test prefix.
* hack the port-column of current-output-port after printing a promptAndy Wingo2011-11-161-1/+20
| | | | | * module/ice-9/boot-9.scm (repl-reader): Reset the output-column to 0 after printing the prompt. Fixes bug 9664.
* eval-when tidying upAndy Wingo2011-11-162-10701/+6677
| | | | | | * module/ice-9/psyntax.scm: Rename expand-when-list to parse-when-list, and simplify to compare literal values. * module/ice-9/psyntax-pp.scm: Regenerate.
* psyntax: s/chi/expand/gAndy Wingo2011-11-162-18800/+6855
| | | | | | * module/ice-9/psyntax.scm: Rename all instances of "chi" to "expand". Addded a hack to expand-eval-when that will be fixed later. * module/ice-9/psyntax-pp.scm: Regenerated.
* fix bug in make-repl when lang is actually a languageAndy Wingo2011-11-161-1/+3
| | | | | | * module/system/repl/common.scm (make-repl): Fix to accept language objects in addition to symbols. Fixes http://debbugs.gnu.org/9857. Thanks to Tristan Colgate for the report.
* set names of functions defined at the toplevel from `eval'Andy Wingo2011-11-151-1/+4
| | | | | * module/ice-9/eval.scm (primitive-eval): Set the name of toplevel-defined functions.
* better debuggability for interpreted proceduresAndy Wingo2011-11-151-103/+121
| | | | | | | | | | | | | | | | * libguile/procprop.c (scm_set_procedure_minimum_arity_x): New function, allows a user to override a function's arity. (scm_i_procedure_arity): Look up in the overrides table first. * libguile/procprop.h: Add scm_set_procedure_minimum_arity_x. * module/ice-9/eval.scm (primitive-eval): Override arity of "general closures". * test-suite/tests/procprop.test ("procedure-arity"): Add tests. Based on a patch from Stefan Israelsson Tampe. Test based on work by Patrick Bernaud.
* when leaving a non-tail let, allow bound vals to be collectedAndy Wingo2011-11-091-0/+22
| | | | | | | | * module/language/tree-il/compile-glil.scm (flatten-lambda-case): Clear lexical stack slots at the end of a non-tail let, letrec, or fix. Fixes http://debbugs.gnu.org/9900. * test-suite/tests/gc.test ("gc"): Add test.
* simplify primitives.scm for dynwindAndy Wingo2011-11-091-30/+13
| | | | | * module/language/tree-il/primitives.scm (*primitive-expand-table*): Remove a dynwind hack, as we have a good inliner now.
* peval: fix dynwind bug.Andy Wingo2011-11-091-2/+33
| | | | | | | | | | * module/language/tree-il/peval.scm (peval): The <dynwind> compiler will copy the winder and unwinder values, so make sure that they are constant, and if not, create lexical bindings. Fixes http://debbugs.gnu.org/9844. * test-suite/tests/tree-il.test ("partial evaluation"): Add a couple <dynwind> tests.
* fix <dynwind> serialization.Andy Wingo2011-11-091-3/+3
| | | | | * module/language/tree-il.scm (unparse-tree-il): Fix <dynwind> serialization.
* peval: don't copy assigned lexical bindingsAndy Wingo2011-11-091-11/+17
| | | | | | * module/language/tree-il/peval.scm (peval): Since constant-expression? is used to determine whether to copy values, return #f if any lexical is assigned.