* module/language/elisp/compile-tree-il.scm (compile-lambda): Use
Tree-IL's support for optional arguments.
(process-optionals, process-rest): Remove.
Signed-off-by: Andy Wingo <wingo@pobox.com>
* test-suite/tests/elisp-compiler.test (compile-test): Add
`pass-if-equal' to the list of literal identifiers
Signed-off-by: Andy Wingo <wingo@pobox.com>
* module/language/elisp/bindings.scm:
* module/language/elisp/compile-tree-il.scm:
* module/language/elisp/lexer.scm:
* module/language/elisp/parser.scm:
* module/language/elisp/runtime.scm:
* module/language/elisp/runtime/function-slot.scm:
* module/language/elisp/runtime/macro-slot.scm: Ensure that all
top-level forms and comments are separated by exactly one newline.
Remove blank lines in most procedure bodies. Delete trailing
whitespace.
Signed-off-by: Andy Wingo <wingo@pobox.com>
* libguile/fluids.c (scm_make_undefined_fluid, scm_fluid_unset_x)
(scm_fluid_bound_p): New functions.
(fluid_ref): New function; like scm_fluid_ref, but will not throw an
error for unbound fluids.
(scm_fluid_ref, swap_fluid): Use `fluid_ref'.
* libguile/fluids.h (scm_make_undefined_fluid, scm_fluid_unset_x)
(scm_fluid_bound_p): New prototypes.
* libguile/vm-i-system.c (fluid_ref): If fluid is unbound, jump to
`vm_error_unbound_fluid'.
* libguile/vm-engine.c (VM_NAME)[vm_error_unbound_fluid]: New error
message.
* test-suite/tests/fluids.test ("unbound fluids")["fluid-ref of unbound
fluid", "fluid-bound? of bound fluid", "fluid-bound? of unbound
fluid", "unbound fluids can be set", "bound fluids can be unset"]: New
tests.
* libguile/vm-i-system.c (variable-ref, toplevel-ref)
(long-toplevel-ref): Fixup callers.
* libguile/vm-engine.c (vm_error_unbound): Don't use vm-error for
unbound vars, use misc-error. Don't include VM: in the string. Take
the name directly in finish_args, not as a list.
* test-suite/guile-test: Use "../meta/guile" as the interpreter instead
of "../libguile/guile".
(default-test-suite): New function, replacing the variable of the same
name. Look for tests in the same directory as the guile-test script.
Throw an error if not invoked as `guile-test'.
(test-suite): The old default value of `default-test-suite' could now
throw an error, and this already gets initialized in `main', so don't
provide an initial value.
material
* doc/ref/goops.texi (GOOPS): Move use of (oop goops) here.
(Class Definition): Merged with `Defining New Classes'
(Instance Creation): Insert before covering slot options. Merge in
material from `Creating Instances'.
(Slot Options): Merged some better wording and index entries from
the tutorial version.
(Slot Description Example): New node, containing the <my-complex>
material from the tutorial.
(Methods and Generic Functions, Inheritance): Tutorial sections
moved into main line of the manual.
* doc/ref/goops-tutorial.texi: Nothing left here now.
* doc/ref/goops-tutorial.texi (Class definition): No reason to assume
particular familiarity with CLOS.
(Instance creation and slot access): Remove a couple of words.
* libguile/ports.c (scm_drain_input): Slight optimization.
* libguile/fports.c (scm_setvbuf): If there is buffered output, flush
it. If there is input, drain it, and then unread it after updating
the buffers. Much more sensible than dropping it silently...
* module/web/server/http.scm (http-read): Don't play the setvbuf dance,
it was throwing away buffered input. Instead just call setvbuf once
before doing any reads or writes.
* libguile/poll.c (scm_primitive_poll): Account for buffered I/O.
* module/ice-9/poll.scm (poll): Adapt to call primitive-poll with the
port vector too.
* module/web/request.scm (read-response-body/latin-1):
* module/web/response.scm (read-response-body/latin-1): Avoid the
craziness of the read-delimited! interface and hand-roll our
own. Fixes errors if read-delimited returns #f or EOF.
* module/web/http.scm: Add commentary.
(parse-quality): Allow .NNN to be interpreted as 0.NNN.
* test-suite/tests/web-http.test ("request headers"): Add a test.
* module/web/request.scm (read-request-body/latin-1):
* module/web/response.scm (read-response-body/latin-1): Detect short
reads instead of returning a full buffer with the last bits zeroed
out. (Before the make-string commit, they contained uninitialized
memory, which was a fairly serious error.)
* libguile/gc-malloc.c: Add a note that the gc-malloc does not clear the
memory block, so users need to make sure it is initialized.
* libguile/bitvectors.c (scm_c_make_bitvector):
* libguile/bytevectors.c (scm_make_bytevector):
* libguile/strings.c (scm_c_make_string): If no initializer is given,
initialize the bytes to 0. Prevents information leakage if an app uses
make-string et al without initializers.
* libguile/foreign.c (make_cif): Initialize this too, to prevent leakage
in the struct holes. Paranoia...
* module/web/server/http.scm (http-read): No need for a
call-with-error-handling block here, as the read impl is itself within
an error-handling block.
* module/web/server/http.scm (http-open): Allow up to 128 pending
connections -- the default value for somaxconn on a number of
machines. This is from the HOP paper.
(http-read): Set the send buffer to 12 KB, also from the HOP paper.
* module/web/server/http.scm (http-read): Rewrite to iterate down the
pollset, so the vector shuffles touch less memory and the end
condition of the loop is clearer.
* module/web/server.scm: Rewrite to remove the extra "keep-alive"
parameter. Instead, since the server is an essentially stateful
object, have clients that want to do keep-alive manage that set as
part of the server state. Also avoids imposing a particular data
structure on the server implementation.
* module/web/server/http.scm: Adapt to the new server interface. Also,
use a poll set instead of select and lists. Makes handling 1000
clients at a time much more possible.
* configure.ac: Add checks for `sched_setaffinity' and
`sched_getaffinity'.
* doc/ref/posix.texi (Processes): Document `getaffinity' and
`setaffinity'.
* libguile/posix.c (cpu_set_to_bitvector,
scm_getaffinity)[HAVE_SCHED_GETAFFINITY]: New functions.
(scm_setaffinity)[HAVE_SCHED_SETAFFINITY]: New function.
* libguile/posix.h (scm_getaffinity, scm_setaffinity): New declarations.
* test-suite/tests/posix.test ("affinity"): New test prefix.
* libguile/socket.c (scm_accept): Revert
7d1fc87217. Now that we don't need to
leave guile mode in order for GC to happen, don't do so, as we assume
that anyone who cares has already done a select() beforehand.
* module/sxml/simple.scm: Remove "universal-sxslt-rules" -- it was a bad
interface, and I couldn't find any users of it.
(sxml->xml): Rewrite so that instead of generating another tree of
data, we write the data directly to a port.
* module/web/server/http.scm (http-read, http-write): Line-buffer the
port while we're reading the request, and block-buffer it otherwise
Use the default block size.
* module/web/server.scm (sanitize-response): Support charsets other than
utf-8. Oddly collecting a string and converting it to utf-8 appears to
be faster than collecting a utf-8 bytevector directly.
* examples/web/hello.scm:
* examples/web/debug-sxml.scm: New examples, for simple web
applications.
* examples/README:
* examples/Makefile.am: Add new files.
* module/web/server.scm (read-client): Fix number of returned values in
the case in which there is an error reading the client.
(sanitize-response): Add a case to adapt the reponse to the request
version.
(handle-request): Sanitize the response within an error-handling
block.
(serve-one-client): Move sanitation out of here.
* module/web/server/http.scm (keep-alive?): A more proper detection on
whether we should support persistent connections.
* module/web/response.scm (adapt-response-version): New routine, to
adapt a response to a given version. Currently a stub.
* module/rnrs/base.scm (error, assert): Define -- they were missing.
(assertion-violation): Properly treat a #f `who' argument.
* module/rnrs/conditions.scm (condition): Use `assertion-violation'
instead of the undefined `raise'.
(define-condition-type): Fix for multiple fields.
* test-suite/tests/r6rs-conditions.test: Test accessors of a
multiple-field condition. Also import `(rnrs base)' to allow
stand-alone running of the tests; apparently the `@' references
scattered throughout the R6RS modules make the libraries sensitive to
their load order -- for instance, trying to load `(rnrs conditions)'
before `(rnrs base)' is loaded fails.
* module/rnrs/records/inspection.scm: Use `assertion-violation' instead
of an explicit `raise'.
* module/rnrs/records/syntactic.scm (process-fields): Use
`syntax-violation' instead of bogus invocations of `error'.