summaryrefslogtreecommitdiff
path: root/doc/ref
AgeCommit message (Collapse)AuthorFilesLines
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-11Clean up (array-for-each-cell)Daniel Llorens1-19/+15
* 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-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-11Rename array-set-from!, scm_array_set_from_x to array-amend!, scm_array_amend_xDaniel Llorens1-5/+7
2016-07-11Tests & doc for array-from, array-from*, array-set-from!Daniel Llorens1-11/+114
* 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-10Add meta/build-envAndy Wingo1-1/+1
* 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-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-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-24Add with-input-from-port, etc documentationAndy Wingo1-0/+8
* doc/ref/api-io.texi (Default Ports): Add documentation for with-input-from-port, with-output-to-port, and with-error-to-port. Fixes #20919.
2016-06-24Clarify use of the term "scanning" in the manualAndy Wingo2-34/+56
* doc/ref/api-memory.texi (Garbage Collection Functions): * doc/ref/libguile-concepts.texi (Garbage Collection): Attempt to be clear that scanning is a thing that happens in the mark phase. Fixes #20907 I think.
2016-06-23Add weak hash table documentationAndy Wingo1-2/+10
* doc/ref/api-memory.texi (Weak hash tables): Update documentation. Fixes #20551.
2016-06-23Fix R6RS fold-left documentationAndy Wingo1-4/+8
* doc/ref/r6rs.texi (rnrs lists): Fix documentation of fold-left.
2016-06-21`define!' instruction returns the variableAndy Wingo1-2/+2
* doc/ref/vm.texi (Top-Level Environment Instructions): Update documentation. * libguile/_scm.h (SCM_OBJCODE_MINOR_VERSION): Bump, sadly. * module/system/vm/assembler.scm (*bytecode-minor-version*): Bump. * libguile/vm-engine.c (define!): Change to store variable in dst slot. * module/language/tree-il/compile-cps.scm (convert): * module/language/cps/compile-bytecode.scm (compile-function): Adapt to define! change. * module/language/cps/effects-analysis.scm (current-module): Fix define! effects. Incidentally here was the bug: in Guile 2.2 you can't have effects on different object kinds in one instruction, without reverting to &unknown-memory-kinds. * test-suite/tests/compiler.test ("regression tests"): Add a test.
2016-06-21Document pretty-print #:max-expr-widthAndy Wingo1-0/+3
* doc/ref/misc-modules.texi (Pretty Printing): Document #:max-expr-width keyword argument. Fixes #17657.
2016-06-21Document sigaction + SA_RESTARTAndy Wingo1-0/+16
* doc/ref/posix.texi (Signals): Document interaction between Guile's signal handling and SA_RESTART. Fixes #14640.
2016-06-20Document char-ready? limitations.Andy Wingo1-0/+16
* doc/ref/api-io.texi (Venerable Port Interfaces): Document limitations of char-ready?. See http://debbugs.gnu.org/10627.
2016-06-20Fix uri-decode behavior for "+"Andy Wingo1-1/+6
* module/web/uri.scm (uri-decode): Add #:decode-plus-to-space? keyword argument. (split-and-decode-uri-path): Don't decode plus to space. * doc/ref/web.texi (URIs): Update documentation. * test-suite/tests/web-uri.test ("decode"): Add tests. * NEWS: Add entry. Based on a patch by Brent <brent@tomski.co.za>.
2016-06-19Add reference to the lack of "non-greedy" variantsDiogo F. S. Ramos1-4/+5
While describing special characters, remind the reader that "non-greedy" variants are not supported. They might not be familiar with POSIX extended regular expression and expect it to work. * doc/ref/api-regex.texi: Add "non-greedy" observation
2016-06-19Remove link to Emacs' regexp syntaxDiogo F. S. Ramos1-4/+1
Linking to Emacs' regexps as an example of regexp syntax gives the wrong impression that Guile supports it, which is not true. * doc/ref/api-regex.texi: Remove link to Emacs' regexp syntax
2016-06-09Support `connect' on nonblocking socketsAndy Wingo1-4/+6
* libguile/socket.c (scm_connect): * doc/ref/posix.texi (Network Sockets and Communication): Support connect on nonblocking ports.
2016-06-09`accept' on nonblocking socket can return #fAndy Wingo1-7/+18
* doc/ref/posix.texi (Network Sockets and Communication): * libguile/socket.c (scm_accept): Return #f if the socket is nonblocking and no connection is ready.
2016-06-09Update port documentation, rename sports to suspendable portsAndy Wingo1-220/+188
* module/ice-9/suspendable-ports.scm: Rename from ice-9/sports.scm, and adapt module names. Remove exports that are not related to the suspendable ports facility; we want people to continue using the port operations from their original locations. Add put-string to the replacement list. * module/Makefile.am: Adapt to rename. * test-suite/tests/suspendable-ports.test: Rename from sports.test. * test-suite/Makefile.am: Adapt to rename. * module/ice-9/textual-ports.scm (unget-char, unget-string): New functions. * doc/ref/api-io.texi (Textual I/O, Simple Output): Flesh out documentation. (Line/Delimited): Undocument write-line, read-string, and read-string!. This is handled by (ice-9 textual-ports). (Bytevector Ports): Fix duplicated section. (String Ports): Move the note about encodings down to the end. (Custom Ports): Add explanatory text. Remove mention of C functions; they should use the C port interface. (Venerable Port Interfaces): Add text, and make documentation refer to recommended interfaces. (Using Ports from C): Add documentation. (Non-Blocking I/O): Document more fully and adapt to suspendable-ports name change.
2016-06-08Big ports documentation updateAndy Wingo8-1282/+1253
* doc/ref/api-io.texi: Update to document ports more thoroughly. Still some work needed. * doc/ref/r6rs.texi: Move ports documentation back to r6rs.texi, now that Guile has a more thorough binary/textual I/O story, heavily based on R6RS. * doc/ref/api-control.texi: * doc/ref/api-data.texi: * doc/ref/api-options.texi: * doc/ref/misc-modules.texi: * doc/ref/posix.texi: * doc/ref/srfi-modules.texi: Update references.
2016-06-08Undocument (ice-9 rw)Andy Wingo1-101/+0
* doc/ref/api-io.texi (Block Reading and Writing): Undocument (ice-9 rw). The R6RS routines do the same job and are not so clunky.
2016-06-04socket: TCP_CORK, TCP_NODELAYAndy Wingo1-0/+9
* libguile/socket.c (scm_init_socket): Define TCP_NODELAY and TCP_CORK if they are available. * doc/ref/posix.texi (Network Sockets and Communication): Add documentation. * NEWS: Add entry.
2016-05-22doc: Fix typo in Web documentation.Luribert1-2/+2
* doc/ref/web.texi (Http Headers): Fixed typo. Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2016-05-22Bump user-visible copyright years to 2016.Mark H Weaver1-1/+1
* doc/ref/guile.texi: Add 2016 to user-visible copyright notice. * module/ice-9/command-line.scm (version-etc): Bump 'copyright-year' to 2016. * module/system/repl/common.scm (*version*): Add 2016 to the range of copyright years.
2016-05-22docs: Fix external representation of <toplevel-define> in tree-il.Mark H Weaver1-2/+2
* doc/ref/compiler.texi (Tree-IL): Provide the correct external representation of <toplevel-define>.
2016-05-22doc: Fix menu order for SXML.Ludovic Courtès1-9/+9
* doc/ref/sxml.texi (SXML): Add missing quotes in example. Fix node order in menu.
2016-05-22doc: Add SXPath documentation from sourcesRicardo Wurmus1-35/+267
Fixes <http://bugs.gnu.org/19478>. * doc/ref/sxml.texi (SXPath): Add procedure documentation from sources. Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2016-05-22Clarify datum->syntax documentation.Taylan Ulrich Bayırlı/Kammer1-4/+4
* doc/ref/api-macros.texi (Syntax Case): Make it clear that the first argument to datum->syntax must be an identifier.
2016-05-22Fix uses of 'scm_gc_protect', which does not exist, in the manual.Mark H Weaver2-5/+5
* doc/ref/api-memory.texi (Garbage Collection Functions), doc/ref/libguile-concepts.texi (Garbage Collection): Change 'scm_gc_protect' --> 'scm_gc_protect_object'.
2016-05-22doc: Fix parameter of 'set-record-type-printer!'.Mathieu Lirzin1-1/+1
* doc/ref/api-compound.texi (SRFI-9 Records)[set-record-type-printer!]: Fix parameter name.
2016-05-22Fix typo in manual.Alex Kost1-2/+2
* doc/ref/api-modules.texi (Using Guile Modules): Remove extra "yet".
2016-05-22doc: Update libgc URL.Ludovic Courtès1-2/+2
* doc/ref/data-rep.texi (Conservative GC): Update libgc URL.
2016-05-22Implement 'string-utf8-length' and 'scm_c_string_utf8_length'.Mark H Weaver2-2/+8
* libguile/strings.c (utf8_length, scm_c_string_utf8_length) (scm_string_utf8_length): New functions. * libguile/strings.h (scm_c_string_utf8_length, scm_string_utf8_length): New prototypes. * doc/ref/api-data.texi (Bytevectors as Strings): Add docs. * doc/ref/guile.texi: Update manual copyright date to 2015. * test-suite/tests/strings.test (string-utf8-length): Add tests.
2016-05-20Support for non-blocking I/OAndy Wingo1-0/+87
* doc/ref/api-io.texi (I/O Extensions): Document read_wait_fd / write_wait_fd members. (Non-Blocking I/O): New section. * libguile/fports.c (fport_read, fport_write): Return -1 if the operation would block. (fport_wait_fd, scm_make_fptob): Add read/write wait-fd implementation. * libguile/ports-internal.h (scm_t_port_type): Add read_wait_fd / write_wait_fd. * libguile/ports.c (default_read_wait_fd, default_write_wait_fd): New functions. (scm_make_port_type): Initialize default read/write wait fd impls. (trampoline_to_c_read, trampoline_to_scm_read) (trampoline_to_c_write, trampoline_to_scm_write): To Scheme, a return of #f indicates EWOULDBLOCk. (scm_set_port_read_wait_fd, scm_set_port_write_wait_fd): New functions. (port_read_wait_fd, port_write_wait_fd, scm_port_read_wait_fd) (scm_port_write_wait_fd, port_poll, scm_port_poll): New functions. (scm_i_read_bytes, scm_i_write_bytes): Poll if the read or write would block. * libguile/ports.h (scm_set_port_read_wait_fd) (scm_set_port_write_wait_fd): Add declarations. * module/ice-9/ports.scm: Shunt port-poll and port-{read,write}-wait-fd to the internals module. * module/ice-9/sports.scm (current-write-waiter): (current-read-waiter): Implement. * test-suite/tests/ports.test: Adapt non-blocking test to new behavior. * NEWS: Add entry.
2016-05-16U+FFFD is the input substitution characterAndy Wingo1-34/+42
* libguile/ports.c (UNICODE_REPLACEMENT_CHARACTER): * libguile/ports.c (peek_utf8_codepoint) (scm_port_decode_char, peek_iconv_codepoint): * module/ice-9/sports.scm (peek-char-and-len/utf8): (peek-char-and-len/iconv): Return U+FFFD when we get a decoding error when reading, instead of '?', in accordance with Unicode recommendations. * test-suite/tests/iconv.test: * test-suite/tests/ports.test: * test-suite/tests/rdelim.test: Update tests. * NEWS: Update.
2016-05-14Document scm_c_make_port and friendsAndy Wingo1-1/+21
* doc/ref/api-io.texi (I/O Extensions): Document scm_c_make_port and friends, and document "mode bits".
2016-05-13Update port type documentationAndy Wingo1-12/+13
* doc/ref/api-io.texi (I/O Extensions): Update for port type change.
2016-05-13Update port documentationAndy Wingo1-79/+41
* doc/ref/api-io.texi: Update for refactorings.
2016-05-13Add random_access_p port type methodAndy Wingo1-57/+45
* doc/ref/api-io.texi (I/O Extensions): Update documentation on implementing port types. Document get_natural_buffer_sizes. Document the new random_access_p. * libguile/fports.c (scm_i_fdes_to_port, fport_random_access_p): (scm_make_fptob): Instead of frobbing rw_random manually, implement a random_access_p function. * libguile/ports.c (default_random_access_p) (scm_set_port_random_access_p): New functions. scm_make_port_type, scm_c_make_port_with_encoding): Arrange for random_access_p to work.
2016-05-04Add integer->char and char->integer opcodesAndy Wingo1-0/+10
* libguile/vm-engine.c (integer_to_char, char_to_integer): New opcodes. * libguile/vm.c (vm_error_not_a_char): New error case. * module/language/cps/compile-bytecode.scm (compile-function): * module/language/cps/slot-allocation.scm (compute-var-representations): * module/language/cps/types.scm: * module/language/tree-il/compile-cps.scm (convert): * doc/ref/vm.texi (Inlined Scheme Instructions): * module/system/vm/assembler.scm: Add support for new opcodes.
2016-04-12Update port implementation documentation.Andy Wingo1-8/+12
* doc/ref/api-io.texi (I/O Extensions): Update read/write documentation.
2016-04-06Generic port facility provides buffering uniformlyAndy Wingo2-253/+242
* libguile/ports.h (struct scm_t_port_buffer): New data type. (struct scm_t_port): Refactor to use port buffers instead of implementation-managed read and write pointers. Add "read_buffering" member. (SCM_INITIAL_PUTBACK_BUF_SIZE, SCM_READ_BUFFER_EMPTY_P): Remove. (scm_t_ptob_descriptor): Rename "fill_input" function to "read", and take a port buffer, returning void. Likewise "write" takes a port buffer and returns void. Remove "end_input"; instead if there is buffered input and rw_random is true, then there must be a seek function, so just seek back if needed. Remove "flush"; instead all calls to the "write" function implicitly include a "flush", since the buffering happens in the generic port code now. Remove "setvbuf", but add "get_natural_buffer_sizes"; instead the generic port code can buffer any port. (scm_make_port_type): Adapt to read and write prototype changes. (scm_set_port_flush, scm_set_port_end_input, scm_set_port_setvbuf): Remove. (scm_slow_get_byte_or_eof_unlocked) (scm_slow_get_peek_or_eof_unlocked): Remove; the slow path is to call scm_fill_input. (scm_set_port_get_natural_buffer_sizes): New function. (scm_c_make_port_buffer): New internal function. (scm_port_non_buffer): Remove. This was a function for implementations that is no longer needed. Instead open with BUF0 or use (setvbuf port 'none). (scm_fill_input, scm_fill_input_unlocked): Return the filled port buffer. (scm_get_byte_or_eof_unlocked, scm_peek_byte_or_eof_unlocked): Adapt to changes in buffering and EOF management. * libguile/ports.c: Adapt to port interface changes. (initialize_port_buffers): New function, using the port mode flags to set up appropriate initial buffering for all ports. (scm_c_make_port_with_encoding): Create port buffers here instead of delegating to implementations. (scm_close_port): Flush the port if needed instead of delegating to the implementation. * libguile/filesys.c (set_element): Adapt to buffering changes. * libguile/fports.c (fport_get_natural_buffer_sizes): New function, replacing scm_fport_buffer_add. (fport_write, fport_read): Update to let the generic ports code do the buffering. (fport_flush, fport_end_input): Remove. (fport_close): Don't flush in a dynwind; that's the core ports' job. (scm_make_fptob): Adapt. * libguile/ioext.c (scm_redirect_port): Adapt to buffering changes. * libguile/poll.c (scm_primitive_poll): Adapt to buffering changes. * libguile/ports-internal.h (struct scm_port_internal): Remove pending_eof flag; this is now set on the read buffer. * libguile/r6rs-ports.c (struct bytevector_input_port): New type. The new buffering arrangement means that there's now an intermediate buffer between the bytevector and the user of the port; this could lead to a perf degradation, but on the other hand there are some other speedups enabled by the buffering refactor, so probably the memcpy cost is dwarfed by the cost of the other parts of the ports machinery. (make_bytevector_input_port, bytevector_input_port_read): (bytevector_input_port_seek, initialize_bytevector_input_ports): Adapt to new buffering arrangement. (struct custom_binary_port): Remove read buffer, as Guile handles that now. (custom_binary_input_port_setvbuf): Remove; now handled by Guile. (make_custom_binary_input_port, custom_binary_input_port_read) (initialize_custom_binary_input_ports): Adapt. (scm_get_bytevector_some): Adapt to new EOF management. (scm_t_bytevector_output_port_buffer): Hold on to the underlying port, so we can flush it if it's open. (make_bytevector_output_port, bytevector_output_port_write): (bytevector_output_port_seek): Adapt. (bytevector_output_port_procedure): Flush the port as appropriate, so that we get all the bytes. (make_custom_binary_output_port, custom_binary_output_port_write): Adapt. (make_transcoded_port): Don't muck with buffering. (transcoded_port_write): Simply forward the write to the underlying port. (transcoded_port_read): Likewise. (transcoded_port_close): No need to flush. (initialize_transcoded_ports): Adapt. * libguile/read.c (scm_i_scan_for_encoding): Adapt to buffering changes. * libguile/rw.c (scm_write_string_partial): Adapt to buffering changes. * libguile/strports.c: Adapt to the fact that we don't manage the buffer. Probably room for speed improvements here... * libguile/vports.c (soft_port_get_natural_buffer_sizes): New function. Adapt the rest of the file for the new buffering regime. * test-suite/tests/r6rs-ports.test ("8.2.10 Output ports"): Custom binary output ports need to be flushed before you can rely on the write! procedure having been called. Add necessary flush-port invocations. ("8.2.6 Input and output ports"): Transcoded ports now have an internal buffer by default. This test checks that the characters are transcoded one at a time, so to do that, call setvbuf on the transcoded port to remove the buffer. * test-suite/tests/web-client.test (run-with-http-transcript): Fix for different flushing regime on soft ports. (The vestigial flush procedure is now called after each write, which is not what the test was expecting.) * test-suite/standalone/test-scm-c-read.c: Update for changes to the C interface for defining port types. * doc/ref/api-io.texi (Ports): Update to discuss buffering in a generic way, and to remove a hand-wavey paragraph describing string ports as "interesting and powerful". (Reading, Writing): Remove placeholder comments. Document `scm_lfwrite'. (Buffering): New section. (File Ports): Link to buffering. (I/O Extensions): Join subnodes into parent and describe new API, including buffering API. * doc/ref/posix.texi (Ports and File Descriptors): Link to buffering. Remove unread-char etc, as they are documented elsewhere. (Pipes, Network Sockets and Communication): Link to buffering.
2016-04-05Port close functions return voidAndy Wingo1-1/+1
* libguile/ports.h (scm_t_ptob_descriptor): The port close function now returns void. (scm_set_port_close): Adapt prototype. * libguile/ports.c (scm_close_port): Always return true if we managed to call the close function. There's no other sensible result; exceptions are handled, well, exceptionally. * libguile/fports.c (fport_close) * libguile/r6rs-ports.c (custom_binary_port_close, transcoded_port_close): * libguile/vports.c (soft_port_close): Adapt. * doc/ref/api-io.texi (Port Implementation): Update.
2016-04-04Remove port equal functionsAndy Wingo1-6/+0
* doc/ref/api-io.texi (Port Implementation): Remove mention of port equal functions. * NEWS: Update. * libguile/ports.c (scm_set_port_equalp): Remove. * libguile/ports.h (scm_t_ptob_descriptor): Remove equalp function.
2016-04-04Remove port free functions; just close insteadAndy Wingo1-11/+11
* libguile/ports.h (scm_t_port_type_flags): Replace SCM_PORT_TYPE_HAS_FLUSH with SCM_PORT_TYPE_NEEDS_CLOSE_ON_GC. (scm_t_ptob_descriptor): Remove free function. * libguile/ports.c (scm_set_port_needs_close_on_gc): New function. (scm_set_port_flush): Don't set flags. (scm_c_make_port_with_encoding, scm_close_port): Use the new flag to determine when to add a finalizer and also when to include the port in the weak set. (scm_set_port_free): Remove. (do_close, finalize_port): Close port instead of calling free function. * libguile/r6rs-ports.c (initialize_transcoded_ports): * libguile/vports.c (scm_make_sfptob): * libguile/fports.c (scm_make_fptob): Mark these ports as needing close on GC. * libguile/fports.c (fport_free): Remove. * NEWS: Update. * doc/ref/api-io.texi (Port Implementation): Update.
2016-04-04Remove port mark functionsAndy Wingo1-8/+0
* doc/ref/api-io.texi (Port Implementation): Remove documentation. * libguile/ports.c (scm_set_port_mark): Remove function. * libguile/ports.h (scm_t_ptob_descriptor): Remove mark function. * NEWS: Add entry.