summaryrefslogtreecommitdiff
path: root/module
AgeCommit message (Collapse)AuthorFilesLines
2012-02-14web server: use CLOEXECwip-threads-and-forkAndy Wingo1-1/+1
* module/web/server/http.scm (http-read): Pass SOCK_CLOEXEC to `accept'.
2012-02-14add file-port-close-on-exec?; popen takes advantage of it.Andy Wingo1-8/+13
* libguile/fports.c (scm_i_evict_port): Use F_DUPFD_CLOEXEC if the port is CLOEXEC. (scm_file_port_close_on_exec_p): New interface. (scm_i_fdes_to_port): Use F_GETFD on the fd to see if it is cloexec, and if it is, mark it in the scm_t_fport. That way popen.scm won't have to do anything about it. * module/ice-9/popen.scm (ensure-fdes): No need for false-if-exception here. (open-process): Rework the port-for-each call to not bother with file descriptors that are CLOEXEC.
2012-02-12Merge remote-tracking branch 'origin/stable-2.0'Andy Wingo2-5/+22
2012-02-12web server: do not provide a response body where it is not permittedAndy Wingo2-5/+22
* module/web/response.scm (response-must-not-include-body?): New function. * doc/ref/web.texi: Doc the function. * module/web/server.scm (sanitize-response): Error if we have a body, but the response type does not permit a body. If we are responding to a HEAD request, silently drop the body.
2012-02-11Merge remote-tracking branch 'origin/stable-2.0'Andy Wingo1-16/+8
2012-02-11web server: print backtrace on errors when run in batch modeAndy Wingo1-16/+8
* module/web/server.scm (read-client, handle-request, write-client): When run in batch mode, give a full backtrace for errors.
2012-02-11Merge remote-tracking branch 'origin/stable-2.0'Andy Wingo2-57/+149
Conflicts: libguile/read.c test-suite/tests/tree-il.test
2012-02-08Support => within case, and improve error messages for cond and caseMark H Weaver2-57/+149
* module/ice-9/boot-9.scm (cond, case): Reimplement using syntax-case, with improved error messages and support for '=>' within 'case' as mandated by the R7RS. Add warnings for duplicate case datums and case datums that cannot be meaningfully compared using 'eqv?'. * module/system/base/message.scm (%warning-types): Add 'bad-case-datum' and 'duplicate-case-datum' warning types. * test-suite/tests/syntax.test (cond, case): Update tests to reflect improved error reporting. Add tests for '=>' within 'case'. * test-suite/tests/tree-il.test (partial evaluation): Update tests to reflect changes in how 'case' is expanded. * doc/ref/api-control.texi (Conditionals): Document '=>' within 'case'.
2012-02-08Merge remote-tracking branch 'origin/stable-2.0'Andy Wingo12-40/+64
Conflicts: GUILE-VERSION libguile/gc-malloc.c libguile/ports.c
2012-02-03i18n: Provide default values for when Gnulib has no replacement.Ludovic Courtès1-26/+32
This reverts parts of a0919aefee7512686c3374876df2c549fd47e071 ("i18n: Use Gnulib's `nl_langinfo' module."). * module/ice-9/i18n.scm (define-simple-langinfo-mapping): Re-add `default' parameter, and update users accordingly.
2012-02-03Augment `-Wformat' analysis with support for `~:h'.Ludovic Courtès1-1/+7
* module/language/tree-il/analyze.scm (format-string-argument-count): Add support for ~h. * test-suite/tests/tree-il.test ("warnings")["format"]("~h", "~:h with locale object", "~:h without locale object"): New tests.
2012-02-03format: Add specifier ~h for localized number output.Ludovic Courtès1-1/+20
* doc/ref/misc-modules.texi (Formatted Output): Document ~h. Recommend use of ~h instead of ~:d. * module/ice-9/format.scm (format): Add support for ~h. * test-suite/tests/format.test ("~h localized number"): New test prefix. * test-suite/tests/i18n.test (%american-english-locale-name, %american-english-locale): New variables. (under-american-english-locale-or-unresolved): New procedure. ("format ~h"): New test prefix.
2012-02-03i18n: Use Gnulib's `nl_langinfo' module.Ludovic Courtès1-49/+42
* configure.ac: Remove checks for <langinfo.h> and <nl_types.h>, and `nl_langinfo'. * libguile/i18n.c: Remove #ifdefs for HAVE_LANGINFO_H, HAVE_NL_TYPES_H, HAVE_NL_ITEM, and HAVE_LANGINFO_CODESET. (SCM_VALIDATE_OPTIONAL_LOCALE_COPY): Use `SCM_UNBNDP'. * m4/gnulib-cache.m4 (gl_MODULES): Add `nl_langinfo'. * module/ice-9/i18n.scm (define-vector-langinfo-mapping): Remove `defaults' parameter; assume (provided? 'nl-langinfo) is always true. Update users accordingly. (define-simple-langinfo-mapping): Likewise. (define-monetary-langinfo-mapping): Likewise, but do not assume LOCAL-ITEM and INTL-ITEM are always defined.
2012-02-02Improve the usage of variable names in Scheme docstrings.Bake Timmons9-15/+15
* module/ice-9/boot-9.scm: * module/ice-9/popen.scm: * module/ice-9/pretty-print.scm: * module/ice-9/r4rs.scm: * module/rnrs/io/ports.scm: * module/texinfo/string-utils.scm: * module/web/http.scm: * module/web/request.scm: * module/web/response.scm: * test-suite/vm/run-vm-tests.scm: Make the variable names in Scheme docstrings more consistent. Replace a few instances of @var with @code when appropriate.
2012-01-30"fix" local-eval for introduced toplevelsAndy Wingo1-1/+5
* module/ice-9/local-eval.scm: Fix for introduced toplevel identifiers.
2012-01-30Merge remote-tracking branch 'origin/stable-2.0'Andy Wingo15-18532/+18980
Conflicts: libguile/debug.h module/ice-9/psyntax-pp.scm module/ice-9/psyntax.scm module/language/tree-il/peval.scm module/language/tree-il/primitives.scm
2012-01-30Merge commit '3d51e57cfb0404db568a6adfde2a346d3fd9907e'Andy Wingo8-30/+102
Conflicts: libguile/foreign.c libguile/hashtab.c module/ice-9/psyntax-pp.scm module/language/tree-il/compile-glil.scm
2012-01-30Merge commit '9b0975f1dc41ddd10d81fb5b0965b9e9a54ef37a'Andy Wingo3-6/+56
Conflicts: libguile/foreign.c module/ice-9/psyntax-pp.scm module/ice-9/psyntax.scm
2012-01-30Fix primitive-eval to return #<unspecified> for definitionsMark H Weaver1-1/+2
* module/ice-9/eval.scm (primitive-eval): Return #<unspecified> for definitions. Previously the variable object was returned. * test-suite/tests/eval.test (evaluator): Add test. * NEWS: Add news entry.
2012-01-30Fix 'local-eval' when the specified environment is a moduleMark H Weaver1-1/+1
* module/ice-9/local-eval.scm (local-wrap): Fix the (module? e) case, to reference the expression 'x' instead of the non-existent variable 'exp', as was previously done. Also use quasisyntax instead of quasiquote, so that the introduced 'lambda' is an identifier instead of a bare symbol, so that this will work in modules that have rebound 'lambda' to something else. * test-suite/tests/eval.test (local-eval): Make sure to test both 'local-eval' and 'local-compile' when the specified environment is a module.
2012-01-30Update user-visible copyright dates in manual and REPL to 2012Mark H Weaver1-1/+1
* doc/ref/guile.texi, module/system/repl/common.scm: Update user-visible copyright dates to 2012.
2012-01-27Fix error messages involving definition formsMark H Weaver2-11325/+11471
* module/ice-9/psyntax.scm (syntax-type): Return an additional value that contains the entire form in _all_ cases, including for definition forms. Previously, the entire form was not returned for definition forms. (expand-expr): Add an additional argument that contains the entire form in _all_ cases, including for definition forms. Use it to include the entire form in error messages, notably for definitions in expression context. Include the source location information, which was previously missing from these errors when the rhs expression was an atom. Improve the "definition in expression context" error message to be more comprehensible for Scheme beginners. (expand-top-sequence, expand, expand-body): Adjust as needed to handle the additional return value from 'syntax-type' and the additional argument to 'expand-expr'. * module/ice-9/psyntax-pp.scm: Regenerate. * NEWS: Update.
2012-01-26more readable gensymsAndy Wingo3-5989/+5214
* module/language/tree-il/peval.scm (peval): * module/language/tree-il/primitives.scm (dynamic-wind): When you make a gensym that just has to be compared against other gensyms, it will be unique if the prefix doesn't end in something that can be interpreted as a number. There's no reason to make that character something difficult like " ". So change to use a dash in that case. * module/ice-9/psyntax-pp.scm: Regenerate. More readable now.
2012-01-26globally unique marks and labels using syntax-session-idAndy Wingo4-12952/+12078
* libguile/macros.c (scm_init_macros): Add definition of new syntax-session-id helper. * module/ice-9/psyntax.scm: Capture a reference to syntax-session-id at boot time. Uniquify marks and labels using the session id. * module/ice-9/boot-9.scm: Shunt syntax-session-id off to (system syntax) once we finished booting. * module/ice-9/compile-psyntax.scm: Override syntax-session-id when remaking psyntax to avoid spurious diffs. * module/ice-9/psyntax-pp.scm: Regenerate.
2012-01-26Implement `local-eval', `local-compile', and `the-environment'Andy Wingo2-2/+254
* module/ice-9/local-eval.scm: New module (ice-9 local-eval) which exports `the-environment', `local-eval', and `local-compile'. * libguile/debug.c (scm_local_eval): New C function that calls the Scheme implementation of `local-eval' in (ice-9 local-eval). * libguile/debug.h (scm_local_eval): Add prototype. * doc/ref/api-evaluation.texi (Local Evaluation): Add documentation. * test-suite/tests/eval.test (local evaluation): Add tests. * test-suite/standalone/test-loose-ends.c (test_scm_local_eval): Add test. * module/Makefile.am: Add ice-9/local-eval.scm. Based on a patch by Mark H Weaver <mhw@netris.org>.
2012-01-26Fix a couple of warnings.Ludovic Courtès2-2/+4
* module/scripts/list.scm: Use SRFI-1. * module/system/repl/error-handling.scm: Use (ice-9 format).
2012-01-26Fix typo in `-Wformat'.Ludovic Courtès1-1/+1
* module/language/tree-il/analyze.scm (format-analysis): Call `warning', not `warn'.
2012-01-26Add warnings for unsupported `simple-format' options.Ludovic Courtès3-5/+57
* module/language/tree-il/analyze.scm (format-analysis)[check-simple-format-args]: New procedure. Use it. Add support for applications of <module-ref>. * module/system/base/message.scm (%warning-types): Handle the `format simple-format' warning. * module/language/scheme/spec.scm (scheme)[make-default-environment]: Use `simple-format' as the default `format'. * test-suite/tests/tree-il.test ("warnings")["format"]: Explicitly use (@ (ice-9 format) format) where needed. ("simple-format"): New test prefix.
2012-01-25new syntax procedures to (system syntax)Andy Wingo3-12338/+12363
* module/ice-9/boot-9.scm: * module/ice-9/psyntax.scm (syntax-module, syntax-local-binding) (syntax-locally-bound-identifiers): After boot, move these definitions to a new (system syntax) module. * module/ice-9/psyntax-pp.scm: Regenerate. * doc/ref/api-macros.texi: Add some words about syntax-module and friends being in (system syntax).
2012-01-25add syntax-moduleAndy Wingo3-7053/+7077
* module/ice-9/psyntax.scm (syntax-module): New accessor for syntax objects. * module/ice-9/psyntax-pp.scm: Regenerate. * module/ice-9/boot-9.scm: Declare syntax-module. * doc/ref/api-macros.texi: Document it.
2012-01-25add syntax-locally-bound-identifiersAndy Wingo3-11456/+13042
* module/ice-9/boot-9.scm (syntax-locally-bound-identifiers): Declare variable. * module/ice-9/psyntax.scm: Add locally-bound-identifiers helper, and define syntax-locally-bound-identifiers. * module/ice-9/psyntax-pp.scm: Regenerated. * doc/ref/api-macros.texi: Document the new procedure.
2012-01-25better function prologue disassemblyAndy Wingo1-1/+4
* module/language/assembly/disassemble.scm (code-annotation): Add an annotation for assert-nargs-ee/locals and assert-nargs-ge/locals.
2012-01-25add another case in which to fold (values FOO) to FOO, for some FOOAndy Wingo1-2/+4
* module/language/tree-il/peval.scm (peval): Fold (values 'singly-valued-expression) to 'singly-valued-expression in contexts that expect multiple values, in addition to those that expect single values.
2012-01-25fix values miscompilation in push context with RAAndy Wingo1-4/+3
* module/language/tree-il/compile-glil.scm (flatten-lambda-case): Fix miscompilation of `values' in a push context with RA. * test-suite/tests/tree-il.test: Add low-level test for this miscompilation.
2012-01-24vlist: Use (ice-9 format).Ludovic Courtès1-1/+2
* module/ice-9/vlist.scm: Use (ice-9 format).
2012-01-23current-filename canonicalizes path, remove add-to-pathAndy Wingo1-8/+4
* module/ice-9/boot-9.scm (current-filename): Canonicalize the path, so that the result is independent of the current directory, and so that `dirname' can traverse up the file system, as in the add-to-load-path example. (add-to-path): Remove. The eval-when semantics make this macro too tricky to explain -- people will start using it on other path-like things, in lexical contours, whereas it only really makes sense with load-like paths at the toplevel. * doc/ref/api-evaluation.texi (Loading): Fix link to load-with-path docs, and remove add-to-path docs.
2012-01-21add current-filename, add-to-path, add-to-load-pathAndy Wingo1-0/+21
* module/ice-9/boot-9.scm (current-filename, add-to-path) (add-to-load-path): New syntaxen. * doc/ref/api-evaluation.texi (Loading): Move load-path related procedures to a new section: (Load Paths): Hither. Document add-to-path and add-to-load-path. * doc/ref/api-debug.texi (Source Properties): Document current-source-location and current-filename. * doc/ref/api-modules.texi: * doc/ref/guile-invoke.texi: * doc/ref/scheme-using.texi: Update @ref for Load Paths change.
2012-01-20remove duplicate when/unless definitionsAndy Wingo2-20/+3
* module/rnrs/control.scm: * module/sxml/ssax.scm: * test-suite/lalr/common-test.scm: Remove local `when'/`unless' definitions.
2012-01-20add when, unlessAndy Wingo1-0/+6
* module/ice-9/boot-9.scm (when, unless): New forms. * doc/ref/api-control.texi (Conditionals): Add docs. Rename this node from "if cond case". * doc/ref/r6rs.texi: * doc/ref/scheme-ideas.texi: * doc/ref/srfi-modules.texi: Update referrers.
2012-01-19avoid gensym when making labels in psyntaxAndy Wingo2-11701/+11461
* module/ice-9/psyntax.scm (gen-label): Avoid gensym, as we don't need to make symbols. * module/ice-9/psyntax-pp.scm: Regenerate.
2012-01-19add syntax-local-bindingAndy Wingo3-19703/+20205
* module/ice-9/boot-9.scm (syntax-local-binding): New binding. * module/ice-9/psyntax.scm: Locally define a fluid that holds the "transformer environment". with-transformer-environment calls a procedure with the transformer environment, or raises an error if called outside the extent of a transformer. Bind transformer-environment in expand-macro. (resolve-identifier): Backport this helper from master. (syntax-local-binding): New procedure to return binding information of a bound identifier (a lexical, macro, a pattern variable, a displaced lexical, a global, or some other form). * module/ice-9/psyntax-pp.scm: Regenerate. * doc/ref/api-macros.texi (Syntax Transformer Helpers): Add docs for syntax-local-binding, and syntax-source, and move some other descriptions to this new section.
2012-01-15Call scm-error with the correct argument order.Chris K. Jester-Young1-2/+2
* module/ice-9/boot-9.scm (catch, with-throw-handler): Switch the order of the error key and function name arguments.
2012-01-14Don't diverge when serializing cyclic lists during compilationMark H Weaver1-3/+5
* module/language/glil/compile-assembly.scm (scheme-list?): Don't diverge when serializing cyclic lists.
2012-01-14Fix serialization of #nil-terminated lists during compilationMark H Weaver1-2/+9
* module/language/glil/compile-assembly.scm (scheme-list?): New predicate, like `list?' but requires that the last cdr must be '(), not #nil. (dump-object, dump-constants): Use `list' opcode to create a list only if it is terminated by '(). If it's terminated by #nil, we must use the more general `cons' opcode.
2012-01-10Merge remote-tracking branch 'origin/stable-2.0'Andy Wingo9-70/+114
Conflicts: libguile/__scm.h libguile/array-map.c libguile/procprop.c libguile/tags.h module/ice-9/deprecated.scm module/ice-9/psyntax-pp.scm module/ice-9/psyntax.scm test-suite/standalone/test-num2integral.c test-suite/tests/regexp.test
2012-01-10Merge commit 'f78a1ccede02ccad89d6c91a6b297f1f14a30907'Andy Wingo5-21/+30
2012-01-10Merge commit 'cc8afa2b361635953dfba7f10e4193b1f243a50f'Andy Wingo4-11274/+11334
Conflicts: module/ice-9/psyntax-pp.scm module/language/tree-il/peval.scm
2012-01-09permit non-date values for Expires headerDaniel Hartwig1-1/+9
* module/web/http.scm ("Expires"): Permit (some) non-date values.
2012-01-09Have `cpu-word-size' error out on unknown CPUs; add support for MIPSEL.Ludovic Courtès1-3/+3
* module/system/base/target.scm (cpu-word-size): Add support for `mipsel'. Call `error' when CPU is unknown.
2012-01-08ftw: Add an `error' parameter to `file-system-fold'.Ludovic Courtès1-53/+80
* module/ice-9/ftw.scm (errno-if-exception): New macro. (file-system-fold): Add an `error' parameter. Wrap `opendir' and STAT calls in `errno-if-exception' and call ERROR when appropriate. (file-system-tree): Provide an `error' procedure. Return #f when FILE-NAME is unreadable. (scandir): Provide an `error' procedure. * test-suite/tests/ftw.test (%top-builddir): New variable. (make-file-tree, delete-file-tree): New procedures. (with-file-tree): New macro. ("file-system-fold"): Update tests to add an `error' procedure. ["ENOENT", "EACCES", "dangling symlink and lstat", "dangling symlink and stat"]: New tests. ("file-system-tree")["ENOENT"]: New test. ("scandir")["EACCES"]: New test. * doc/ref/misc-modules.texi (File Tree Walk): Update `file-system-fold' documentation.