From a4d5e7089fe1d919e795a904e22b4e65b41e744c Mon Sep 17 00:00:00 2001 Message-Id: From: zbigniew Date: Sat, 5 Dec 2009 23:56:14 -0600 Subject: Sync wiki SVN 16089-16579 to core manual Status: O One-way synchronize SVN 16089-16579 (HEAD) to the core manual. Any changes in the core manual are not copied back to the wiki. zbigniew (6): Sync changes from wiki manual to core: SVN 16089-16461 Sync changes from wiki manual to core: SVN 16461-16516 Sync changes from wiki manual to core: SVN 16516-16521 Sync changes from wiki manual to core: SVN 16521-16552 Sync changes from wiki manual to core: SVN 16552-16559 (R5RS standard) Sync changes from wiki manual to core: SVN 16559-16579 (SRFI-1 import) manual/Accessing external objects | 20 +- manual/Callbacks | 4 +- manual/Data representation | 51 +- manual/Declarations | 36 +- manual/Embedding | 2 +- manual/Extensions | 46 +- manual/Locations | 8 +- manual/Modules and macros | 20 +- manual/Non-standard macros and special forms | 106 +- manual/Other support procedures | 2 +- manual/Parameters | 2 +- manual/Supported language | 1 + manual/The R5RS standard | 3060 ++++++++++++++++++++++++++ manual/Unit data-structures | 123 +- manual/Unit eval | 26 +- manual/Unit expand | 6 +- manual/Unit extras | 38 +- manual/Unit files | 22 +- manual/Unit library | 48 +- manual/Unit lolevel | 156 +- manual/Unit posix | 275 ++-- manual/Unit regex | 26 +- manual/Unit srfi-1 | 1354 ++++++++++++- manual/Unit srfi-18 | 16 +- manual/Unit srfi-4 | 88 +- manual/Unit srfi-69 | 86 +- manual/Unit tcp | 10 +- manual/Unit utils | 6 +- manual/Using the interpreter | 4 +- 29 files changed, 5018 insertions(+), 624 deletions(-) create mode 100644 manual/The R5RS standard From 637100b05153f643b9497f2017bbf8d8eac573b7 Mon Sep 17 00:00:00 2001 Message-Id: <637100b05153f643b9497f2017bbf8d8eac573b7.1260078974.git.zbigniewsz@gmail.com> In-Reply-To: References: From: zbigniew Date: Sat, 5 Dec 2009 22:38:04 -0600 Subject: Sync changes from wiki manual to core: SVN 16089-16461 Status: O Signed-off-by: zbigniew --- manual/Data representation | 51 +++++++++++++++++++++---------------------- manual/Declarations | 34 ++++++++++++++-------------- manual/Modules and macros | 2 +- manual/Unit library | 4 --- 4 files changed, 43 insertions(+), 48 deletions(-) diff --git a/manual/Data representation b/manual/Data representation index 53049dc..3fff312 100644 --- a/manual/Data representation +++ b/manual/Data representation @@ -1,56 +1,55 @@ [[tags: manual]] -== Data representation -''Note: In all cases below, bits are numbered starting at 1 and beginning with the lowest-order bit.'' +== Data representation There exist two different kinds of data objects in the CHICKEN system: immediate and non-immediate objects. === Immediate objects -Immediate objects are represented by a single machine word, which is usually of 32 bits length, or 64 bits -on 64-bit architectures. The immediate objects -come in four different flavors: +Immediate objects are represented by a single machine word, 32 or 64 bits depending on the architecture. They come in four different flavors: -'''fixnums''', that is, small exact integers, where bit 1 is +'''fixnums''', that is, small exact integers, where the lowest order bit is set to 1. This gives fixnums a range of 31 bits for the actual numeric value (63 bits on 64-bit architectures). -'''characters''', where bits 1-4 are equal to {{C_CHARACTER_BITS}}. The -Unicode code point of the character is encoded in bits 9 to 32. +'''characters''', where the four lowest-order bits are equal to +{{C_CHARACTER_BITS}}, currently 1010. The Unicode code point +of the character is encoded in the next 24 bits. -'''booleans''', where bits 1-4 are equal to {{C_BOOLEAN_BITS}}. Bit 5 -is one for #t and zero for #f. +'''booleans''', where the four lowest-order bits are equal to {{C_BOOLEAN_BITS}}, +currently 0110. The next bit is one for #t and zero for #f. '''other values''': the empty list, the value of unbound identifiers, -the undefined value (void), and end-of-file. Bits 1-4 are equal to {{C_SPECIAL_BITS}}; bits 5 to 8 contain an identifying -number for this type of object. The following constants are -defined: {{C_SCHEME_END_OF_LIST C_SCHEME_UNDEFINED C_SCHEME_UNBOUND -C_SCHEME_END_OF_FILE}} - -Collectively, bits 1 and 2 are known as the ''immediate mark bits''. When bit 1 is set, the object is a fixnum, as described above, and bit 2 is part of its value. When bit 1 is clear but bit 2 is set, it is an immediate object other than a fixnum. If neither bit 1 nor bit 2 is set, the object is non-immediate, as described below. +the undefined value (void), and end-of-file. The four lowest-order bits are equal to +{{C_SPECIAL_BITS}}, currently 1110. The next four bits contain an identifying +number for this type of object, one of: +{{C_SCHEME_END_OF_LIST}}, currently 0000; +{{C_SCHEME_UNDEFINED}}, currently 0001; +{{C_SCHEME_UNBOUND}}, currently 0010; or +{{C_SCHEME_END_OF_FILE}}, currently 0011. === Non-immediate objects +Collectively, the two lowest-order bits are known as the ''immediate mark bits''. When the lowest bit is set, the object is a fixnum, as described above, and the next bit is part of its value. When the lowest bit is clear but the next bit is set, it is an immediate object other than a fixnum. If neither bit is set, the object is non-immediate, as described below. + Non-immediate objects are blocks of data represented by a pointer into -the heap. The pointer's immediate mark bits (bits 1 and 2) must be zero to indicate the object is non-immediate; +the heap. The pointer's immediate mark bits must be zero to indicate the object is non-immediate; this guarantees the data block is aligned on a 4-byte boundary, at minimum. Alignment of data words is required on modern architectures anyway, so we get the ability to distinguish between immediate and non-immediate objects for free. The first word of the data block contains a header, which gives -information about the type of the object. The header has the size of a -machine word, usually 32 bits (64 bits on 64 bit architectures). - -Bits 1 to 24 contain the length of the data object, which is either -the number of bytes in a string (or byte-vector) or the the number -of elements for a vector or for a structure type. +information about the type of the object. The header is a +single machine word. -Bits 25 to 28 contain the type code of the object. +The 24 lowest-order bits contain the length of the data object, which is either +the number of bytes in a string or byte-vector, or the the number +of elements for a vector or record type. -Bits 29 to 32 contain miscellaneous flags used for garbage +The remaining bits are placed in the high-order end of the header. +The four highest-order bits are used for garbage collection or internal data type dispatching. -These flags are: ; C_GC_FORWARDING_BIT : Flag used for forwarding garbage collected object pointers. diff --git a/manual/Declarations b/manual/Declarations index deabbee..572fa49 100644 --- a/manual/Declarations +++ b/manual/Declarations @@ -284,26 +284,26 @@ given here: BASIC --> * | string - | symbol - | char - | number - | boolean - | list - | pair - | procedure - | vector - | null - | eof - | port - | blob - | pointer - | locative - | fixnum - | float + | symbol + | char + | number + | boolean + | list + | pair + | procedure + | vector + | null + | eof + | port + | blob + | pointer + | locative + | fixnum + | float RESULTS --> * | (RVAL1 ...) - + RVAL --> undefined | noreturn diff --git a/manual/Modules and macros b/manual/Modules and macros index bc4be9d..01d995e 100644 --- a/manual/Modules and macros +++ b/manual/Modules and macros @@ -307,7 +307,7 @@ a module): (begin (import m1) - ... ; imports not visible here + ...) ; imports not visible here ... ; imports visible here diff --git a/manual/Unit library b/manual/Unit library index d652b40..73b4c51 100644 --- a/manual/Unit library +++ b/manual/Unit library @@ -519,10 +519,6 @@ argument. If the condition does not have a value for the desired property and if the optional argument is given, no error is signaled and the accessor returns the third argument. -* In composite conditions all properties are currently collected in a single -property-list, so in the case that to conditions have the same named property, -only one will be visible. - === Environment information and system interface -- 1.6.5.2 From 7e8bb73a8fcc3dd228889a31c407ca76c80620f6 Mon Sep 17 00:00:00 2001 Message-Id: <7e8bb73a8fcc3dd228889a31c407ca76c80620f6.1260078974.git.zbigniewsz@gmail.com> In-Reply-To: References: From: zbigniew Date: Sat, 5 Dec 2009 22:44:22 -0600 Subject: Sync changes from wiki manual to core: SVN 16461-16516 Status: O Signed-off-by: zbigniew --- manual/Unit posix | 2 +- manual/Unit srfi-69 | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/manual/Unit posix b/manual/Unit posix index 74f6164..055a4f9 100644 --- a/manual/Unit posix +++ b/manual/Unit posix @@ -889,7 +889,7 @@ nothing happens. ==== memory-mapped-file? - [pocedure] (memory-mapped-file? X) + [procedure] (memory-mapped-file? X) Returns {{#t}}, if {{X}} is an object representing a memory mapped file, or {{#f}} otherwise. diff --git a/manual/Unit srfi-69 b/manual/Unit srfi-69 index c215ee3..d637884 100644 --- a/manual/Unit srfi-69 +++ b/manual/Unit srfi-69 @@ -202,7 +202,7 @@ Returns the new {{VALUE}}. ==== hash-table-copy - [procededure] (hash-table-copy HASH-TABLE) + [procedure] (hash-table-copy HASH-TABLE) Returns a shallow copy of the {{HASH-TABLE}}. -- 1.6.5.2 From 1b0593b802e43cdedd0dc01f321e248d6eb7662e Mon Sep 17 00:00:00 2001 Message-Id: <1b0593b802e43cdedd0dc01f321e248d6eb7662e.1260078974.git.zbigniewsz@gmail.com> In-Reply-To: References: From: zbigniew Date: Sat, 5 Dec 2009 23:17:15 -0600 Subject: Sync changes from wiki manual to core: SVN 16516-16521 Status: O Signed-off-by: zbigniew --- manual/Accessing external objects | 20 +- manual/Callbacks | 4 +- manual/Declarations | 2 +- manual/Embedding | 2 +- manual/Extensions | 42 +++--- manual/Locations | 8 +- manual/Modules and macros | 18 +- manual/Non-standard macros and special forms | 82 +++++----- manual/Other support procedures | 2 +- manual/Parameters | 2 +- manual/Unit data-structures | 123 +++++++------- manual/Unit eval | 26 ++-- manual/Unit expand | 6 +- manual/Unit extras | 38 ++-- manual/Unit library | 44 +++--- manual/Unit lolevel | 156 +++++++++--------- manual/Unit posix | 237 +++++++++++++------------ manual/Unit regex | 26 ++-- manual/Unit srfi-18 | 16 +- manual/Unit srfi-4 | 88 +++++----- manual/Unit srfi-69 | 86 +++++----- manual/Unit tcp | 10 +- manual/Unit utils | 6 +- manual/Using the interpreter | 4 +- 24 files changed, 528 insertions(+), 520 deletions(-) diff --git a/manual/Accessing external objects b/manual/Accessing external objects index 4da3c0c..8d1771b 100644 --- a/manual/Accessing external objects +++ b/manual/Accessing external objects @@ -6,7 +6,7 @@ === foreign-code - [syntax] (foreign-code STRING ...) +(foreign-code STRING ...) Executes the embedded C/C++ code {{STRING ...}}, which should be a sequence of C statements, which are executed and return an unspecified result. @@ -20,7 +20,7 @@ Code wrapped inside {{foreign-code}} may not invoke callbacks into Scheme. === foreign-value - [syntax] (foreign-value CODE TYPE) +(foreign-value CODE TYPE) Evaluates the embedded C/C++ expression {{CODE}} (which may be a string or symbol), returning a value of type given in the foreign-type specifier {{TYPE}}. @@ -32,14 +32,14 @@ in the foreign-type specifier {{TYPE}}. === foreign-declare - [syntax] (foreign-declare STRING ...) +(foreign-declare STRING ...) Include given strings verbatim into header of generated file. === define-foreign-type - [syntax] (define-foreign-type NAME TYPE [ARGCONVERT [RETCONVERT]]) +(define-foreign-type NAME TYPE [ARGCONVERT [RETCONVERT]]) Defines an alias for {{TYPE}} with the name {{NAME}} (a symbol). {{TYPE}} may be a type-specifier or a string naming a C type. The @@ -72,7 +72,7 @@ in multiple files. === define-foreign-variable - [syntax] (define-foreign-variable NAME TYPE [STRING]) +(define-foreign-variable NAME TYPE [STRING]) Defines a foreign variable of name {{NAME}} (a symbol). {{STRING}} should be the real name of a foreign variable or parameterless @@ -88,7 +88,7 @@ even have to specify an lvalue. === foreign-lambda - [syntax] (foreign-lambda RETURNTYPE NAME ARGTYPE ...) +(foreign-lambda RETURNTYPE NAME ARGTYPE ...) Represents a binding to an external routine. This form can be used in the position @@ -98,7 +98,7 @@ name of the external procedure and should be a string or a symbol. === foreign-lambda* - [syntax] (foreign-lambda* RETURNTYPE ((ARGTYPE VARIABLE) ...) STRING ...) +(foreign-lambda* RETURNTYPE ((ARGTYPE VARIABLE) ...) STRING ...) Similar to {{foreign-lambda}}, but instead of generating code to call an external function, the body of the C procedure is directly given @@ -120,7 +120,7 @@ commences in the calling code. === foreign-safe-lambda - [syntax] (foreign-safe-lambda RETURNTYPE NAME ARGTYPE ...) +(foreign-safe-lambda RETURNTYPE NAME ARGTYPE ...) This is similar to {{foreign-lambda}}, but also allows the called function to call Scheme functions and allocate Scheme data-objects. See [[Callbacks]]. @@ -128,7 +128,7 @@ function to call Scheme functions and allocate Scheme data-objects. See [[Callba === foreign-safe-lambda* - [syntax] (foreign-safe-lambda* RETURNTYPE ((ARGTYPE VARIABLE)...) STRING ...) +(foreign-safe-lambda* RETURNTYPE ((ARGTYPE VARIABLE)...) STRING ...) This is similar to {{foreign-lambda*}}, but also allows the called function to call Scheme functions and allocate Scheme data-objects. See [[Callbacks]]. @@ -137,7 +137,7 @@ function to call Scheme functions and allocate Scheme data-objects. See [[Callba === foreign-primitive - [syntax] (foreign-primitive [RETURNTYPE] ((ARGTYPE VARIABLE) ...) STRING ...) +(foreign-primitive [RETURNTYPE] ((ARGTYPE VARIABLE) ...) STRING ...) This is also similar to {{foreign-lambda*}} but the code will be executed in a ''primitive'' CPS context, which means it will not actually return, but diff --git a/manual/Callbacks b/manual/Callbacks index 8490b58..0f45f2f 100644 --- a/manual/Callbacks +++ b/manual/Callbacks @@ -30,8 +30,8 @@ a different callback, your program is likely to crash. === define-external - [syntax] (define-external [QUALIFIERS] (NAME (ARGUMENTTYPE1 VARIABLE1) ...) RETURNTYPE BODY ...) - [syntax] (define-external NAME TYPE [INIT]) +(define-external [QUALIFIERS] (NAME (ARGUMENTTYPE1 VARIABLE1) ...) RETURNTYPE BODY ...)
+(define-external NAME TYPE [INIT]) The first form defines an externally callable Scheme procedure. {{NAME}} should be a symbol, which, when converted to a diff --git a/manual/Declarations b/manual/Declarations index 572fa49..e3f6cee 100644 --- a/manual/Declarations +++ b/manual/Declarations @@ -7,7 +7,7 @@ === declare - [syntax] (declare DECLSPEC ...) +(declare DECLSPEC ...) Process declaration specifiers. Declarations always override any command-line settings. Declarations are valid for the whole diff --git a/manual/Embedding b/manual/Embedding index 45c6c5c..f1133a3 100644 --- a/manual/Embedding +++ b/manual/Embedding @@ -61,7 +61,7 @@ Scheme program. === return-to-host - [procedure] (return-to-host) +(return-to-host) Exits the Scheme code and returns to the invoking context that called {{CHICKEN_run}} or {{CHICKEN_continue}}. diff --git a/manual/Extensions b/manual/Extensions index dbd98ac..f7bfdb9 100644 --- a/manual/Extensions +++ b/manual/Extensions @@ -146,14 +146,14 @@ string. ==== install-program - [procedure] (install-program ID FILELIST [INFOLIST]) +(install-program ID FILELIST [INFOLIST]) Similar to {{install-extension}}, but installs an executable program in the executable path (usually {{/usr/local/bin}}). ==== install-script - [procedure] (install-script ID FILELIST [INFOLIST]) +(install-script ID FILELIST [INFOLIST]) Similar to {{install-program}}, but additionally changes the file permissions of all files in {{FILELIST}} to executable (for installing shell-scripts). @@ -179,7 +179,7 @@ a simple single-file extension. This is roughly equivalent to: ==== run - [syntax] (run FORM ...) +(run FORM ...) Runs the shell command {{FORM}}, which is wrapped in an implicit {{quasiquote}}. {{(run (csc ...))}} is treated specially and passes {{-v}} (if {{-verbose}} has been given @@ -187,13 +187,13 @@ to {{chicken-install}}) and {{-feature compiling-extension}} options to the comp ==== compile - [syntax] (compile FORM ...) +(compile FORM ...) Equivalent to {{(run (csc FORM ...))}}. ==== make - [syntax] (make ((TARGET (DEPENDENT ...) COMMAND ...) ...) ARGUMENTS) +(make ((TARGET (DEPENDENT ...) COMMAND ...) ...) ARGUMENTS) A ''make'' macro that executes the expressions {{COMMAND ...}}, when any of the dependents {{DEPENDENT ...}} have changed, to build {{TARGET}}. This is the same as the {{make}} @@ -203,7 +203,7 @@ extension, which is available separately. For more information, see ==== patch - [procedure] (patch WHICH REGEX SUBST) +(patch WHICH REGEX SUBST) Replaces all occurrences of the regular expression {{REGEX}} with the string {{SUBST}}, in the file given in {{WHICH}}. If {{WHICH}} is a string, the file will be patched and @@ -212,28 +212,28 @@ overwritten. If {{WHICH}} is a list of the form {{OLD NEW}}, then a different fi ==== copy-file - [procedure] (copy-file FROM TO) +(copy-file FROM TO) Copies the file or directory (recursively) given in the string {{FROM}} to the destination file or directory {{TO}}. ==== move-file - [procedure] (move-file FROM TO) +(move-file FROM TO) Moves the file or directory (recursively) given in the string {{FROM}} to the destination file or directory {{TO}}. ==== remove-file* - [procedure] (remove-file* PATH) +(remove-file* PATH) Removes the file or directory given in the string {{PATH}}. ==== find-library - [procedure] (find-library NAME PROC) +(find-library NAME PROC) Returns {{#t}} if the library named {{libNAME.[a|so]}} (unix) or {{NAME.lib}} (windows) could be found by compiling and linking a test program. {{PROC}} should be the name of a @@ -242,13 +242,13 @@ be resolved, {{#f}} is returned. ==== find-header - [procedure] (find-header NAME) +(find-header NAME) Returns {{#t}} if a C include-file with the given name is available, or {{#f}} otherwise. ==== try-compile - [procedure] (try-compile CODE #!key cc cflags ldflags compile-only c++) +(try-compile CODE #!key cc cflags ldflags compile-only c++) Returns {{#t}} if the C code in {{CODE}} compiles and links successfully, or {{#f}} otherwise. The keyword parameters {{cc}} (compiler name, defaults to the C compiler used to build this system), @@ -259,20 +259,20 @@ If the keyword argument {{c++}} is given and true, then the code will be compile ==== create-directory - [procedure] (create-directory PATH) +(create-directory PATH) Creates the directory given in the string {{PATH}}, with all parent directories as needed. ==== chicken-prefix - [parameter] chicken-prefix +chicken-prefix The installation prefix specified when CHICKEN was built. ==== installation-prefix - [parameter] installation-prefix +installation-prefix An alternative installation prefix that will be prepended to extension installation paths if specified. It is set by the {{-install-prefix}} @@ -280,7 +280,7 @@ option or environment variable {{CHICKEN_INSTALL_PREFIX}}. ==== program-path - [parameter] (program-path [PATH]) +(program-path [PATH]) Holds the path where executables are installed and defaults to either {{$CHICKEN_PREFIX/bin}}, if the environment variable {{CHICKEN_PREFIX}} is set or the @@ -289,21 +289,21 @@ path where the CHICKEN binaries ({{chicken}}, {{csi}}, etc.) are installed. ==== setup-root-directory - [parameter] (setup-root-directory [PATH]) +(setup-root-directory [PATH]) Contains the path of the directory where {{chicken-install}} was invoked. ==== setup-install-mode - [parameter] (setup-install-mode [BOOL]) +(setup-install-mode [BOOL]) Reflects the setting of the {{-no-install}} option, i.e. is {{#f}}, if {{-no-install}} was given to {{chicken-install}}. ==== required-chicken-version - [procedure] (required-chicken-version VERSION) +(required-chicken-version VERSION) Signals an error if the version of CHICKEN that this script runs under is lexicographically less than {{VERSION}} (the argument will be converted to a string, first). @@ -311,7 +311,7 @@ Signals an error if the version of CHICKEN that this script runs under is lexico ==== required-extension-version - [procedure] (required-extension-version EXTENSION1 VERSION1 ...) +(required-extension-version EXTENSION1 VERSION1 ...) Checks whether the extensions {{EXTENSION1 ...}} are installed and at least of version {{VERSION1 ...}}. The test is made by lexicographically comparing the string-representations of the given version with the version @@ -321,7 +321,7 @@ or is of a version older than the one specified. ==== host-extension - [parameter] host-extension +host-extension For a cross-compiling CHICKEN, when compiling an extension, then it should be built for the host environment (as opposed to the target diff --git a/manual/Locations b/manual/Locations index c2fd820..c4fd2b4 100644 --- a/manual/Locations +++ b/manual/Locations @@ -14,7 +14,7 @@ machine word, and double-precision floating point values. === define-location - [syntax] (define-location NAME TYPE [INIT]) +(define-location NAME TYPE [INIT]) Identical to {{(define-external NAME TYPE [INIT])}}, but the variable is not accessible from outside of the current compilation unit (it is @@ -22,14 +22,14 @@ declared {{static}}). === let-location - [syntax] (let-location ((NAME TYPE [INIT]) ...) BODY ...) +(let-location ((NAME TYPE [INIT]) ...) BODY ...) Defines a lexically bound location. === location - [syntax] (location NAME) - [syntax] (location X) +(location NAME)
+(location X) This form returns a pointer object that contains the address of the variable {{NAME}}. diff --git a/manual/Modules and macros b/manual/Modules and macros index 01d995e..483b5b0 100644 --- a/manual/Modules and macros +++ b/manual/Modules and macros @@ -13,7 +13,7 @@ macro system based on ''explicit renaming''. ==== define-syntax - [syntax] (define-syntax IDENTIFIER TRANSFORMER) +(define-syntax IDENTIFIER TRANSFORMER) Defines a macro named {{IDENTIFIER}} that will transform an expression with {{IDENTIFIER}} in operator position according to {{TRANSFORMER}}. @@ -50,7 +50,7 @@ transformer procedure is undefined. ==== define-compiled-syntax - [syntax] (define-compiled-syntax IDENTIFIER TRANSFORMER) +(define-compiled-syntax IDENTIFIER TRANSFORMER) Equivalent to {{define-syntax}}, but when compiled, will also define the macro at runtime. @@ -58,7 +58,7 @@ at runtime. ==== syntax - [syntax] (syntax EXPRESSION) +(syntax EXPRESSION) Similar to {{quote}} but retains syntactical context information for embedded identifiers. @@ -66,7 +66,7 @@ embedded identifiers. ==== strip-syntax - [procedure] (strip-syntax EXPRESSION) +(strip-syntax EXPRESSION) Strips all syntactical information from {{EXPRESSION}}, returning a new expression where symbols have all context-information removed. @@ -241,8 +241,8 @@ CHICKEN's module system has the following features and shortcomings: ==== module - [syntax] (module NAME (EXPORT ...) BODY ...) - [syntax] (module NAME * BODY ...) +(module NAME (EXPORT ...) BODY ...)
+(module NAME * BODY ...) Defines a module with the name {{NAME}}, a set of exported bindings and a contained sequence of toplevel expressions that are evaluated in @@ -278,7 +278,7 @@ will modify the original, imported definition. ==== export - [syntax] (export EXPORT ...) +(export EXPORT ...) Allows augmenting module-exports from inside the module-body. {{EXPORT}} is if the same form as an export-specifier in a @@ -287,7 +287,7 @@ Allows augmenting module-exports from inside the module-body. ==== import - [syntax] (import IMPORT ...) +(import IMPORT ...) Imports module bindings into the current syntactical environment. The visibility of any imported bindings is limited to the current @@ -339,7 +339,7 @@ Prefixes all imported identifiers with {{SYMBOL}}. ==== import-for-syntax - [syntax] (import-for-syntax IMPORT ...) +(import-for-syntax IMPORT ...) Similar to {{import}}, but imports exported bindings of a module into the environment in which macro transformers are evaluated. diff --git a/manual/Non-standard macros and special forms b/manual/Non-standard macros and special forms index b30bad0..43f9be8 100644 --- a/manual/Non-standard macros and special forms +++ b/manual/Non-standard macros and special forms @@ -8,7 +8,7 @@ ==== require-library - [syntax] (require-library ID ...) +(require-library ID ...) This form does all the necessary steps to make the libraries or extensions given in {{ID ...}} available. It loads syntactic extensions, if needed and generates @@ -47,7 +47,7 @@ See also: {{set-extension-specifier!}} ==== require-extension - [syntax] (require-extension ID ...) +(require-extension ID ...) This is equivalent to {{(require-library ID ...)}} but performs an implicit {{import}}. @@ -56,7 +56,7 @@ This implementation of {{require-extension}} is compliant with [[http://srfi.sch ==== use - [syntax] (use ID ...) +(use ID ...) {{use}} is just a shorter alias for {{require-extension}}. @@ -65,7 +65,7 @@ This implementation of {{require-extension}} is compliant with [[http://srfi.sch ==== optional - [syntax] (optional ARGS DEFAULT) +(optional ARGS DEFAULT) Use this form for procedures that take a single optional argument. If {{ARGS}} is the empty list {{DEFAULT}} is evaluated and @@ -79,7 +79,7 @@ an error if {{ARGS}} contains more than one value. ==== case-lambda - [syntax] (case-lambda (LAMBDA-LIST1 EXP1 ...) ...) +(case-lambda (LAMBDA-LIST1 EXP1 ...) ...) Expands into a lambda that invokes the body following the first matching lambda-list. @@ -103,7 +103,7 @@ For more information see the documentation for ==== let-optionals - [syntax] (let-optionals ARGS ((VAR1 DEFAULT1) ...) BODY ...) + (let-optionals ARGS ((VAR1 DEFAULT1) ...) BODY ...) Binding constructs for optional procedure arguments. {{ARGS}} should be a rest-parameter taken from a lambda-list. {{let-optionals}} @@ -120,7 +120,7 @@ arguments are provided. ==== let-optionals* - [syntax] (let-optionals* ARGS ((VAR1 DEFAULT1) ... [RESTVAR]) BODY ...) + (let-optionals* ARGS ((VAR1 DEFAULT1) ... [RESTVAR]) BODY ...) Binding constructs for optional procedure arguments. {{ARGS}} should be a rest-parameter taken from a lambda-list. {{let-optionals}} @@ -141,7 +141,7 @@ an error if any excess arguments are provided. ==== and-let* - [syntax] (and-let* (BINDING ...) EXP1 EXP2 ...) +(and-let* (BINDING ...) EXP1 EXP2 ...) SRFI-2. Bind sequentially and execute body. {{BINDING}} can be a list of a variable and an expression, a list with a single @@ -156,8 +156,8 @@ result of the {{and-let*}} form. See also the documentation for ==== rec - [syntax] (rec NAME EXPRESSION) - [syntax] (rec (NAME VARIABLE ...) BODY ...) +(rec NAME EXPRESSION)
+(rec (NAME VARIABLE ...) BODY ...) Allows simple definition of recursive definitions. {{(rec NAME EXPRESSION)}} is equivalent to {{(letrec ((NAME EXPRESSION)) NAME)}} and {{(rec (NAME VARIABLE ...) BODY ...)}} @@ -165,35 +165,35 @@ is the same as {{(letrec ((NAME (lambda (VARIABLE ...) BODY ...))) NAME)}}. ==== cut - [syntax] (cut SLOT ...) - [syntax] (cute SLOT ...) +(cut SLOT ...)
+(cute SLOT ...) [[http://srfi.schemers.org/srfi-26/srfi-26.html|Syntactic sugar for specializing parameters]]. ==== define-values - [syntax] (define-values (NAME ...) EXP) +(define-values (NAME ...) EXP) Defines several variables at once, with the result values of expression {{EXP}}. ==== fluid-let - [syntax] (fluid-let ((VAR1 X1) ...) BODY ...) +(fluid-let ((VAR1 X1) ...) BODY ...) Binds the variables {{VAR1 ...}} dynamically to the values {{X1 ...}} during execution of {{BODY ...}}. ==== let-values - [syntax] (let-values (((NAME ...) EXP) ...) BODY ...) +(let-values (((NAME ...) EXP) ...) BODY ...) SRFI 11. Binds multiple variables to the result values of {{EXP ...}}. All variables are bound simultaneously. ==== let*-values - [syntax] (let*-values (((NAME ...) EXP) ...) BODY ...) +(let*-values (((NAME ...) EXP) ...) BODY ...) SRFI 11. Binds multiple variables to the result values of {{EXP ...}}. The variables are bound sequentially. @@ -206,7 +206,7 @@ The variables are bound sequentially. ==== letrec-values - [syntax] (letrec-values (((NAME ...) EXP) ...) BODY ...) +(letrec-values (((NAME ...) EXP) ...) BODY ...) Binds the result values of {{EXP ...}} to multiple variables at once. All variables are mutually recursive. @@ -221,7 +221,7 @@ All variables are mutually recursive. ==== parameterize - [syntax] (parameterize ((PARAMETER1 X1) ...) BODY ...) +(parameterize ((PARAMETER1 X1) ...) BODY ...) Binds the parameters {{PARAMETER1 ...}} dynamically to the values {{X1 ...}} during execution of {{BODY ...}}. (see also: @@ -230,8 +230,8 @@ expression that evaluates to a parameter procedure. ==== receive - [syntax] (receive (NAME1 ... [. NAMEn]) VALUEEXP BODY ...) - [syntax] (receive VALUEEXP) +(receive (NAME1 ... [. NAMEn]) VALUEEXP BODY ...)
+(receive VALUEEXP) SRFI-8. Syntactic sugar for {{call-with-values}}. Binds variables to the result values of {{VALUEEXP}} and evaluates {{BODY ...}}. @@ -250,7 +250,7 @@ is equivalent to ==== set!-values - [syntax] (set!-values (NAME ...) EXP) +(set!-values (NAME ...) EXP) Assigns the result values of expression {{EXP}} to multiple variables. @@ -260,7 +260,7 @@ variables. ==== define-constant - [syntax] (define-constant NAME CONST) +(define-constant NAME CONST) Define a variable with a constant value, evaluated at compile-time. Any reference to such a @@ -277,8 +277,8 @@ This for should only be used at top-level. ==== define-inline - [syntax] (define-inline (NAME VAR ... [. VAR]) BODY ...) - [syntax] (define-inline NAME EXP) +(define-inline (NAME VAR ... [. VAR]) BODY ...)
+(define-inline NAME EXP) Defines an inline procedure. Any occurrence of {{NAME}} will be replaced by {{EXP}} or {{(lambda (VAR ... [. VAR]) BODY ...)}}. @@ -295,8 +295,8 @@ definitions should only appear at toplevel. ==== define-for-syntax - [syntax] (define-for-syntax (NAME VAR ... [. VAR]) EXP1 ...) - [syntax] (define-for-syntax NAME [VALUE]) +(define-for-syntax (NAME VAR ... [. VAR]) EXP1 ...)
+(define-for-syntax NAME [VALUE]) Defines the toplevel variable {{NAME}} at macro-expansion time. This can be helpful when you want to define support procedures for use in macro-transformers, @@ -341,13 +341,13 @@ Allows definition local compiler macros, which are only applicable inside {{BODY ==== select - [syntax] (select EXP ((KEY ...) EXP1 ...) ... [(else EXPn ...)]) +(select EXP ((KEY ...) EXP1 ...) ... [(else EXPn ...)]) This is similar to {{case}}, but the keys are evaluated. ==== unless - [syntax] (unless TEST EXP1 EXP2 ...) +(unless TEST EXP1 EXP2 ...) Equivalent to: @@ -357,7 +357,7 @@ Equivalent to: ==== when - [syntax] (when TEST EXP1 EXP2 ...) +(when TEST EXP1 EXP2 ...) Equivalent to: @@ -370,7 +370,7 @@ Equivalent to: ==== define-record - [syntax] (define-record NAME SLOTNAME ...) +(define-record NAME SLOTNAME ...) Defines a record type. Call {{make-NAME}} to create an instance of the structure (with one initialization-argument for each slot). @@ -389,7 +389,7 @@ and updated using {{(NAME-SLOTNAME-set!}} {{STRUCT}} {{VALUE)}}. ==== define-record-type - [syntax] (define-record-type NAME +(define-record-type NAME
(CONSTRUCTOR TAG ...) PREDICATE (FIELD ACCESSOR [MODIFIER]) ...) @@ -400,8 +400,8 @@ SRFI-9 record types. For more information see the documentation for ==== define-record-printer - [syntax] (define-record-printer (NAME RECORDVAR PORTVAR) BODY ...) - [syntax] (define-record-printer NAME PROCEDURE) +(define-record-printer (NAME RECORDVAR PORTVAR) BODY ...)
+(define-record-printer NAME PROCEDURE) Defines a printing method for record of the type {{NAME}} by associating a procedure with the record type. When a record of this @@ -430,7 +430,7 @@ s ==> "#,(foo 1 2 3)" ==== assert - [syntax] (assert EXP [STRING ARG ...]) +(assert EXP [STRING ARG ...]) Signals an error if {{EXP}} evaluates to false. An optional message {{STRING}} and arguments {{ARG ...}} may be supplied to give a @@ -442,7 +442,7 @@ The result is the value of {{EXP}}. ==== begin-for-syntax - [syntax] (begin-for-syntax EXP ...) +(begin-for-syntax EXP ...) Equivalent to {{(begin EXP ...)}}, but performs the evaluation of the expression during macro-expansion time. @@ -450,7 +450,7 @@ the expression during macro-expansion time. ==== cond-expand - [syntax] (cond-expand FEATURE-CLAUSE ...) +(cond-expand FEATURE-CLAUSE ...) Expands by selecting feature clauses. This form is allowed to appear in non-toplevel expressions. @@ -470,7 +470,7 @@ For further information, see the documentation for [[http://srfi.schemers.org/sr ==== ensure - [syntax] (ensure PREDICATE EXP [ARGUMENTS ...]) +(ensure PREDICATE EXP [ARGUMENTS ...]) Evaluates the expression {{EXP}} and applies the one-argument procedure {{PREDICATE}} to the result. If the predicate returns @@ -485,7 +485,7 @@ with the offending value and {{PREDICATE}} expression. ==== eval-when - [syntax] (eval-when (SITUATION ...) EXP ...) +(eval-when (SITUATION ...) EXP ...) Controls evaluation/compilation of subforms. {{SITUATION}} should be one of the symbols {{eval}}, {{compile}} or {{load}}. @@ -508,7 +508,7 @@ The following table should make this clearer: ==== include - [syntax] (include STRING) +(include STRING) Include toplevel-expressions from the given source file in the currently compiled/interpreted program. If the included file has the extension @@ -518,14 +518,14 @@ current directory and, if not found, in all directories specified in the ==== nth-value - [syntax] (nth-value N EXP) +(nth-value N EXP) Returns the {{N}}th value (counting from zero) of the values returned by expression {{EXP}}. ==== time - [syntax] (time EXP1 ...) +(time EXP1 ...) Evaluates {{EXP1 ...}} and prints elapsed time and some values about GC use, like time spent in major GCs, number of minor diff --git a/manual/Other support procedures b/manual/Other support procedures index 23d915b..2866a38 100644 --- a/manual/Other support procedures +++ b/manual/Other support procedures @@ -5,7 +5,7 @@ === argc+argv - [procedure] (argc+argv) +(argc+argv) Returns two values: an integer and a foreign-pointer object representing the {{argc}} and {{argv}} arguments passed to the current process. diff --git a/manual/Parameters b/manual/Parameters index b1c7d7c..aa8ddc5 100644 --- a/manual/Parameters +++ b/manual/Parameters @@ -25,7 +25,7 @@ CHICKEN implements [[http://srfi.schemers.org/srfi-39/srfi-39.html|SRFI-39]]. === make-parameter - [procedure] (make-parameter VALUE [GUARD]) +(make-parameter VALUE [GUARD]) Returns a procedure that accepts zero or one argument. Invoking the procedure with zero arguments returns {{VALUE}}. Invoking the diff --git a/manual/Unit data-structures b/manual/Unit data-structures index dd50f23..34df6e4 100644 --- a/manual/Unit data-structures +++ b/manual/Unit data-structures @@ -12,7 +12,7 @@ structures. ==== alist-ref - [procedure] (alist-ref KEY ALIST [TEST [DEFAULT]]) +(alist-ref KEY ALIST [TEST [DEFAULT]]) Looks up {{KEY}} in {{ALIST}} using {{TEST}} as the comparison function (or {{eqv?}} if no test was given) and returns the cdr of the found pair, or {{DEFAULT}} (which defaults to {{#f}}). @@ -20,7 +20,7 @@ no test was given) and returns the cdr of the found pair, or {{DEFAULT}} (which ==== alist-update! - [procedure] (alist-update! KEY VALUE ALIST [TEST]) +(alist-update! KEY VALUE ALIST [TEST]) If the list {{ALIST}} contains a pair of the form {{(KEY . X)}}, then this procedure replaces {{X}} with {{VALUE}} and returns {{ALIST}}. If {{ALIST}} contains no such item, then @@ -31,7 +31,7 @@ and defaults to {{eqv?}}. ==== atom? - [procedure] (atom? X) +(atom? X) Returns {{#t}} if {{X}} is not a pair. This is identical to {{not-pair?}} from [[Unit srfi-1]] but kept for historical reasons. @@ -39,7 +39,7 @@ kept for historical reasons. ==== rassoc - [procedure] (rassoc KEY LIST [TEST]) +(rassoc KEY LIST [TEST]) Similar to {{assoc}}, but compares {{KEY}} with the {{cdr}} of each pair in {{LIST}} using {{TEST}} as the comparison procedures (which defaults to {{eqv?}}. @@ -47,14 +47,14 @@ Similar to {{assoc}}, but compares {{KEY}} with the {{cdr}} of each pair in {{LI ==== butlast - [procedure] (butlast LIST) +(butlast LIST) Returns a fresh list with all elements but the last of {{LIST}}. ==== chop - [procedure] (chop LIST N) +(chop LIST N) Returns a new list of sublists, where each sublist contains {{N}} elements of {{LIST}}. If {{LIST}} has a length that is not @@ -69,7 +69,7 @@ elements. ==== compress - [procedure] (compress BLIST LIST) +(compress BLIST LIST) Returns a new list with elements taken from {{LIST}} with corresponding true values in the list {{BLIST}}. @@ -82,7 +82,7 @@ corresponding true values in the list {{BLIST}}. ==== flatten - [procedure] (flatten LIST1 ...) +(flatten LIST1 ...) Returns {{LIST1 ...}} concatenated together, with nested lists removed (flattened). @@ -90,14 +90,14 @@ removed (flattened). ==== intersperse - [procedure] (intersperse LIST X) +(intersperse LIST X) Returns a new list with {{X}} placed between each element. ==== join - [procedure] (join LISTOFLISTS [LIST]) +(join LISTOFLISTS [LIST]) Concatenates the lists in {{LISTOFLISTS}} with {{LIST}} placed between each sublist. {{LIST}} defaults to the empty list. @@ -117,7 +117,7 @@ between each sublist. {{LIST}} defaults to the empty list. ==== shuffle - [procedure] (shuffle LIST RANDOM) +(shuffle LIST RANDOM) Returns {{LIST}} with its elements sorted in a random order given by procedure {{RANDOM}}. @@ -125,7 +125,7 @@ procedure {{RANDOM}}. ==== tail? - [procedure] (tail? X LIST) +(tail? X LIST) Returns true if {{X}} is one of the tails (cdr's) of {{LIST}}. @@ -134,7 +134,7 @@ Returns true if {{X}} is one of the tails (cdr's) of {{LIST}}. ==== list->queue - [procedure] (list->queue LIST) +(list->queue LIST) Returns {{LIST}} converted into a queue, where the first element of the list is the same as the first element of the queue. The resulting @@ -144,21 +144,21 @@ after this operation. ==== make-queue - [procedure] (make-queue) +(make-queue) Returns a newly created queue. ==== queue? - [procedure] (queue? X) +(queue? X) Returns {{#t}} if {{X}} is a queue, or {{#f}} otherwise. ==== queue->list - [procedure] (queue->list QUEUE) +(queue->list QUEUE) Returns {{QUEUE}} converted into a list, where the first element of the list is the same as the first element of the queue. The resulting @@ -167,21 +167,21 @@ list may share memory with the queue object and should not be modified. ==== queue-add! - [procedure] (queue-add! QUEUE X) +(queue-add! QUEUE X) Adds {{X}} to the rear of {{QUEUE}}. ==== queue-empty? - [procedure] (queue-empty? QUEUE) +(queue-empty? QUEUE) Returns {{#t}} if {{QUEUE}} is empty, or {{#f}} otherwise. ==== queue-first - [procedure] (queue-first QUEUE) +(queue-first QUEUE) Returns the first element of {{QUEUE}}. If {{QUEUE}} is empty an error is signaled @@ -189,7 +189,7 @@ an error is signaled ==== queue-last - [procedure] (queue-last QUEUE) +(queue-last QUEUE) Returns the last element of {{QUEUE}}. If {{QUEUE}} is empty an error is signaled @@ -197,7 +197,7 @@ an error is signaled ==== queue-remove! - [procedure] (queue-remove! QUEUE) +(queue-remove! QUEUE) Removes and returns the first element of {{QUEUE}}. If {{QUEUE}} is empty an error is signaled @@ -205,7 +205,7 @@ is empty an error is signaled ==== queue-push-back! - [procedure] (queue-push-back! QUEUE ITEM) +(queue-push-back! QUEUE ITEM) Pushes an item into the first position of a queue, i.e. the next {{queue-remove!}} will return {{ITEM}}. @@ -213,7 +213,7 @@ Pushes an item into the first position of a queue, i.e. the next ==== queue-push-back-list! - [procedure] (queue-push-back-list! QUEUE LIST) +(queue-push-back-list! QUEUE LIST) Pushes the items in item-list back onto the queue, so that {{(car LIST)}} becomes the next removable item. @@ -225,8 +225,8 @@ so that {{(car LIST)}} becomes the next removable item. ==== merge - [procedure] (merge LIST1 LIST2 LESS?) - [procedure] (merge! LIST1 LIST2 LESS?) +(merge LIST1 LIST2 LESS?)
+(merge! LIST1 LIST2 LESS?) Joins two lists in sorted order. {{merge!}} is the destructive version of merge. {{LESS? }} should be a procedure of two arguments, @@ -236,8 +236,8 @@ second argument. ==== sort - [procedure] (sort SEQUENCE LESS?) - [procedure] (sort! SEQUENCE LESS?) +(sort SEQUENCE LESS?)
+(sort! SEQUENCE LESS?) Sort {{SEQUENCE}}, which should be a list or a vector. {{sort!}} is the destructive version of sort. @@ -249,7 +249,6 @@ is the destructive version of sort. Returns true if the list or vector {{SEQUENCE}} is already sorted. - ==== topological-sort [procedure] (topological-sort DAG PRED) @@ -288,7 +287,7 @@ Time complexity: O (|V| + |E|) ==== conc - [procedure] (conc X ...) +(conc X ...) Returns a string with the string-represenation of all arguments concatenated together. {{conc}} could be implemented as @@ -302,14 +301,14 @@ together. {{conc}} could be implemented as ==== ->string - [procedure] (->string X) +(->string X) Returns a string-representation of {{X}}. ==== string-chop - [procedure] (string-chop STRING LENGTH) +(string-chop STRING LENGTH) Returns a list of substrings taken by ''chopping'' {{STRING}} every {{LENGTH}} characters: @@ -322,7 +321,7 @@ characters: ==== string-chomp - [procedure] (string-chomp STRING [SUFFIX]) +(string-chomp STRING [SUFFIX]) If {{STRING}} ends with {{SUFFIX}}, then this procedure returns a copy of its first argument with the suffix removed, otherwise returns {{STRING}} unchanged. {{SUFFIX}} defaults to {{"\n"}}. @@ -330,8 +329,8 @@ removed, otherwise returns {{STRING}} unchanged. {{SUFFIX}} defaults to {{"\n"}} ==== string-compare3 - [procedure] (string-compare3 STRING1 STRING2) - [procedure] (string-compare3-ci STRING1 STRING2) +(string-compare3 STRING1 STRING2)
+(string-compare3-ci STRING1 STRING2) Perform a three-way comparison between the {{STRING1}} and {{STRING2}}, returning either {{-1}} if {{STRING1}} is lexicographically less @@ -341,7 +340,7 @@ than {{STRING2}}, {{0}} if it is equal, or {{1}} if it s greater. ==== string-intersperse - [procedure] (string-intersperse LIST [STRING]) +(string-intersperse LIST [STRING]) Returns a string that contains all strings in {{LIST}} concatenated together. {{STRING}} is placed between each concatenated string and @@ -360,7 +359,7 @@ is equivalent to ==== string-split - [procedure] (string-split STRING [DELIMITER-STRING [KEEPEMPTY]]) +(string-split STRING [DELIMITER-STRING [KEEPEMPTY]]) Split string into substrings separated by the given delimiters. If no delimiters are specified, a string comprising the tab, newline and space characters @@ -376,7 +375,7 @@ substrings are retained: ==== string-translate - [procedure] (string-translate STRING FROM [TO]) +(string-translate STRING FROM [TO]) Returns a fresh copy of {{STRING}} with characters matching {{FROM}} translated to {{TO}}. If {{TO}} is omitted, then @@ -388,7 +387,7 @@ as the matching character in {{FROM}} is substituted. ==== string-translate* - [procedure] (string-translate* STRING SMAP) +(string-translate* STRING SMAP) Substitutes elements of {{STRING}} according to {{SMAP}}. {{SMAP}} should be an association-list where each element of the list @@ -406,8 +405,8 @@ the string {{MATCH}} in {{STRING}} will be replaced by the string ==== substring=? - [procedure] (substring=? STRING1 STRING2 [START1 [START2 [LENGTH]]]) - [procedure] (substring-ci=? STRING1 STRING2 [START1 [START2 [LENGTH]]]) +(substring=? STRING1 STRING2 [START1 [START2 [LENGTH]]])
+(substring-ci=? STRING1 STRING2 [START1 [START2 [LENGTH]]]) Returns {{#t}} if the strings {{STRING1}} and {{STRING2}} are equal, or {{#f}} otherwise. @@ -418,8 +417,8 @@ length of both strings). ==== substring-index - [procedure] (substring-index WHICH WHERE [START]) - [procedure] (substring-index-ci WHICH WHERE [START]) +(substring-index WHICH WHERE [START])
+(substring-index-ci WHICH WHERE [START]) Searches for first index in string {{WHERE}} where string {{WHICH}} occurs. If the optional argument {{START}} is given, @@ -429,7 +428,7 @@ is a case-insensitive version of {{substring-index}}. ==== reverse-string-append - [procedure] (reverse-string-append LIST) +(reverse-string-append LIST) {{(apply string-append (reverse LIST))}} @@ -439,35 +438,35 @@ is a case-insensitive version of {{substring-index}}. ==== any? - [procedure] (any? X) +(any? X) Ignores its argument and always returns {{#t}}. This is actually useful sometimes. ==== none? - [procedure] (none? X) +(none? X) Ignores its argument and always returns {{#f}}. This is actually useful sometimes. ==== always? - [procedure] (always? X) +(always? X) Ignores its arguments and always returns {{#t}}. This is actually useful sometimes. ==== never? - [procedure] (never? X) +(never? X) Ignores its arguments and always returns {{#f}}. This is actually useful sometimes. ==== constantly - [procedure] (constantly X ...) +(constantly X ...) Returns a procedure that always returns the values {{X ...}} regardless of the number and value of its arguments. @@ -478,7 +477,7 @@ Returns a procedure that always returns the values {{X ...}} regardless of the n ==== complement - [procedure] (complement PROC) +(complement PROC) Returns a procedure that returns the boolean inverse of {{PROC}}. @@ -489,7 +488,7 @@ Returns a procedure that returns the boolean inverse of {{PROC}}. ==== compose - [procedure] (compose PROC1 PROC2 ...) +(compose PROC1 PROC2 ...) Returns a procedure that represents the composition of the argument-procedures {{PROC1 PROC2 ...}}. @@ -506,7 +505,7 @@ argument-procedures {{PROC1 PROC2 ...}}. ==== conjoin - [procedure] (conjoin PRED ...) +(conjoin PRED ...) Returns a procedure that returns {{#t}} if its argument satisfies the predicates {{PRED ...}}. @@ -518,7 +517,7 @@ predicates {{PRED ...}}. ==== disjoin - [procedure] (disjoin PRED ...) +(disjoin PRED ...) Returns a procedure that returns {{#t}} if its argument satisfies any predicate {{PRED ...}}. @@ -530,7 +529,7 @@ predicate {{PRED ...}}. ==== each - [procedure] (each PROC ...) +(each PROC ...) Returns a procedure that applies {{PROC ...}} to its arguments, and returns the result(s) of the last procedure application. For example @@ -553,7 +552,7 @@ is equivalent to ==== flip - [procedure] (flip PROC) +(flip PROC) Returns a two-argument procedure that calls {{PROC}} with its arguments swapped: @@ -564,21 +563,21 @@ arguments swapped: ==== identity - [procedure] (identity X) +(identity X) Returns its sole argument {{X}}. ==== project - [procedure] (project N) +(project N) Returns a procedure that returns its {{N}}th argument (starting from 0). ==== list-of? - [procedure] (list-of? PRED) +(list-of? PRED) Returns a procedure of one argument that returns {{#t}} when applied to a list of elements that all satisfy the predicate procedure @@ -592,14 +591,14 @@ applied to a list of elements that all satisfy the predicate procedure ==== noop - [procedure] (noop X ...) +(noop X ...) Ignores its arguments, does nothing and returns an unspecified value. ==== o - [procedure] (o PROC ...) +(o PROC ...) A single value version of {{compose}} (slightly faster). {{(o)}} is equivalent to {{identity}}. @@ -607,7 +606,7 @@ to {{identity}}. ==== left-section - [procedure] (left-section PROC ARG0 ...) +(left-section PROC ARG0 ...) Returns a procedure that partially applies some of its arguments starting from the left. @@ -618,7 +617,7 @@ Returns a procedure that partially applies some of its arguments starting from t ==== right-section - [procedure] (right-section PROC ARG0 ...) +(right-section PROC ARG0 ...) Returns a procedure that partially applies some of its arguments starting from the right. @@ -633,7 +632,7 @@ Returns a procedure that partially applies some of its arguments starting from t ==== binary-search - [procedure] (binary-search SEQUENCE PROC) +(binary-search SEQUENCE PROC) Performs a binary search in {{SEQUENCE}}, which should be a sorted list or vector. {{PROC}} is called to compare items in the sequence, diff --git a/manual/Unit eval b/manual/Unit eval index aa10955..f92997c 100644 --- a/manual/Unit eval +++ b/manual/Unit eval @@ -11,7 +11,7 @@ option. ==== load - [procedure] (load FILE [EVALPROC]) +(load FILE [EVALPROC]) Loads and evaluates expressions from the given source file, which may be either a string or an input port. Each expression read is passed to @@ -42,14 +42,14 @@ Support for reloading compiled code dynamically is still experimental. ==== load-relative - [procedure] (load-relative FILE [EVALPROC]) +(load-relative FILE [EVALPROC]) Similar to {{load}}, but loads {{FILE}} relative to the path of the currently loaded file. ==== load-noisily - [procedure] (load-noisily FILE #!key EVALUATOR TIME PRINTER) +(load-noisily FILE #!key EVALUATOR TIME PRINTER) As {{load}} but the result(s) of each evaluated toplevel-expression is written to standard output. If {{EVALUATOR}} is given and not {{#f}}, @@ -63,7 +63,7 @@ argument, which should be a one-argument procedure. See also the [[http://chicken.wiki.br/Parameters#load-verbose|load-verbose]] parameter. ==== load-library - [procedure] (load-library UNIT [LIBRARYFILE]) +(load-library UNIT [LIBRARYFILE]) On platforms that support dynamic loading, {{load-library}} loads the compiled library unit {{UNIT}} (which should be a symbol). If the @@ -82,7 +82,7 @@ the {{load-library}} does nothing. ==== set-dynamic-load-mode! - [procedure] (set-dynamic-load-mode! MODELIST) +(set-dynamic-load-mode! MODELIST) On systems that support dynamic loading of compiled code via the {{dlopen(3)}} interface (for example Linux and Solaris), some options can be specified to @@ -102,7 +102,7 @@ this facility is mainly of interest when accessing foreign code. ==== repl - [procedure] (repl) +(repl) Start a new read-eval-print loop. Sets the {{reset-handler}} so that any invocation of {{reset}} restarts the read-eval-print loop. Also @@ -125,7 +125,7 @@ or the default library path ==== extension-information - [procedure] (extension-information ID) +(extension-information ID) If an extension with the name {{ID}} is installed and if it has a setup-information list registered in the extension repository, then the info-list is returned. Otherwise @@ -133,21 +133,21 @@ list registered in the extension repository, then the info-list is returned. Oth ==== provide - [procedure] (provide ID ...) +(provide ID ...) Registers the extension IDs {{ID ...}} as loaded. This is mainly intended to provide aliases for certain extension identifiers. ==== provided? - [procedure] (provided? ID ...) +(provided? ID ...) Returns {{#t}} if the extension with the IDs {{ID ...}} are currently loaded, or {{#f}} otherwise. ==== require - [procedure] (require ID ...) +(require ID ...) If the extension library {{ID}} is not already loaded into the system, then {{require}} will lookup the location of the shared @@ -164,7 +164,7 @@ from one of the following locations: ==== set-extension-specifier! - [procedure] (set-extension-specifier! SYMBOL PROC) +(set-extension-specifier! SYMBOL PROC) Registers the handler-procedure {{PROC}} as a extension-specifier with the name {{SYMBOL}}. This facility allows extending the set of valid extension @@ -195,7 +195,7 @@ visible in compiled code. ==== chicken-home - [procedure] (chicken-home) +(chicken-home) Returns a string given the installation directory (usually {{/usr/local/share/chicken}} on UNIX-like systems). As a last option, @@ -207,7 +207,7 @@ if the environment variable {{CHICKEN_PREFIX}} is set, then {{chicken-home}} wil ==== eval - [procedure] (eval EXP [ENVIRONMENT]) +(eval EXP [ENVIRONMENT]) Evaluates {{EXP}} and returns the result of the evaluation. The second argument is optional and defaults to the value of {{(interaction-environment)}}. diff --git a/manual/Unit expand b/manual/Unit expand index 47f0ad8..f024fc9 100644 --- a/manual/Unit expand +++ b/manual/Unit expand @@ -11,7 +11,7 @@ option. ==== get-line-number - [procedure] (get-line-number EXPR) +(get-line-number EXPR) If {{EXPR}} is a pair with the car being a symbol, and line-number information is available for this expression, then this procedure returns @@ -21,14 +21,14 @@ expressions is only available in the compiler. ==== expand - [procedure] (expand X) +(expand X) If {{X}} is a macro-form, expand the macro (and repeat expansion until expression is a non-macro form). Returns the resulting expression. ==== syntax-error - [procedure] (syntax-error [LOCATION] MESSAGE ARGUMENT ...) +(syntax-error [LOCATION] MESSAGE ARGUMENT ...) Signals an exception of the kind {{(exn syntax)}}. Otherwise identical to {{error}}. diff --git a/manual/Unit extras b/manual/Unit extras index 7ca6349..4eb46d4 100644 --- a/manual/Unit extras +++ b/manual/Unit extras @@ -14,7 +14,7 @@ option. ==== random-seed - [procedure] (random-seed [SEED]) +(random-seed [SEED]) Seeds the random number generator with {{SEED}} (an {{integer}}) or {{(current-seconds)}} if {{SEED}} is not given. @@ -22,7 +22,7 @@ Seeds the random number generator with {{SEED}} (an {{integer}}) or ==== randomize - [procedure] (randomize [SEED]) +(randomize [SEED]) Set random-number seed. If {{SEED}} (an {{exact integer}}) is not supplied, the current time is used. On startup (when Unit {{extras}} is initialized), the @@ -31,7 +31,7 @@ random number generator is initialized with the current time. ==== random - [procedure] (random N) +(random N) Returns a random {{integer}} in {{[0 N-1]}}. {{N}} is an {{integer}}. @@ -46,9 +46,9 @@ On '''Windows''' {{N}} and the random value are {{exact integer}}. ==== fprintf ==== sprintf - [procedure] (fprintf PORT FORMATSTRING [ARG...]) - [procedure] (printf FORMATSTRING [ARG...]) - [procedure] (sprintf FORMATSTRING [ARG...]) +(fprintf PORT FORMATSTRING [ARG...])
+(printf FORMATSTRING [ARG...])
+(sprintf FORMATSTRING [ARG...]) Simple formatted output to a given port ({{fprintf}}), the value of {{(current-output-port)}} ({{printf}}), or a string @@ -85,7 +85,7 @@ invoke formatted output routine recursively with the next two arguments as forma ==== format - [procedure] (format [DESTINATION] FORMATSTRING [ARG...]) +(format [DESTINATION] FORMATSTRING [ARG...]) The parameters {{FORMATSTRING}} and {{ARG...}} are as for {{printf}}. @@ -102,8 +102,8 @@ The optional {{DESTINATION}}, when supplied, performs: ==== pretty-print - [procedure] (pretty-print EXP [PORT]) - [procedure] (pp EXP [PORT]) +(pretty-print EXP [PORT])
+(pp EXP [PORT]) Print expression nicely formatted. {{PORT}} defaults to the value of {{(current-output-port)}}. @@ -119,15 +119,15 @@ wrap will occur. ==== read-byte ==== write-byte - [procedure] (read-byte [PORT]) - [procedure] (write-byte BYTE [PORT]) +(read-byte [PORT])
+(write-byte BYTE [PORT]) Read/write a byte to the port given in {{PORT}}, which default to the values of {{(current-input-port)}} and {{(current-output-port)}}, respectively. ==== read-file - [procedure] (read-file [FILE-OR-PORT [READER [MAXCOUNT]]]) +(read-file [FILE-OR-PORT [READER [MAXCOUNT]]]) Returns a list containing all toplevel expressions read from the file or port {{FILE-OR-PORT}}. If no argument is given, @@ -142,8 +142,8 @@ If {{MAXCOUNT}} is given then only up to {{MAXCOUNT}} expressions will be read i ==== read-line ==== write-line - [procedure] (read-line [PORT [LIMIT]]) - [procedure] (write-line STRING [PORT]) +(read-line [PORT [LIMIT]])
+(write-line STRING [PORT]) Line-input and -output. {{PORT}} defaults to the value of {{(current-input-port)}} and {{(current-output-port)}}, @@ -154,7 +154,7 @@ characters per line. {{read-line}} returns a string without the terminating newl ==== read-lines - [procedure] (read-lines [PORT [MAX]]) +(read-lines [PORT [MAX]]) Read {{MAX}} or fewer lines from {{PORT}}. {{PORT}} defaults to the value of {{(current-input-port)}}. {{PORT}} may optionally be @@ -165,9 +165,9 @@ a string naming a file. Returns a list of strings, each string representing a li ==== read-string! ==== write-string - [procedure] (read-string [NUM [PORT]]) - [procedure] (read-string! NUM STRING [PORT [START]]) - [procedure] (write-string STRING [NUM [PORT]] +(read-string [NUM [PORT]])
+(read-string! NUM STRING [PORT [START]])
+(write-string STRING [NUM [PORT]]) Read or write {{NUM}} characters from/to {{PORT}}, which defaults to the value of {{(current-input-port)}} or {{(current-output-port)}}, respectively. @@ -182,7 +182,7 @@ the read characters are stored starting at that position. ==== read-token - [procedure] (read-token PREDICATE [PORT]) +(read-token PREDICATE [PORT]) Reads characters from {{PORT}} (which defaults to the value of {{(current-input-port)}}) and calls the procedure {{PREDICATE}} with each character until {{PREDICATE}} returns diff --git a/manual/Unit library b/manual/Unit library index 73b4c51..27ca46d 100644 --- a/manual/Unit library +++ b/manual/Unit library @@ -19,18 +19,18 @@ Adds/subtracts 1 from {{N}}. ==== Binary integer operations -Binary integer operations. {{arithmetic-shift}} shifts the argument {{N1}} by -{{N2}} bits to the left. If {{N2}} is negative, than {{N1}} is shifted to the -right. These operations only accept exact integers or inexact integers in word -range (32 bit signed on 32-bit platforms, or 64 bit signed on 64-bit -platforms). - (bitwise-and N1 ...) (bitwise-ior N1 ...) (bitwise-xor N1 ...) (bitwise-not N) (arithmetic-shift N1 N2) +Binary integer operations. {{arithmetic-shift}} shifts the argument {{N1}} by +{{N2}} bits to the left. If {{N2}} is negative, then {{N1}} is shifted to the +right. These operations only accept exact integers or inexact integers in word +range (32 bit signed on 32-bit platforms, or 64 bit signed on 64-bit +platforms). + ==== bit-set? (bit-set? N INDEX) @@ -38,18 +38,8 @@ platforms). Returns {{#t}} if the bit at the position {{INDEX}} in the integer {{N}} is set, or {{#f}} otherwise. The rightmost/least-significant bit is bit 0. - ==== Arithmetic fixnum operations -These procedures do not check their arguments, so non-fixnum parameters will -result in incorrect results. {{fxneg}} negates its argument. - -On division by zero, {{fx/}} and {{fxmod}} signal a condition of kind -{{(exn arithmetic)}}. - -{{fxshl}} and {{fxshr}} perform arithmetic shift left and right, -respectively. - (fx+ N1 N2) (fx- N1 N2) (fx* N1 N2) @@ -70,9 +60,19 @@ respectively. (fxshl N1 N2) (fxshr N1 N2) +{{fx+}} and friends are arithmetic fixnum operations. These procedures do not +check their arguments, so non-fixnum parameters will result in incorrect +results. {{fxneg}} negates its argument. + +On division by zero, {{fx/}} and {{fxmod}} signal a condition of kind +{{(exn arithmetic)}}. + +{{fxshl}} and {{fxshr}} perform arithmetic shift left and right, +respectively. + ==== fixnum? - [procedure] (fixnum? X) +(fixnum? X) Returns {{#t}} if {{X}} is a fixnum, or {{#f}} otherwise. @@ -126,7 +126,7 @@ Note: {{fpround}} implements POSIX, which is different from R5RS. ==== flonum? - [procedure] (flonum? X) +(flonum? X) Returns {{#t}} if {{X}} is a flonum, or {{#f}} otherwise. @@ -160,7 +160,7 @@ Returns {{#f}} if {{N}} is negative or positive infinity, and {{#t}} otherwise. ==== signum - [procedure] (signum N) +(signum N) Returns {{1}} if {{N}} is positive, {{-1}} if {{N}} is negative or {{0}} if {{N}} is zero. {{signum}} is exactness preserving. @@ -405,7 +405,7 @@ more information, see the ==== condition-case - [syntax] (condition-case EXPRESSION CLAUSE ...) +(condition-case EXPRESSION CLAUSE ...) Evaluates {{EXPRESSION}} and handles any exceptions that are covered by {{CLAUSE ...}}, where {{CLAUSE}} should be of the following form: @@ -577,8 +577,8 @@ Returns the error code of the last system call. ==== get-environment-variable - [procedure] (get-environment-variable STRING) - [procedure] (getenv STRING) +(get-environment-variable STRING)
+(getenv STRING) Returns the value of the environment variable {{STRING}} or {{#f}} if that variable is not defined. See also [[http://srfi.schemers.org/srfi-98/|SRFI-98]]. diff --git a/manual/Unit lolevel b/manual/Unit lolevel index d145c03..324e832 100644 --- a/manual/Unit lolevel +++ b/manual/Unit lolevel @@ -29,7 +29,7 @@ object'', but a ''pointer-like object''. The distinction is artificial. ==== address->pointer - [procedure] (address->pointer ADDRESS) +(address->pointer ADDRESS) Creates a new foreign pointer object initialized to point to the address given in the integer {{ADDRESS}}. @@ -37,7 +37,7 @@ given in the integer {{ADDRESS}}. ==== allocate - [procedure] (allocate BYTES) +(allocate BYTES) Returns a foreign pointer object to a freshly allocated region of static memory. @@ -51,7 +51,7 @@ This procedure could be defined as follows: ==== free - [procedure] (free POINTER) +(free POINTER) Frees the memory pointed to by {{POINTER}}. @@ -64,14 +64,14 @@ This procedure could be defined as follows: ==== null-pointer - [procedure] (null-pointer) +(null-pointer) Another way to say {{(address->pointer 0)}}. ==== null-pointer? - [procedure] (null-pointer? POINTER*) +(null-pointer? POINTER*) Returns {{#t}} if the pointer-like object {{POINTER*}} contains a {{NULL}} pointer, or {{#f}} otherwise. @@ -79,7 +79,7 @@ or {{#f}} otherwise. ==== object->pointer - [procedure] (object->pointer X) +(object->pointer X) Returns a foreign pointer object pointing to the Scheme object X, which should be a non-immediate object. ("foreign" here is a bit of a misnomer.) @@ -89,7 +89,7 @@ Note that data in the garbage collected heap moves during garbage collection. ==== pointer->object - [procedure] (pointer->object POINTER) +(pointer->object POINTER) Returns the Scheme object pointed to by the pointer object {{POINTER}}. @@ -98,21 +98,21 @@ at your own risk. ==== pointer? - [procedure] (pointer? X) +(pointer? X) Returns {{#t}} if {{X}} is a pointer object, or {{#f}} otherwise. ==== pointer-like? - [procedure] (pointer-like? X) +(pointer-like? X) Returns {{#t}} if {{X}} is a pointer-like object, or {{#f}} otherwise. ==== pointer=? - [procedure] (pointer=? POINTER*1 POINTER*2) +(pointer=? POINTER*1 POINTER*2) Returns {{#t}} if the pointer-like objects {{POINTER*1}} and {{POINTER*2}} point to the same address, or {{#f}} otherwise. @@ -120,14 +120,14 @@ to the same address, or {{#f}} otherwise. ==== pointer->address - [procedure] (pointer->address POINTER*) +(pointer->address POINTER*) Returns the address, to which the pointer-like object {{POINTER*}} points. ==== pointer-offset - [procedure] (pointer-offset POINTER* N) +(pointer-offset POINTER* N) Returns a new foreign pointer object representing the pointer-like object {{POINTER*}} address value increased by the byte-offset {{N}}. @@ -137,7 +137,7 @@ Use of anything other than a pointer object as an argument is questionable. ==== align-to-word - [procedure] (align-to-word POINTER*-OR-INT) +(align-to-word POINTER*-OR-INT) Accepts either a pointer-like object or an integer as the argument and returns a new foreign pointer or integer aligned to the native word size of the host @@ -155,120 +155,120 @@ However, as usual, use of anything other than a pointer object is questionable. ==== pointer-u8-ref - [procedure] (pointer-u8-ref POINTER) +(pointer-u8-ref POINTER) Returns the unsigned byte at the address designated by {{POINTER}}. ==== pointer-s8-ref - [procedure] (pointer-s8-ref POINTER) +(pointer-s8-ref POINTER) Returns the signed byte at the address designated by {{POINTER}}. ==== pointer-u16-ref - [procedure] (pointer-u16-ref POINTER) +(pointer-u16-ref POINTER) Returns the unsigned 16-bit integer at the address designated by {{POINTER}}. ==== pointer-s16-ref - [procedure] (pointer-s16-ref POINTER) +(pointer-s16-ref POINTER) Returns the signed 16-bit integer at the address designated by {{POINTER}}. ==== pointer-u32-ref - [procedure] (pointer-u32-ref POINTER) +(pointer-u32-ref POINTER) Returns the unsigned 32-bit integer at the address designated by {{POINTER}}. ==== pointer-s32-ref - [procedure] (pointer-s32-ref POINTER) +(pointer-s32-ref POINTER) Returns the signed 32-bit integer at the address designated by {{POINTER}}. ==== pointer-f32-ref - [procedure] (pointer-f32-ref POINTER) +(pointer-f32-ref POINTER) Returns the 32-bit float at the address designated by {{POINTER}}. ==== pointer-f64-ref - [procedure] (pointer-f64-ref POINTER) +(pointer-f64-ref POINTER) Returns the 64-bit double at the address designated by {{POINTER}}. ==== pointer-u8-set! - [procedure] (pointer-u8-set! POINTER N) - [procedure] (set! (pointer-u8-ref POINTER) N) +(pointer-u8-set! POINTER N)
+(set! (pointer-u8-ref POINTER) N) Stores the unsigned byte {{N}} at the address designated by {{POINTER}}. ==== pointer-s8-set! - [procedure] (pointer-s8-set! POINTER N) - [procedure] (set! (pointer-s8-ref POINTER) N) +(pointer-s8-set! POINTER N)
+(set! (pointer-s8-ref POINTER) N) Stores the signed byte {{N}} at the address designated by {{POINTER}}. ==== pointer-u16-set! - [procedure] (pointer-u16-set! POINTER N) - [procedure] (set! (pointer-u16-ref POINTER) N) +(pointer-u16-set! POINTER N)
+(set! (pointer-u16-ref POINTER) N) Stores the unsigned 16-bit integer {{N}} at the address designated by {{POINTER}}. ==== pointer-s16-set! - [procedure] (pointer-s16-set! POINTER N) - [procedure] (set! (pointer-s16-ref POINTER) N) +(pointer-s16-set! POINTER N)
+(set! (pointer-s16-ref POINTER) N) Stores the signed 16-bit integer {{N}} at the address designated by {{POINTER}}. ==== pointer-u32-set! - [procedure] (pointer-u32-set! POINTER N) - [procedure] (set! (pointer-u32-ref POINTER) N) +(pointer-u32-set! POINTER N)
+(set! (pointer-u32-ref POINTER) N) Stores the unsigned 32-bit integer {{N}} at the address designated by {{POINTER}}. ==== pointer-s32-set! - [procedure] (pointer-s32-set! POINTER N) - [procedure] (set! (pointer-s32-ref POINTER) N) +(pointer-s32-set! POINTER N)
+(set! (pointer-s32-ref POINTER) N) Stores the 32-bit integer {{N}} at the address designated by {{POINTER}}. ==== pointer-f32-set! - [procedure] (pointer-f32-set! POINTER N) - [procedure] (set! (pointer-f32-ref POINTER) N) +(pointer-f32-set! POINTER N)
+(set! (pointer-f32-ref POINTER) N) Stores the 32-bit floating-point number {{N}} at the address designated by {{POINTER}}. ==== pointer-f64-set! - [procedure] (pointer-f64-set! POINTER N) - [procedure] (set! (pointer-f64-ref POINTER) N) +(pointer-f64-set! POINTER N)
+(set! (pointer-f64-ref POINTER) N) Stores the 64-bit floating-point number {{N}} at the address designated by {{POINTER}}. @@ -281,7 +281,7 @@ Stores the 64-bit floating-point number {{N}} at the address designated by {{POI ==== tag-pointer - [procedure] (tag-pointer POINTER* TAG) +(tag-pointer POINTER* TAG) Creates a new tagged foreign pointer object from the pointer-like object {{POINTER*}} with the tag {{TAG}}, which may an arbitrary Scheme object. @@ -290,7 +290,7 @@ Use of anything other than a pointer object is questionable. ==== tagged-pointer? - [procedure] (tagged-pointer? X [TAG]) +(tagged-pointer? X [TAG]) Returns {{#t}} if {{X}} is a tagged foreign pointer object, or {{#f}} otherwise. @@ -300,7 +300,7 @@ Further, returns {{#t}} when {{X}} has the optional tag {{TAG}} (using an ==== pointer-tag - [procedure] (pointer-tag POINTER*) +(pointer-tag POINTER*) If {{POINTER}} is a tagged foreign pointer object, its tag is returned. If {{POINTER*}} is any other kind of pointer-like object {{#f}} is returned. Otherwise an @@ -323,7 +323,7 @@ The effect of creating locatives for evicted data (see {{object-evict}}) is unde ==== make-locative - [procedure] (make-locative OBJ [INDEX]) +(make-locative OBJ [INDEX]) Creates a locative that refers to the element of the non-immediate object {{OBJ}} at position {{INDEX}}. {{OBJ}} may be a vector, pair, string, blob, @@ -333,7 +333,7 @@ SRFI-4 number-vector, or record structure. {{INDEX}} should be a fixnum. ==== make-weak-locative - [procedure] (make-weak-locative OBJ [INDEX]) +(make-weak-locative OBJ [INDEX]) Creates a ''weak'' locative. Even though the locative refers to an element of a container object, the container object will still be reclaimed by garbage collection if no other references @@ -342,14 +342,14 @@ to it exist. ==== locative? - [procedure] (locative? X) +(locative? X) Returns {{#t}} if {{X}} is a locative, or {{#f}} otherwise. ==== locative-ref - [procedure] (locative-ref LOC) +(locative-ref LOC) Returns the element to which the locative {{LOC}} refers. If the containing object has been reclaimed by garbage collection, an error is signalled. @@ -358,8 +358,8 @@ object has been reclaimed by garbage collection, an error is signalled. ==== locative-set! - [procedure] (locative-set! LOC X) - [procedure] (set! (locative-ref LOC) X) +(locative-set! LOC X)
+(set! (locative-ref LOC) X) Changes the element to which the locative {{LOC}} refers to {{X}}. If the containing @@ -368,7 +368,7 @@ object has been reclaimed by garbage collection, an error is signalled. ==== locative->object - [procedure] (locative->object LOC) +(locative->object LOC) Returns the object that contains the element referred to by {{LOC}} or {{#f}} if the container has been reclaimed by garbage collection. @@ -382,7 +382,7 @@ Returns the object that contains the element referred to by {{LOC}} or ==== extend-procedure - [procedure] (extend-procedure PROCEDURE X) +(extend-procedure PROCEDURE X) Returns a copy of the procedure {{PROCEDURE}} which contains an additional data slot initialized to {{X}}. If {{PROCEDURE}} is already an extended procedure, @@ -392,7 +392,7 @@ returned. Signals an error when {{PROCEDURE}} is not a procedure. ==== extended-procedure? - [procedure] (extended-procedure? PROCEDURE) +(extended-procedure? PROCEDURE) Returns {{#t}} if {{PROCEDURE}} is an extended procedure, or {{#f}} otherwise. @@ -400,7 +400,7 @@ or {{#f}} otherwise. ==== procedure-data - [procedure] (procedure-data PROCEDURE) +(procedure-data PROCEDURE) Returns the data object contained in the extended procedure {{PROCEDURE}}, or {{#f}} if it is not an extended procedure. @@ -408,7 +408,7 @@ Returns the data object contained in the extended procedure {{PROCEDURE}}, or ==== set-procedure-data! - [procedure] (set-procedure-data! PROCEDURE X) +(set-procedure-data! PROCEDURE X) Changes the data object contained in the extended procedure {{PROCEDURE}} to {{X}}. Signals an error when {{PROCEDURE}} is not an extended procedure. @@ -436,7 +436,7 @@ Note that strings and blobs are not considered vector-like. ==== block-ref - [procedure] (block-ref VECTOR* INDEX) +(block-ref VECTOR* INDEX) Returns the contents of the {{INDEX}}th slot of the vector-like object {{VECTOR*}}. @@ -444,22 +444,22 @@ Returns the contents of the {{INDEX}}th slot of the vector-like object ==== block-set! - [procedure] (block-set! VECTOR* INDEX X) - [procedure] (set! (block-ref VECTOR* INDEX) X) +(block-set! VECTOR* INDEX X)
+(set! (block-ref VECTOR* INDEX) X) Sets the contents of the {{INDEX}}th slot of the vector-like object {{VECTOR*}} to the value of {{X}}. ==== number-of-slots - [procedure] (number-of-slots VECTOR*) +(number-of-slots VECTOR*) Returns the number of slots that the vector-like object {{VECTOR*}} contains. ==== number-of-bytes - [procedure] (number-of-bytes BLOCK) +(number-of-bytes BLOCK) Returns the number of bytes that the object {{BLOCK}} contains. {{BLOCK}} may be any non-immediate value. @@ -467,7 +467,7 @@ be any non-immediate value. ==== object-copy - [procedure] (object-copy X) +(object-copy X) Copies {{X}} recursively and returns the fresh copy. Objects allocated in static memory are copied back into garbage collected storage. @@ -475,7 +475,7 @@ static memory are copied back into garbage collected storage. ==== move-memory! - [procedure] (move-memory! FROM TO [BYTES [FROM-OFFSET [TO-OFFSET]]) +(move-memory! FROM TO [BYTES [FROM-OFFSET [TO-OFFSET]]]) Copies {{BYTES}} bytes of memory from {{FROM}} to {{TO}}. {{FROM}} and {{TO}} may be strings, blobs, SRFI-4 number-vectors (see: @ref{Unit srfi-4}), memory @@ -498,7 +498,7 @@ Signals an error if any of the above constraints is violated. ==== object-evict - [procedure] (object-evict X [ALLOCATOR]) +(object-evict X [ALLOCATOR]) Copies the object {{X}} recursively into the memory pointed to by the foreign pointer object returned by {{ALLOCATOR}}, which should be a procedure of a @@ -528,7 +528,7 @@ The {{ALLOCATOR}} defaults to {{allocate}}. ==== object-evict-to-location - [procedure] (object-evict-to-location X POINTER* [LIMIT]) +(object-evict-to-location X POINTER* [LIMIT]) As {{object-evict}} but moves the object at the address pointed to by the pointer-like object {{POINTER*}}. If the number of copied bytes exceeds @@ -543,7 +543,7 @@ questionable. ==== object-evicted? - [procedure] (object-evicted? X) +(object-evicted? X) Returns {{#t}} if {{X}} is a non-immediate evicted data object, or {{#f}} otherwise. @@ -551,7 +551,7 @@ otherwise. ==== object-release - [procedure] (object-release X [RELEASER]) +(object-release X [RELEASER]) Frees memory occupied by the evicted object {{X}} recursively. {{RELEASER}} should be a procedure of a single argument (a foreign @@ -561,7 +561,7 @@ pointer object to the static memory to be freed) and defaults to ==== object-unevict - [procedure] (object-unevict X [FULL]) +(object-unevict X [FULL]) Copies the object {{X}} and nested objects back into the normal Scheme heap. Symbols are re-interned into the symbol table. Strings and byte-vectors are @@ -570,7 +570,7 @@ Symbols are re-interned into the symbol table. Strings and byte-vectors are ==== object-size - [procedure] (object-size X) +(object-size X) Returns the number of bytes that would be needed to evict the data object {{X}}. @@ -582,7 +582,7 @@ Returns the number of bytes that would be needed to evict the data object ==== global-bound? - [procedure] (global-bound? SYMBOL) +(global-bound? SYMBOL) Returns {{#t}}, if the global (''toplevel'') variable with the name {{SYMBOL}} is bound to a value, or {{#f}} otherwise. @@ -590,7 +590,7 @@ is bound to a value, or {{#f}} otherwise. ==== global-ref - [procedure] (global-ref SYMBOL) +(global-ref SYMBOL) Returns the value of the global variable {{SYMBOL}}. If no variable under that name is bound, an error is signalled. @@ -602,8 +602,8 @@ or if the code has been compiled in {{block}} mode. ==== global-set! - [procedure] (global-set! SYMBOL X) - [procedure] (set! (global-ref SYMBOL) X) +(global-set! SYMBOL X)
+(set! (global-ref SYMBOL) X) Sets the global variable named {{SYMBOL}} to the value {{X}}. @@ -614,7 +614,7 @@ Sets the global variable named {{SYMBOL}} to the value {{X}}. ==== make-record-instance - [procedure] (make-record-instance SYMBOL ARG1 ...) +(make-record-instance SYMBOL ARG1 ...) Returns a new instance of the record type {{SYMBOL}}, with its slots initialized to {{ARG1 ...}}. To illustrate: @@ -643,7 +643,7 @@ expands into something quite similar to: ==== record-instance? - [procedure] (record-instance? X [SYMBOL]) +(record-instance? X [SYMBOL]) Returns {{#t}} if {{X}} is a record structure, or {{#f}} otherwise. @@ -652,7 +652,7 @@ Further, returns {{#t}} if {{X}} is of type {{SYMBOL}}, or {{#f}} otherwise. ==== record-instance-type - [procedure] (record-instance-type RECORD) +(record-instance-type RECORD) Returns type symbol of the record structure {{RECORD}}. Signals an error if {{RECORD}} is not a record structure. @@ -660,7 +660,7 @@ Returns type symbol of the record structure {{RECORD}}. Signals an error if ==== record-instance-length - [procedure] (record-instance-length RECORD) +(record-instance-length RECORD) Returns number of slots for the record structure {{RECORD}}. The record-instance type is not counted. Signals an error if @@ -669,7 +669,7 @@ record-instance type is not counted. Signals an error if ==== record-instance-slot - [procedure] (record-instance-slot RECORD INDEX) +(record-instance-slot RECORD INDEX) Returns the contents of the {{INDEX}}th slot of the record structure {{RECORD}}. The slot index range is the open interval (([0 @@ -679,8 +679,8 @@ structure. ==== record-instance-slot-set! - [procedure] (record-instance-slot-set! RECORD INDEX X) - [procedure] (set! (record-instance-slot RECORD INDEX) X) +(record-instance-slot-set! RECORD INDEX X)
+(set! (record-instance-slot RECORD INDEX) X) Sets the {{INDEX}}th slot of the record structure {{RECORD}} to {{X}}. The slot index range is the open interval (([0 record-instance-length)}}. Signals an @@ -689,7 +689,7 @@ error if {{RECORD}} is not a record structure. ==== record->vector - [procedure] (record->vector RECORD) +(record->vector RECORD) Returns a new vector with the type and the elements of the record structure {{RECORD}}. Signals an error if {{RECORD}} is not a record structure. @@ -700,7 +700,7 @@ Returns a new vector with the type and the elements of the record structure ==== object-become! - [procedure] (object-become! ALIST) +(object-become! ALIST) Changes the identity of the value of the car of each pair in {{ALIST}} to the value of the cdr. Both values may not be immediate (i.e. exact integers, @@ -723,7 +723,7 @@ is undefined. ==== mutate-procedure - [procedure] (mutate-procedure OLD PROC) +(mutate-procedure OLD PROC) Replaces the procedure {{OLD}} with the result of calling the one-argument procedure {{PROC}}. {{PROC}} will receive a copy of {{OLD}} that will be diff --git a/manual/Unit posix b/manual/Unit posix index 055a4f9..554a711 100644 --- a/manual/Unit posix +++ b/manual/Unit posix @@ -17,58 +17,64 @@ of kind {{(exn i/o file)}}. ==== File-control Commands -===== fcntl/dupfd -===== fcntl/getfd -===== fcntl/setfd -===== fcntl/getfl -===== fcntl/setfl +fcntl/dupfd
+fcntl/getfd
+fcntl/setfd
+fcntl/getfl
+fcntl/setfl + +Operations used with {{file-control}}. ==== Standard I/O file-descriptors -===== fileno/stdin -===== fileno/stdout -===== fileno/stderr +fileno/stdin
+fileno/stdout
+fileno/stderr + +Standard I/O file descriptor numbers, used with procedures +such as {{open-input-file*}} which take file descriptors. ==== Open flags -===== open/rdonly -===== open/wronly -===== open/rdwr -===== open/read -Synonym for {{open/rdonly}}. - -===== open/write -Synonym for {{open/wronly}}. - -===== open/creat -===== open/append -===== open/excl -===== open/noctty -===== open/nonblock -===== open/trunc -===== open/sync -===== open/fsync -===== open/binary -===== open/text +open/rdonly
+open/wronly
+open/rdwr
+open/read
+open/write
+open/creat
+open/append
+open/excl
+open/noctty
+open/nonblock
+open/trunc
+open/sync
+open/fsync
+open/binary
+open/text + +Open flags used with the {{file-open}} procedure. {{open/read}} is a +convenience synonym for {{open/rdonly}}, as is {{open/write}} +for {{open/wronly}}. ==== Permission bits -===== perm/irusr -===== perm/iwusr -===== perm/ixusr -===== perm/irgrp -===== perm/iwgrp -===== perm/ixgrp -===== perm/iroth -===== perm/iwoth -===== perm/ixoth -===== perm/irwxu -===== perm/irwxg -===== perm/irwxo -===== perm/isvtx -===== perm/isuid -===== perm/isgid - +perm/irusr
+perm/iwusr
+perm/ixusr
+perm/irgrp
+perm/iwgrp
+perm/ixgrp
+perm/iroth
+perm/iwoth
+perm/ixoth
+perm/irwxu
+perm/irwxg
+perm/irwxo
+perm/isvtx
+perm/isuid
+perm/isgid + +Permission bits used with, for example, {{file-open}}. === Directories @@ -137,7 +143,7 @@ If the current process has no root permissions, the operation will fail. ==== call-with-input-pipe ==== call-with-output-pipe -(call-with-input-pipe CMDLINE PROC [MODE]) +(call-with-input-pipe CMDLINE PROC [MODE])
(call-with-output-pipe CMDLINE PROC [MODE]) Call {{PROC}} with a single argument: a input- or output port @@ -148,7 +154,7 @@ are returned. ==== close-input-pipe ==== close-output-pipe -(close-input-pipe PORT) +(close-input-pipe PORT)
(close-output-pipe PORT) Closes the pipe given in {{PORT}} and waits until the connected @@ -188,7 +194,7 @@ atomically into a pipe or FIFO. ==== with-input-from-pipe ==== with-output-to-pipe -(with-input-from-pipe CMDLINE THUNK [MODE]) +(with-input-from-pipe CMDLINE THUNK [MODE])
(with-output-to-pipe CMDLINE THUNK [MODE]) Temporarily set the value of @@ -340,7 +346,7 @@ meaningful depending on the {{COMMAND}}. ==== open-input-file* ==== open-output-file* -(open-input-file* FILENO [OPENMODE]) +(open-input-file* FILENO [OPENMODE])
(open-output-file* FILENO [OPENMODE]) Opens file for the file-descriptor {{FILENO}} for input or output @@ -363,8 +369,8 @@ this port. Otherwise an error is signaled. ==== file-change-time ==== file-modification-time -(file-access-time FILE) -(file-change-time FILE) +(file-access-time FILE)
+(file-change-time FILE)
(file-modification-time FILE) Returns time (in seconds) of the last access, modification or change of {{FILE}}. {{FILE}} @@ -433,8 +439,8 @@ values. {{FILE}} may be a filename or a file-descriptor. ==== file-write-access? ==== file-execute-access? -(file-read-access? FILENAME) -(file-write-access? FILENAME) +(file-read-access? FILENAME)
+(file-write-access? FILENAME)
(file-execute-access? FILENAME) These procedures return {{#t}} if the current user has read, @@ -446,9 +452,9 @@ write or execute permissions on the file named {{FILENAME}}. ==== fifo? ==== socket? -(character-device? FILENAME) -(block-device? FILENAME) -(fifo? FILENAME) +(character-device? FILENAME)
+(block-device? FILENAME)
+(fifo? FILENAME)
(socket? FILENAME) These procedures return {{#t}} if the {{FILENAME}} given is of the @@ -468,7 +474,7 @@ or a file-descriptor. ==== set-file-position! -(set-file-position! FILE POSITION [WHENCE]) +(set-file-position! FILE POSITION [WHENCE])
(set! (file-position FILE) POSITION) Sets the current read/write position of {{FILE}} to @@ -543,7 +549,7 @@ with no arguments and terminates. ==== process-run -(process-run COMMANDLINE) +(process-run COMMANDLINE)
(process-run COMMAND ARGUMENT-LIST) Creates a new child process. The PID of the new process is returned. @@ -577,7 +583,7 @@ returns three values: ==== process -(process COMMANDLINE) +(process COMMANDLINE)
(process COMMAND ARGUMENT-LIST [ENVIRONMENT-LIST]) Creates a subprocess and returns three values: an input port from @@ -596,7 +602,7 @@ Not using the shell may be preferrable for security reasons. ==== process* -(process* COMMANDLINE) +(process* COMMANDLINE)
(process* COMMAND ARGUMENT-LIST [ENVIRONMENT-LIST]) Like {{process}} but returns 4 values: an input port from @@ -830,31 +836,33 @@ Masks (blocks) the signal for the code {{SIGNUM}}. Unmasks (unblocks) the signal for the code {{SIGNUM}}. -==== signal/term -==== signal/kill -==== signal/int -==== signal/hup -==== signal/fpe -==== signal/ill -==== signal/segv -==== signal/abrt -==== signal/trap -==== signal/quit -==== signal/alrm -==== signal/vtalrm -==== signal/prof -==== signal/io -==== signal/urg -==== signal/chld -==== signal/cont -==== signal/stop -==== signal/tstp -==== signal/pipe -==== signal/xcpu -==== signal/xfsz -==== signal/usr1 -==== signal/usr2 -==== signal/winch +==== Signal codes + +signal/term
+signal/kill
+signal/int
+signal/hup
+signal/fpe
+signal/ill
+signal/segv
+signal/abrt
+signal/trap
+signal/quit
+signal/alrm
+signal/vtalrm
+signal/prof
+signal/io
+signal/urg
+signal/chld
+signal/cont
+signal/stop
+signal/tstp
+signal/pipe
+signal/xcpu
+signal/xfsz
+signal/usr1
+signal/usr2
+signal/winch These variables contain signal codes for use with {{process-signal}}, {{set-signal-handler!}}, {{signal-handler}}, {{signal-masked?}}, {{signal-mask!}}, or {{signal-unmask!}}. @@ -863,7 +871,7 @@ These variables contain signal codes for use with {{process-signal}}, {{set-sig ==== current-environment - [procedure] (get-environment-variables) +(get-environment-variables) Returns a association list of the environment variables and their current values (see also [[http://srfi.schemers.org/srfi-98/|SRFI-98]]). @@ -889,7 +897,7 @@ nothing happens. ==== memory-mapped-file? - [procedure] (memory-mapped-file? X) +(memory-mapped-file? X) Returns {{#t}}, if {{X}} is an object representing a memory mapped file, or {{#f}} otherwise. @@ -1002,7 +1010,7 @@ The {{FORMAT}} string follows the rules for the C library procedure {{strftime}} ==== string->time - [procedure] (string->time TIME [FORMAT]) +(string->time TIME [FORMAT]) Converts a string of the form represented by the {{FORMAT}} string into the broken down time represented in a 10 element vector. The @@ -1025,29 +1033,30 @@ is not called when this procedure is invoked. The optional return-code === ERRNO values -==== errno/perm -==== errno/noent -==== errno/srch -==== errno/intr -==== errno/io -==== errno/noexec -==== errno/badf -==== errno/child -==== errno/nomem -==== errno/acces -==== errno/fault -==== errno/busy -==== errno/notdir -==== errno/isdir -==== errno/inval -==== errno/mfile -==== errno/nospc -==== errno/spipe -==== errno/pipe -==== errno/again -==== errno/rofs -==== errno/exist -==== errno/wouldblock +errno/perm
+errno/noent
+errno/srch
+errno/intr
+errno/io
+errno/noexec
+errno/badf
+errno/child
+errno/nomem
+errno/acces
+errno/fault
+errno/busy
+errno/notdir
+errno/isdir
+errno/inval
+errno/mfile
+errno/nospc
+errno/spipe
+errno/pipe
+errno/again
+errno/rofs
+errno/exist
+errno/wouldblock + These variables contain error codes as returned by {{errno}}. @@ -1121,7 +1130,7 @@ Returns {{#t}} if {{PORT}} is connected to a terminal and ==== terminal-size - [procedure] (terminal-size) +(terminal-size) Returns two values, the number of columns and rows of the current terminal window or {{0}}, {{0}} if the terminal @@ -1231,9 +1240,9 @@ The optional parameter {{MODE}}, default {{open/binary | open/noinherit}}. This status is available. (Windows does not provide signals as an interprocess communication method.) -(process-execute PATHNAME [ARGUMENT-LIST [ENVIRONMENT-LIST [EXACT-FLAG]]]) -(process COMMAND ARGUMENT-LIST [ENVIRONMENT-LIST [EXACT-FLAG]]) -(process* COMMAND ARGUMENT-LIST [ENVIRONMENT-LIST [EXACT-FLAG]]) +(process-execute PATHNAME [ARGUMENT-LIST [ENVIRONMENT-LIST [EXACT-FLAG]]])
+(process COMMAND ARGUMENT-LIST [ENVIRONMENT-LIST [EXACT-FLAG]])
+(process* COMMAND ARGUMENT-LIST [ENVIRONMENT-LIST [EXACT-FLAG]])
The optional parameter {{EXACT-FLAG}}, default {{#f}}. When {{#f}} any argument string with embedded whitespace will be wrapped in quotes. When {{#t}} no such wrapping occurs. @@ -1306,7 +1315,7 @@ Returns: * the PID when asynchronous * -1 when failure ---- +---- Previous: [[Unit srfi-69]] Next: [[Unit utils]] diff --git a/manual/Unit regex b/manual/Unit regex index 23b78e5..eb8720b 100644 --- a/manual/Unit regex +++ b/manual/Unit regex @@ -21,7 +21,7 @@ just use normal Scheme lists, with quasiquote if you like. === grep - [procedure] (grep REGEX LIST [ACCESSOR]) +(grep REGEX LIST [ACCESSOR]) Returns all items of {{LIST}} that match the regular expression {{REGEX}}. This procedure could be defined as follows: @@ -39,7 +39,7 @@ matching. {{ACCESSOR}} defaults to the identity function. === glob->regexp - [procedure] (glob->regexp PATTERN) +(glob->regexp PATTERN) Converts the file-pattern {{PATTERN}} into a regular expression. @@ -59,7 +59,7 @@ Converts the file-pattern {{PATTERN}} into a regular expression. === glob? - [procedure] (glob? STRING) +(glob? STRING) Does the {{STRING}} have any "glob" wildcards? @@ -69,7 +69,7 @@ even though it technically is a valid "glob" file-pattern. === regexp - [procedure] (regexp STRING [IGNORECASE [IGNORESPACE [UTF8]]]) +(regexp STRING [IGNORECASE [IGNORESPACE [UTF8]]]) Returns a precompiled regular expression object for {{string}}. The optional arguments {{IGNORECASE}}, {{IGNORESPACE}} and {{UTF8}} @@ -85,7 +85,7 @@ below. === regexp? - [procedure] (regexp? X) +(regexp? X) Returns {{#t}} if {{X}} is a precompiled regular expression, or {{#f}} otherwise. @@ -94,8 +94,8 @@ or {{#f}} otherwise. === string-match === string-match-positions - [procedure] (string-match REGEXP STRING [START]) - [procedure] (string-match-positions REGEXP STRING [START]) +(string-match REGEXP STRING [START])
+(string-match-positions REGEXP STRING [START]) Matches the regular expression in {{REGEXP}} (a string or a precompiled regular expression) with @@ -117,8 +117,8 @@ If invoked with a precompiled regular expression argument (by using === string-search === string-search-positions - [procedure] (string-search REGEXP STRING [START [RANGE]]) - [procedure] (string-search-positions REGEXP STRING [START [RANGE]]) +(string-search REGEXP STRING [START [RANGE]])
+(string-search-positions REGEXP STRING [START [RANGE]]) Searches for the first match of the regular expression in {{REGEXP}} with {{STRING}}. The search can be limited to @@ -127,7 +127,7 @@ Searches for the first match of the regular expression in === string-split-fields - [procedure] (string-split-fields REGEXP STRING [MODE [START]]) +(string-split-fields REGEXP STRING [MODE [START]]) Splits {{STRING}} into a list of fields according to {{MODE}}, where {{MODE}} can be the keyword {{#:infix}} ({{REGEXP}} @@ -154,7 +154,7 @@ which is the default. === string-substitute - [procedure] (string-substitute REGEXP SUBST STRING [MODE]) +(string-substitute REGEXP SUBST STRING [MODE]) Searches substrings in {{STRING}} that match {{REGEXP}} and substitutes them with the string {{SUBST}}. The substitution @@ -176,7 +176,7 @@ signal an error. === string-substitute* - [procedure] (string-substitute* STRING SMAP [MODE]) +(string-substitute* STRING SMAP [MODE]) Substitutes elements of {{STRING}} with {{string-substitute}} according to {{SMAP}}. {{SMAP}} should be an association-list where each element of the list @@ -193,7 +193,7 @@ the regular expression {{MATCH}} in {{STRING}} will be replaced by the string === regexp-escape - [procedure] (regexp-escape STRING) +(regexp-escape STRING) Escapes all special characters in {{STRING}} with {{\}}, so that the string can be embedded into a regular expression. diff --git a/manual/Unit srfi-18 b/manual/Unit srfi-18 index eacf6ea..1386f81 100644 --- a/manual/Unit srfi-18 +++ b/manual/Unit srfi-18 @@ -40,7 +40,7 @@ The following procedures are provided, in addition to the procedures defined in === thread-signal! - [procedure] (thread-signal! THREAD X) +(thread-signal! THREAD X) This will cause {{THREAD}} to signal the condition {{X}} once it is scheduled for execution. After signalling the condition, the thread continues with its normal @@ -48,32 +48,32 @@ execution. === thread-quantum - [procedure] (thread-quantum THREAD) +(thread-quantum THREAD) Returns the quantum of {{THREAD}}, which is an exact integer specifying the approximate time-slice of the thread in milliseconds. === thread-quantum-set! - [procedure] (thread-quantum-set! THREAD QUANTUM) +(thread-quantum-set! THREAD QUANTUM) Sets the quantum of {{THREAD}} to {{QUANTUM}}. === thread-suspend! - [procedure] (thread-suspend! THREAD) +(thread-suspend! THREAD) Suspends the execution of {{THREAD}} until resumed. === thread-resume! - [procedure] (thread-resume! THREAD) +(thread-resume! THREAD) Readies the suspended thread {{THREAD}}. === thread-wait-for-i/o! - [procedure] (thread-wait-for-i/o! FD [MODE]) +(thread-wait-for-i/o! FD [MODE]) Suspends the current thread until input ({{MODE}} is {{#:input}}), output ({{MODE}} is {{#:output}}) or both ({{MODE}} is {{#:all}}) is available. {{FD}} should be a file-descriptor (not a port!) open @@ -81,14 +81,14 @@ for input or output, respectively. === time->milliseconds - [procedure] (time->milliseconds TIME) +(time->milliseconds TIME) Converts a time object (as created via {{current-time}}) into an exact integer representing the number of milliseconds since process startup. === milliseconds->time - [procedure] (milliseconds->time ms) +(milliseconds->time ms) Converts into a time object an exact integer representing the number of milliseconds since process startup. diff --git a/manual/Unit srfi-4 b/manual/Unit srfi-4 index 6e62919..ee1ab66 100644 --- a/manual/Unit srfi-4 +++ b/manual/Unit srfi-4 @@ -11,7 +11,7 @@ collected memory: === make-XXXvector - [procedure] (make-XXXvector SIZE [INIT NONGC FINALIZE]) +(make-XXXvector SIZE [INIT NONGC FINALIZE]) Creates a SRFI-4 homogenous number vector of length {{SIZE}}. If {{INIT}} is given, it specifies the initial value for each slot in the vector. The optional arguments {{NONGC}} and {{FINALIZE}} define whether the @@ -41,22 +41,22 @@ Additionally, the following procedures are provided: === f32vector->blob/shared === f64vector->blob/shared - [procedure] (u8vector->blob U8VECTOR) - [procedure] (s8vector->blob S8VECTOR) - [procedure] (u16vector->blob U16VECTOR) - [procedure] (s16vector->blob S16VECTOR) - [procedure] (u32vector->blob U32VECTOR) - [procedure] (s32vector->blob S32VECTOR) - [procedure] (f32vector->blob F32VECTOR) - [procedure] (f64vector->blob F64VECTOR) - [procedure] (u8vector->blob/shared U8VECTOR) - [procedure] (s8vector->blob/shared S8VECTOR) - [procedure] (u16vector->blob/shared U16VECTOR) - [procedure] (s16vector->blob/shared S16VECTOR) - [procedure] (u32vector->blob/shared U32VECTOR) - [procedure] (s32vector->blob/shared S32VECTOR) - [procedure] (f32vector->blob/shared F32VECTOR) - [procedure] (f64vector->blob/shared F64VECTOR) +(u8vector->blob U8VECTOR)
+(s8vector->blob S8VECTOR)
+(u16vector->blob U16VECTOR)
+(s16vector->blob S16VECTOR)
+(u32vector->blob U32VECTOR)
+(s32vector->blob S32VECTOR)
+(f32vector->blob F32VECTOR)
+(f64vector->blob F64VECTOR)
+(u8vector->blob/shared U8VECTOR)
+(s8vector->blob/shared S8VECTOR)
+(u16vector->blob/shared U16VECTOR)
+(s16vector->blob/shared S16VECTOR)
+(u32vector->blob/shared U32VECTOR)
+(s32vector->blob/shared S32VECTOR)
+(f32vector->blob/shared F32VECTOR)
+(f64vector->blob/shared F64VECTOR) Each of these procedures return the contents of the given vector as a 'packed' blob. The byte order in that vector is platform-dependent @@ -81,22 +81,22 @@ variants return a blob that shares memory with the contents of the vector. === blob->f32vector/shared === blob->f64vector/shared - [procedure] (blob->u8vector BLOB) - [procedure] (blob->s8vector BLOB) - [procedure] (blob->u16vector BLOB) - [procedure] (blob->s16vector BLOB) - [procedure] (blob->u32vector BLOB) - [procedure] (blob->s32vector BLOB) - [procedure] (blob->f32vector BLOB) - [procedure] (blob->f64vector BLOB) - [procedure] (blob->u8vector/shared BLOB) - [procedure] (blob->s8vector/shared BLOB) - [procedure] (blob->u16vector/shared BLOB) - [procedure] (blob->s16vector/shared BLOB) - [procedure] (blob->u32vector/shared BLOB) - [procedure] (blob->s32vector/shared BLOB) - [procedure] (blob->f32vector/shared BLOB) - [procedure] (blob->f64vector/shared BLOB) +(blob->u8vector BLOB)
+(blob->s8vector BLOB)
+(blob->u16vector BLOB)
+(blob->s16vector BLOB)
+(blob->u32vector BLOB)
+(blob->s32vector BLOB)
+(blob->f32vector BLOB)
+(blob->f64vector BLOB)
+(blob->u8vector/shared BLOB)
+(blob->s8vector/shared BLOB)
+(blob->u16vector/shared BLOB)
+(blob->s16vector/shared BLOB)
+(blob->u32vector/shared BLOB)
+(blob->s32vector/shared BLOB)
+(blob->f32vector/shared BLOB)
+(blob->f64vector/shared BLOB) Each of these procedures return a vector where the argument {{BLOB}} is taken as a 'packed' representation of the contents @@ -113,14 +113,14 @@ shares memory with the contents of the blob. === subf32vector === subf64vector - [procedure] (subu8vector U8VECTOR FROM TO) - [procedure] (subu16vector U16VECTOR FROM TO) - [procedure] (subu32vector U32VECTOR FROM TO) - [procedure] (subs8vector S8VECTOR FROM TO) - [procedure] (subs16vector S16VECTOR FROM TO) - [procedure] (subs32vector S32VECTOR FROM TO) - [procedure] (subf32vector F32VECTOR FROM TO) - [procedure] (subf64vector F64VECTOR FROM TO) +(subu8vector U8VECTOR FROM TO)
+(subu16vector U16VECTOR FROM TO)
+(subu32vector U32VECTOR FROM TO)
+(subs8vector S8VECTOR FROM TO)
+(subs16vector S16VECTOR FROM TO)
+(subs32vector S32VECTOR FROM TO)
+(subf32vector F32VECTOR FROM TO)
+(subf64vector F64VECTOR FROM TO) Creates a number vector of the same type as the argument vector with the elements at the positions {{FROM}} up to but not including {{TO}}. @@ -130,7 +130,7 @@ SRFI-17 Setters for {{XXXvector-ref}} are defined. === read-u8vector - [procedure] (read-u8vector LENGTH [PORT]) +(read-u8vector LENGTH [PORT]) Reads {{LENGTH}} bytes from the {{PORT}} and returns a fresh {{u8vector}} or less if end-of-file is encountered. {{PORT}} defaults to the @@ -140,7 +140,7 @@ If {{LENGTH}} is {{#f}}, the vector will be filled completely until end-of-file === read-u8vector! - [procedure] (read-u8vector! LENGTH U8VECTOR [PORT [START]]) +(read-u8vector! LENGTH U8VECTOR [PORT [START]]) Reads {{LENGTH}} bytes from the {{PORT}} writing the read input into {{U8VECTOR}} beginning at {{START}} (or 0 if not given). {{PORT}} defaults @@ -151,7 +151,7 @@ This procedure returns the number of bytes read. === write-u8vector - [procedure] (write-u8vector U8VECTOR [PORT [START [END]]]) +(write-u8vector U8VECTOR [PORT [START [END]]]) Writes the bytes {{U8VECTOR}} between the indices {{START}} (inclusive) and {{END}} (exclusive) to {{PORT}}. {{PORT}} defaults to the value of {{(current-output-port)}}. diff --git a/manual/Unit srfi-69 b/manual/Unit srfi-69 index d637884..a584af5 100644 --- a/manual/Unit srfi-69 +++ b/manual/Unit srfi-69 @@ -13,7 +13,7 @@ CHICKEN implements SRFI 69 with SRFI 90 extensions. For more information, see ==== make-hash-table - [procedure] (make-hash-table [TEST HASH SIZE] [#:test TEST] [#:hash HASH] [#:size SIZE] [#:initial INITIAL] [#:min-load MIN-LOAD] [#:max-load MAX-LOAD] [#:weak-keys WEAK-KEYS] [#:weak-values WEAK-VALUES]) +(make-hash-table [TEST HASH SIZE] [#:test TEST] [#:hash HASH] [#:size SIZE] [#:initial INITIAL] [#:min-load MIN-LOAD] [#:max-load MAX-LOAD] [#:weak-keys WEAK-KEYS] [#:weak-values WEAK-VALUES]) Returns a new {{HASH-TABLE}} with the supplied configuration. @@ -29,7 +29,7 @@ Returns a new {{HASH-TABLE}} with the supplied configuration. ==== alist->hash-table - [procedure] (alist->hash-table A-LIST [#:test TEST] [#:hash HASH] [#:size SIZE] [#:initial INITIAL] [#:min-load MIN-LOAD] [#:max-load MAX-LOAD] [#:weak-keys WEAK-KEYS] [#:weak-values WEAK-VALUES]) +(alist->hash-table A-LIST [#:test TEST] [#:hash HASH] [#:size SIZE] [#:initial INITIAL] [#:min-load MIN-LOAD] [#:max-load MAX-LOAD] [#:weak-keys WEAK-KEYS] [#:weak-values WEAK-VALUES]) Returns a new {{HASH-TABLE}}. The {{HASH-TABLE}} is populated from the {{A-LIST}}. The keyword arguments are per {{make-hash-table}}. @@ -37,91 +37,91 @@ Returns a new {{HASH-TABLE}}. The {{HASH-TABLE}} is populated from the ==== hash-table? - [procedure] (hash-table? OBJECT) +(hash-table? OBJECT) Is the {{OBJECT}} a {{hash-table}}? ==== hash-table-size - [procedure] (hash-table-size HASH-TABLE) +(hash-table-size HASH-TABLE) The {{HASH-TABLE}} size. ==== hash-table-equivalence-function - [procedure] (hash-table-equivalence-function HASH-TABLE) +(hash-table-equivalence-function HASH-TABLE) The {{HASH-TABLE}} {{equivalence-function}}. ==== hash-table-hash-function - [procedure] (hash-table-hash-function HASH-TABLE) +(hash-table-hash-function HASH-TABLE) The {{HASH-TABLE}} {{hash-function}}. ==== hash-table-min-load - [procedure] (hash-table-min-load HASH-TABLE) +(hash-table-min-load HASH-TABLE) The {{HASH-TABLE}} minimum load factor. ==== hash-table-max-load - [procedure] (hash-table-max-load HASH-TABLE) +(hash-table-max-load HASH-TABLE) The {{HASH-TABLE}} maximum load factor. ==== hash-table-weak-keys - [procedure] (hash-table-weak-keys HASH-TABLE) +(hash-table-weak-keys HASH-TABLE) Does the {{HASH-TABLE}} weak references for keys? ==== hash-table-weak-values - [procedure] (hash-table-weak-values HASH-TABLE) +(hash-table-weak-values HASH-TABLE) Does the {{HASH-TABLE}} weak references for values? ==== hash-table-has-initial? - [procedure] (hash-table-has-initial? HASH-TABLE) +(hash-table-has-initial? HASH-TABLE) Does the {{HASH-TABLE}} have a default initial value? ==== hash-table-initial - [procedure] (hash-table-initial HASH-TABLE) +(hash-table-initial HASH-TABLE) The {{HASH-TABLE}} default initial value. ==== hash-table-keys - [procedure] (hash-table-keys HASH-TABLE) +(hash-table-keys HASH-TABLE) Returns a list of the keys in the {{HASH-TABLE}} population. ==== hash-table-values - [procedure] (hash-table-values HASH-TABLE) +(hash-table-values HASH-TABLE) Returns a list of the values in the {{HASH-TABLE}} population. ==== hash-table->alist - [procedure] (hash-table->alist HASH-TABLE) +(hash-table->alist HASH-TABLE) Returns the population of the {{HASH-TABLE}} as an {{a-list}}. @@ -129,7 +129,7 @@ Returns the population of the {{HASH-TABLE}} as an {{a-list}}. ==== hash-table-ref - [procedure] (hash-table-ref HASH-TABLE KEY) +(hash-table-ref HASH-TABLE KEY) Returns the {{VALUE}} for the {{KEY}} in the {{HASH-TABLE}}. @@ -138,7 +138,7 @@ Aborts with an exception when the {{KEY}} is missing. ==== hash-table-ref/default - [procedure] (hash-table-ref/default HASH-TABLE KEY DEFAULT) +(hash-table-ref/default HASH-TABLE KEY DEFAULT) Returns the {{VALUE}} for the {{KEY}} in the {{HASH-TABLE}}, or the {{DEFAULT}} when the {{KEY}} is missing. @@ -146,14 +146,14 @@ when the {{KEY}} is missing. ==== hash-table-exists? - [procedure] (hash-table-exists? HASH-TABLE KEY) +(hash-table-exists? HASH-TABLE KEY) Does the {{KEY}} exist in the {{HASH-TABLE}}? ==== hash-table-set! - [procedure] (hash-table-set! HASH-TABLE KEY VALUE) +(hash-table-set! HASH-TABLE KEY VALUE) Set the {{VALUE}} for the {{KEY}} in the {{HASH-TABLE}}. @@ -172,7 +172,7 @@ is equivalent to ==== hash-table-update! - [procedure] (hash-table-update! HASH-TABLE KEY [UPDATE-FUNCTION [DEFAULT-VALUE-FUNCTION]]) +(hash-table-update! HASH-TABLE KEY [UPDATE-FUNCTION [DEFAULT-VALUE-FUNCTION]]) Sets or replaces the {{VALUE}} for {{KEY}} in the {{HASH-TABLE}}. @@ -188,7 +188,7 @@ Returns the new {{VALUE}}. ==== hash-table-update!/default - [procedure] (hash-table-update! HASH-TABLE KEY UPDATE-FUNCTION DEFAULT-VALUE) +(hash-table-update!/default HASH-TABLE KEY UPDATE-FUNCTION DEFAULT-VALUE) Sets or replaces the {{VALUE}} for {{KEY}} in the {{HASH-TABLE}}. @@ -202,21 +202,21 @@ Returns the new {{VALUE}}. ==== hash-table-copy - [procedure] (hash-table-copy HASH-TABLE) +(hash-table-copy HASH-TABLE) Returns a shallow copy of the {{HASH-TABLE}}. ==== hash-table-delete! - [procedure] (hash-table-delete! HASH-TABLE KEY) +(hash-table-delete! HASH-TABLE KEY) Deletes the entry for {{KEY}} in the {{HASH-TABLE}}. ==== hash-table-remove! - [procedure] (hash-table-remove! HASH-TABLE PROC) +(hash-table-remove! HASH-TABLE PROC) Calls {{PROC}} for all entries in {{HASH-TABLE}} with the key and value of each entry. If {{PROC}} returns true, then that entry is removed. @@ -224,14 +224,14 @@ entry. If {{PROC}} returns true, then that entry is removed. ==== hash-table-clear! - [procedure] (hash-table-clear! HASH-TABLE) +(hash-table-clear! HASH-TABLE) Deletes all entries in {{HASH-TABLE}}. ==== hash-table-merge - [procedure] (hash-table-merge HASH-TABLE-1 HASH-TABLE-2) +(hash-table-merge HASH-TABLE-1 HASH-TABLE-2) Returns a new {{HASH-TABLE}} with the union of {{HASH-TABLE-1}} and {{HASH-TABLE-2}}. @@ -239,7 +239,7 @@ Returns a new {{HASH-TABLE}} with the union of {{HASH-TABLE-1}} and ==== hash-table-merge! - [procedure] (hash-table-merge! HASH-TABLE-1 HASH-TABLE-2) +(hash-table-merge! HASH-TABLE-1 HASH-TABLE-2) Returns {{HASH-TABLE-1}} as the union of {{HASH-TABLE-1}} and {{HASH-TABLE-2}}. @@ -247,7 +247,7 @@ Returns {{HASH-TABLE-1}} as the union of {{HASH-TABLE-1}} and ==== hash-table-map - [procedure] (hash-table-map HASH-TABLE FUNC) +(hash-table-map HASH-TABLE FUNC) Calls {{FUNC}} for all entries in {{HASH-TABLE}} with the key and value of each entry. @@ -257,7 +257,7 @@ Returns a list of the results of each call. ==== hash-table-fold - [procedure] (hash-table-fold HASH-TABLE FUNC INIT) +(hash-table-fold HASH-TABLE FUNC INIT) Calls {{FUNC}} for all entries in {{HASH-TABLE}} with the key and value of each entry, and the current folded value. The initial folded value is {{INIT}}. @@ -267,7 +267,7 @@ Returns the final folded value. ==== hash-table-for-each - [procedure] (hash-table-for-each HASH-TABLE PROC) +(hash-table-for-each HASH-TABLE PROC) Calls {{PROC}} for all entries in {{HASH-TABLE}} with the key and value of each entry. @@ -275,7 +275,7 @@ entry. ==== hash-table-walk - [procedure] (hash-table-walk HASH-TABLE PROC) +(hash-table-walk HASH-TABLE PROC) Calls {{PROC}} for all entries in {{HASH-TABLE}} with the key and value of each entry. @@ -288,35 +288,35 @@ All hash functions return a {{fixnum}} in the range [0 {{BOUND}}). ==== number-hash - [procedure] (number-hash NUMBER [BOUND]) +(number-hash NUMBER [BOUND]) For use with {{=}} as a {{hash-table-equivalence-function}}. ==== object-uid-hash - [procedure] (object-uid-hash OBJECT [BOUND]) +(object-uid-hash OBJECT [BOUND]) Currently a synonym for {{equal?-hash}}. ==== symbol-hash - [procedure] (symbol-hash SYMBOL [BOUND]) +(symbol-hash SYMBOL [BOUND]) For use with {{eq?}} as a {{hash-table-equivalence-function}}. ==== keyword-hash - [procedure] (keyword-hash KEYWORD [BOUND]) +(keyword-hash KEYWORD [BOUND]) For use with {{eq?}} as a {{hash-table-equivalence-function}}. ==== string-hash - [procedure] (string-hash STRING [BOUND START END]) +(string-hash STRING [BOUND START END]) For use with {{string=?}} as a {{hash-table-equivalence-function}}. The optional {{START}} and {{END}} arguments may be given to limit @@ -325,43 +325,43 @@ the hash calculation to a specific sub-section of {{STRING}}. ==== string-ci-hash - [procedure] (string-hash-ci STRING [BOUND START END]) - [procedure] (string-ci-hash STRING [BOUND START END]) +(string-hash-ci STRING [BOUND START END])
+(string-ci-hash STRING [BOUND START END]) For use with {{string-ci=?}} as a {{hash-table-equivalence-function}}. ==== eq?-hash - [procedure] (eq?-hash OBJECT [BOUND]) +(eq?-hash OBJECT [BOUND]) For use with {{eq?}} as a {{hash-table-equivalence-function}}. ==== eqv?-hash - [procedure] (eqv?-hash OBJECT [BOUND]) +(eqv?-hash OBJECT [BOUND]) For use with {{eqv?}} as a {{hash-table-equivalence-function}}. ==== equal?-hash - [procedure] (equal?-hash OBJECT [BOUND]) +(equal?-hash OBJECT [BOUND]) For use with {{equal?}} as a {{hash-table-equivalence-function}}. ==== hash - [procedure] (hash OBJECT [BOUND]) +(hash OBJECT [BOUND]) Synonym for {{equal?-hash}}. ==== hash-by-identity - [procedure] (hash-by-identity OBJECT [BOUND]) +(hash-by-identity OBJECT [BOUND]) Synonym for {{eq?-hash}}. diff --git a/manual/Unit tcp b/manual/Unit tcp index f4ec584..cb6bfd3 100644 --- a/manual/Unit tcp +++ b/manual/Unit tcp @@ -129,7 +129,7 @@ without breaking the connection. === tcp-buffer-size - [parameter] tcp-buffer-size +tcp-buffer-size Sets the size of the output buffer. By default no output-buffering for TCP output is done, but to improve performance by minimizing the @@ -145,7 +145,7 @@ Closing the output port will flush automatically. === tcp-read-timeout - [parameter] tcp-read-timeout +tcp-read-timeout Determines the timeout for TCP read operations in milliseconds. A timeout of {{#f}} disables timeout checking. The default read timeout is 60000, i.e. @@ -155,7 +155,7 @@ is thrown. === tcp-write-timeout - [parameter] tcp-write-timeout +tcp-write-timeout Determines the timeout for TCP write operations in milliseconds. A timeout of {{#f}} disables timeout checking. The default write timeout is 60000, i.e. @@ -165,7 +165,7 @@ is thrown. === tcp-connect-timeout - [parameter] tcp-connect-timeout +tcp-connect-timeout Determines the timeout for {{tcp-connect}} operations in milliseconds. A timeout of {{#f}} disables timeout checking and is the default. @@ -175,7 +175,7 @@ is thrown. === tcp-accept-timeout - [parameter] tcp-accept-timeout +tcp-accept-timeout Determines the timeout for {{tcp-accept}} operations in milliseconds. A timeout of {{#f}} disables timeout checking and is the default. diff --git a/manual/Unit utils b/manual/Unit utils index 8e5b88e..f7622b9 100644 --- a/manual/Unit utils +++ b/manual/Unit utils @@ -15,7 +15,7 @@ This unit uses the {{extras}} and {{srfi-13}} units. ==== system* - [procedure] (system* FORMATSTRING ARGUMENT1 ...) +(system* FORMATSTRING ARGUMENT1 ...) Similar to {{(system (sprintf FORMATSTRING ARGUMENT1 ...))}}, but signals an error if the invoked program should return a nonzero @@ -25,7 +25,7 @@ exit status. ==== read-all - [procedure] (read-all [FILE-OR-PORT]) +(read-all [FILE-OR-PORT]) If {{FILE-OR-PORT}} is a string, then this procedure returns the contents of the file as a string. If {{FILE-OR-PORT}} is a port, all remaining input is read and returned as @@ -37,7 +37,7 @@ port that is the current value of {{(current-input-port)}}. ==== qs - [procedure] (qs STRING [PLATFORM]) +(qs STRING [PLATFORM]) Escapes {{STRING}} suitably for passing to a shell command on {{PLATFORM}}. {{PLATFORM}} defaults to the value of {{(build-platform)}} and indicates in diff --git a/manual/Using the interpreter b/manual/Using the interpreter index 04c09dc..fec1ab5 100644 --- a/manual/Using the interpreter +++ b/manual/Using the interpreter @@ -156,7 +156,7 @@ procedure: === toplevel-command - [procedure] (toplevel-command SYMBOL PROC [HELPSTRING]) +(toplevel-command SYMBOL PROC [HELPSTRING]) Defines or redefines a toplevel interpreter command which can be invoked by entering {{,SYMBOL}}. {{PROC}} will be invoked when the command is entered and may @@ -174,7 +174,7 @@ Note that the value returned is implicitly quoted. === set-describer! - [procedure] (set-describer! TAG PROC) +(set-describer! TAG PROC) Sets a custom description handler that invokes {{PROC}} when the {{,d}} command is invoked with a record-type object that has the type {{TAG}} (a symbol). {{PROC}} is called with -- 1.6.5.2 From fa21d86f15d9cec12f0d0b22a11b39e9d7f9dba2 Mon Sep 17 00:00:00 2001 Message-Id: In-Reply-To: References: From: zbigniew Date: Sat, 5 Dec 2009 23:29:37 -0600 Subject: Sync changes from wiki manual to core: SVN 16521-16552 Status: O Signed-off-by: zbigniew --- manual/Extensions | 4 +- manual/Non-standard macros and special forms | 34 +++++++--------------- manual/Unit files | 22 ++++----------- manual/Unit posix | 38 +++++++++++++++---------- 4 files changed, 42 insertions(+), 56 deletions(-) diff --git a/manual/Extensions b/manual/Extensions index f7bfdb9..2c3d4b0 100644 --- a/manual/Extensions +++ b/manual/Extensions @@ -81,7 +81,7 @@ script has to be in the root path of the archive. ==== install-extension - (install-extension ID FILELIST [INFOLIST]) +(install-extension ID FILELIST [INFOLIST]) Installs the extension library with the name {{ID}}. All files given in the list of strings {{FILELIST}} will be copied to the extension repository. It should be noted here that @@ -92,7 +92,7 @@ by the {{require-at-runtime}} property. {{FILELIST}} may be a filename, a list of filenames, or a list of pairs of the form {{(SOURCE DEST)}} (if you want to copy into a particular sub-directory - the destination directory will be created as needed). If {{DEST}} is a relative pathname, -< it will be copied into the extension repository. +it will be copied into the extension repository. The optional argument {{INFOLIST}} should be an association list that maps symbols to values, this list will be stored as {{ID.setup-info}} at the same diff --git a/manual/Non-standard macros and special forms b/manual/Non-standard macros and special forms index 43f9be8..6529beb 100644 --- a/manual/Non-standard macros and special forms +++ b/manual/Non-standard macros and special forms @@ -230,23 +230,14 @@ expression that evaluates to a parameter procedure. ==== receive -(receive (NAME1 ... [. NAMEn]) VALUEEXP BODY ...)
+(receive (NAME ...) VALUEEXP BODY ...)
+(receive (NAME1 ... NAMEn . NAMEn+1) VALUEEXP BODY ...)
(receive VALUEEXP) SRFI-8. Syntactic sugar for {{call-with-values}}. Binds variables to the result values of {{VALUEEXP}} and evaluates {{BODY ...}}. -The syntax - - -(receive VALUEEXP) - - -is equivalent to - - -(receive _ VALUEEXP _) - +{{(receive VALUEEXP)}} is equivalent to {{(receive _ VALUEEXP _)}}. ==== set!-values @@ -255,7 +246,6 @@ is equivalent to Assigns the result values of expression {{EXP}} to multiple variables. - === Substitution forms and macros ==== define-constant @@ -277,7 +267,8 @@ This for should only be used at top-level. ==== define-inline -(define-inline (NAME VAR ... [. VAR]) BODY ...)
+(define-inline (NAME VAR ...) BODY ...)
+(define-inline (NAME VAR1 ... VARn . VARn+1) BODY ...)
(define-inline NAME EXP) Defines an inline procedure. Any occurrence of {{NAME}} will be @@ -295,8 +286,8 @@ definitions should only appear at toplevel. ==== define-for-syntax -(define-for-syntax (NAME VAR ... [. VAR]) EXP1 ...)
-(define-for-syntax NAME [VALUE]) +(define-for-syntax (NAME VAR ...) EXP1 ...)
+(define-for-syntax (NAME VAR1 ... VARn . VARn+1) EXP1 ...)
Defines the toplevel variable {{NAME}} at macro-expansion time. This can be helpful when you want to define support procedures for use in macro-transformers, @@ -305,8 +296,8 @@ for example. ==== define-compiler-syntax - [syntax] (define-compiler-syntax NAME TRANSFORMER) - [syntax] (define-compiler-syntax (NAME VAR ...) BODY ...) +(define-compiler-syntax NAME TRANSFORMER)
+(define-compiler-syntax (NAME VAR ...) BODY ...) Defines what is usually called a ''compiler macro'': {{NAME}} should be the name of a globally or locally bound procedure. Any direct call to this procedure @@ -332,7 +323,7 @@ exported. ==== let-compiler-syntax - [syntax] (let-compiler-syntax ((NAME TRANSFORMER) ...) BODY ...) +(let-compiler-syntax ((NAME TRANSFORMER) ...) BODY ...) Allows definition local compiler macros, which are only applicable inside {{BODY ...}}. @@ -389,10 +380,7 @@ and updated using {{(NAME-SLOTNAME-set!}} {{STRUCT}} {{VALUE)}}. ==== define-record-type -(define-record-type NAME
- (CONSTRUCTOR TAG ...) - PREDICATE - (FIELD ACCESSOR [MODIFIER]) ...) +(define-record-type NAME (CONSTRUCTOR TAG ...) PREDICATE (FIELD ACCESSOR [MODIFIER]) ...) SRFI-9 record types. For more information see the documentation for [[http://srfi.schemers.org/srfi-9/srfi-9.html|SRFI-9]]. diff --git a/manual/Unit files b/manual/Unit files index 8657159..fdf399a 100644 --- a/manual/Unit files +++ b/manual/Unit files @@ -27,7 +27,7 @@ For any component that is not contained in {{PATHNAME}}, {{#f}} is returned. ==== make-pathname ==== make-absolute-pathname -(make-pathname DIRECTORY FILENAME [EXTENSION]) +(make-pathname DIRECTORY FILENAME [EXTENSION])
(make-absolute-pathname DIRECTORY FILENAME [EXTENSION]) Returns a string that names the file with the @@ -43,41 +43,31 @@ and {{EXTENSION}} should be strings or {{#f}}. The {{[SEPARATOR]}} argument is deprecated. ==== pathname-directory - -(pathname-directory PATHNAME) - ==== pathname-file - -(pathname-file PATHNAME) - ==== pathname-extension +(pathname-directory PATHNAME)
+(pathname-file PATHNAME)
(pathname-extension PATHNAME) Accessors for the components of {{PATHNAME}}. If the pathname does not contain the accessed component, then {{#f}} is returned. ==== pathname-replace-directory - -(pathname-replace-directory PATHNAME DIRECTORY) - ==== pathname-replace-file - -(pathname-replace-file PATHNAME FILENAME) - ==== pathname-replace-extension +(pathname-replace-directory PATHNAME DIRECTORY)
+(pathname-replace-file PATHNAME FILENAME)
(pathname-replace-extension PATHNAME EXTENSION) Return a new pathname with the specified component of {{PATHNAME}} replaced by a new value. ==== pathname-strip-directory - -(pathname-strip-directory PATHNAME) - ==== pathname-strip-extension +(pathname-strip-directory PATHNAME)
(pathname-strip-extension PATHNAME) Return a new pathname with the specified component of {{PATHNAME}} diff --git a/manual/Unit posix b/manual/Unit posix index 554a711..55993bb 100644 --- a/manual/Unit posix +++ b/manual/Unit posix @@ -118,7 +118,8 @@ Files beginning with {{.}} are included only if {{SHOW-DOTFILES?}} is given and (directory? NAME) Returns {{#t}} if there exists a file with the name {{NAME}} -and if that file is a directory, or {{#f}} otherwise. +and if that file is a directory or a symbolic link pointing +to a directory. Otherwise, it returns {{#f}}. ==== glob @@ -1066,24 +1067,31 @@ These variables contain error codes as returned by {{errno}}. (find-files DIRECTORY PREDICATE [ACTION [IDENTITY [LIMIT]]]) -Recursively traverses the contents of {{DIRECTORY}} (which should -be a string) and invokes the procedure {{ACTION}} for all files -in which the procedure {{PREDICATE}} is true. {{PREDICATE}} -may me a procedure of one argument or a regular-expression string. -{{ACTION}} should be a procedure of two arguments: the currently -encountered file and the result of the previous invocation of -{{ACTION}}, or, if this is the first invocation, the value -of {{IDENTITY}}. {{ACTION}} defaults to {{cons}}, -{{IDENTITY}} defaults to {{()}}. {{LIMIT}} should be a -procedure of one argument that is called for each nested directory -and which should return true, if that directory is to be traversed -recursively. {{LIMIT}} may also be an exact integer that -gives the maximum recursion depth. For example, a depth of {{0}} means that only files in the top-level, specified directory are to be traversed. In this case, all nested directories are ignored. {{LIMIT}} may also be {{#f}} (the default), -which is equivalent to {{(constantly #t)}}. +Recursively traverses the contents of {{DIRECTORY}} (which should be a +string) and invokes the procedure {{ACTION}} for all files in which +the procedure {{PREDICATE}} is true. {{PREDICATE}} may be a procedure +of one argument or a regular-expression string. {{ACTION}} should be +a procedure of two arguments: the currently encountered file and the +result of the previous invocation of {{ACTION}}, or, if this is the +first invocation, the value of {{IDENTITY}}. {{ACTION}} defaults to +{{cons}}, {{IDENTITY}} defaults to {{()}}. {{LIMIT}} should be a +procedure of one argument that is called for each nested directory and +which should return true, if that directory is to be traversed +recursively. {{LIMIT}} may also be an exact integer that gives the +maximum recursion depth. For example, a depth of {{0}} means that only +files in the top-level, specified directory are to be traversed. In +this case, all nested directories are ignored. {{LIMIT}} may also be +{{#f}} (the default), which is equivalent to {{(constantly #t)}}. Note that {{ACTION}} is called with the full pathname of each file, including the directory prefix. +Also note that {{find-files}} will traverse symbolic links pointing to +directories, which may lead to symlink loops or duplication of files. +To avoid traversing symlinks, you can pass something like this as the +{{LIMIT}} procedure: + + (lambda (x) (not (symbolic-link? x))) === Getting the hostname and system information -- 1.6.5.2