Changeset 9424 in project


Ignore:
Timestamp:
03/11/08 07:06:45 (12 years ago)
Author:
Ivan Raikov
Message:

Merged with trunk

Location:
chicken/branches/prerelease
Files:
12 edited

Legend:

Unmodified
Added
Removed
  • chicken/branches/prerelease/buildversion

    r9413 r9424  
    113.0.6
    2 
  • chicken/branches/prerelease/chicken.texi

    r9381 r9424  
    6464
    6565
    66 @emph{(This document describes version 3.0.5)}
    67 
    68 @b{CHICKEN is a compiler that translates Scheme source files into C}, which in turn can be fed to a C-compiler to generate a standalone executable.  An interpreter is also available and can be used as a scripting environment or for testing programs before compilation.
    69 
    70 This package is distributed under the @b{BSD license} and as such is free to use and modify.
    71 
    72 The method of compilation and the design of the runtime-system follow closely Henry Baker's @uref{http://home.pipeline.com/~hbaker1/CheneyMTA.html, CONS Should Not CONS Its Arguments, Part II: Cheney on the M.T.A.} paper and expose a number of interesting properties:
    73 
    74 @itemize
    75 @item Consing (creation of data on the heap) is relatively inexpensive, because a generational garbage collection scheme is used, in which short-lived data structures are reclaimed extremely quickly.
    76 
    77 @item Moreover, @code{call-with-current-continuation} is practically for free and CHICKEN does not suffer under any performance penalties if first-class continuations are used in complex ways.
    78 
    79 
    80 @end itemize
    81 The generated C code is fully tail-recursive.
    82 
    83 Some of the features supported by CHICKEN:
    84 
    85 @itemize
    86 @item SRFIs 0, 1, 2, 4, 6-19, 23, 25-31, 37-40, 42, 43, 45, 47, 55, 57, 60-63, 66, 69, 72, 78, 85 and 95.
    87 
    88 @item Lightweight threads based on first-class continuations
    89 
    90 @item Pattern matching with Andrew Wright's @code{match} package
    91 
    92 @item Record structures
    93 
    94 @item Extended comment- and string-literal syntaxes
    95 
    96 @item Libraries for regular expressions, string handling
    97 
    98 @item UNIX system calls and extended data structures
    99 
    100 @item Create interpreted or compiled shell scripts written in Scheme for UNIX or Windows
    101 
    102 @item Compiled C files can be easily distributed
    103 
    104 @item Allows the creation of fully self-contained statically linked executables
    105 
    106 @item On systems that support it, compiled code can be loaded dynamically
    107 
    108 
    109 @end itemize
    110 This manual is merely a reference for the CHICKEN system and assumes a working knowledge of Scheme.
    111 
    112 The manual is split in the following sections:
     66This is the user's manual for the Chicken Scheme compiler, version 3.0.6.
    11367
    11468@table @b
     69@item @ref{Overview, Overview}
     70
     71What is Chicken?
    11572@item @ref{Basic mode of operation, Basic mode of operation}
    11673
     
    29772934* Unit library - Arithmetic - Arithmetic fixnum operations::
    29782935* Unit library - Arithmetic - Arithmetic floating-point operations::
    2979 * Unit library - Arithmetic - flonum-print-precision::
    29802936* Unit library - Arithmetic - signum::
    29812937* Unit library - Arithmetic - finite?::
     
    31113067
    31123068@end table
    3113 @node Unit library - Arithmetic - Arithmetic floating-point operations, Unit library - Arithmetic - flonum-print-precision, Unit library - Arithmetic - Arithmetic fixnum operations, Unit library - Arithmetic
     3069@node Unit library - Arithmetic - Arithmetic floating-point operations, Unit library - Arithmetic - signum, Unit library - Arithmetic - Arithmetic fixnum operations, Unit library - Arithmetic
    31143070@subsection Arithmetic floating-point operations
    31153071
     
    31593115
    31603116@end table
    3161 @node Unit library - Arithmetic - flonum-print-precision, Unit library - Arithmetic - signum, Unit library - Arithmetic - Arithmetic floating-point operations, Unit library - Arithmetic
    3162 @subsection flonum-print-precision
    3163 
    3164 
    3165 @verbatim
    3166 [procedure] (flonum-print-precision [PRECISION])
    3167 @end verbatim
    3168 Gets and sets the number of significant digits printed for a floating-point number. @code{PRECISION} must be a positive @code{fixnum}. Always returns the setting in effect at the moment of invocation.
    3169 
    3170 @node Unit library - Arithmetic - signum, Unit library - Arithmetic - finite?, Unit library - Arithmetic - flonum-print-precision, Unit library - Arithmetic
     3117@node Unit library - Arithmetic - signum, Unit library - Arithmetic - finite?, Unit library - Arithmetic - Arithmetic floating-point operations, Unit library - Arithmetic
    31713118@subsection signum
    31723119
     
    47774724* Unit extras - String-port extensions::
    47784725* Unit extras - Formatted output::
    4779 * Unit extras - Hash Tables::
     4726* Unit extras - Hash tables::
    47804727* Unit extras - Queues::
    47814728* Unit extras - Sorting::
     
    47894736
    47904737
    4791 This unit contains a collection of useful utility definitions. This unit is used by default, unless the program is compiled with the @code{-explicit-use} option.
     4738This unit contains a collection of useful utility definitions.  This unit is used by default, unless the program is compiled with the @code{-explicit-use} option.
    47924739
    47934740@node Unit extras - Lists, Unit extras - String-port extensions,  , Unit extras
     
    49854932Call procedure @code{THUNK} with the current output-port temporarily bound to a string-output-port and return the accumulated output string.
    49864933
    4987 @node Unit extras - Formatted output, Unit extras - Hash Tables, Unit extras - String-port extensions, Unit extras
     4934@node Unit extras - Formatted output, Unit extras - Hash tables, Unit extras - String-port extensions, Unit extras
    49884935@section Formatted output
    49894936
     
    50294976The optional @code{DESTINATION}, when supplied, performs a (@code{sprintf}) for a  @code{#f}, a (@code{printf}) for a @code{#t}, and a (@code{fprintf}) for an output-port. When missing a (@code{sprintf}) is performed.
    50304977
    5031 @node Unit extras - Hash Tables, Unit extras - Queues, Unit extras - Formatted output, Unit extras
    5032 @section Hash Tables
    5033 
    5034 @menu
    5035 * Unit extras - Hash Tables - make-hash-table::
    5036 * Unit extras - Hash Tables - hash-table-min-load::
    5037 * Unit extras - Hash Tables - hash-table-max-load::
    5038 * Unit extras - Hash Tables - hash-table-weak-keys::
    5039 * Unit extras - Hash Tables - hash-table-weak-values::
    5040 * Unit extras - Hash Tables - hash-table-has-initial::
    5041 * Unit extras - Hash Tables - hash-table-initial::
    5042 * Unit extras - Hash Tables - hash-table-update!::
    5043 * Unit extras - Hash Tables - hash-table-update!/default::
    5044 * Unit extras - Hash Tables - hash-table-remove!::
    5045 * Unit extras - Hash Tables - hash-table-merge::
    5046 * Unit extras - Hash Tables - hash-table-map::
    5047 * Unit extras - Hash Tables - hash-table-for-each::
    5048 * Unit extras - Hash Tables - number-hash::
    5049 * Unit extras - Hash Tables - object-uid-hash::
    5050 * Unit extras - Hash Tables - symbol-hash::
    5051 * Unit extras - Hash Tables - keyword-hash::
    5052 * Unit extras - Hash Tables - eq?-hash::
    5053 * Unit extras - Hash Tables - eqv?-hash::
    5054 * Unit extras - Hash Tables - equal?-hash::
    5055 
    5056 @end menu
    5057 
    5058 
    5059 CHICKEN implements an extended SRFI-69. For more information, see @uref{http://srfi.schemers.org/srfi-69/srfi-69.html, SRFI-69} and @uref{http://srfi.schemers.org/srfi-69/srfi-90.html, SRFI-90}.
     4978@node Unit extras - Hash tables, Unit extras - Queues, Unit extras - Formatted output, Unit extras
     4979@section Hash tables
     4980
     4981@menu
     4982* Unit extras - Hash tables - hash-table-remove!::
     4983
     4984@end menu
     4985
     4986
     4987CHICKEN implements SRFI-69. For more information,  see @uref{http://srfi.schemers.org/srfi-69/srfi-69.html, SRFI-69}.
    50604988
    50614989A setter for @code{hash-table-ref} is defined, so
     
    50694997(hash-table-set! HT KEY VAL)
    50704998@end example
    5071 @node Unit extras - Hash Tables - make-hash-table, Unit extras - Hash Tables - hash-table-min-load,  , Unit extras - Hash Tables
    5072 @subsection make-hash-table
    5073 
    5074 
    5075 @verbatim
    5076 [procedure] (make-hash-table [TEST [HASH [SIZE]]] [#:TEST #:HASH #:SIZE #:INITIAL #:MIN-LOAD #:MAX-LOAD #:WEAK-KEYS #:WEAK-VALUES])
    5077 @end verbatim
    5078 The SRFI-69 procedure is extended:
    5079 
    5080 Returns a new @code{HASH-TABLE}, parameterized as follows:
    5081 
    5082 @code{TEST} is a procedure of one argument, @code{(object -> boolean)}; an equality predicate. The first argument is a @code{KEY}.
    5083 
    5084 @code{HASH} is a procedure of two arguments, @code{(object (fixnum positive) -> (fixnum (<= 0 _ _2)))}; a bounded hash function, where the returned hash value is in @code{[0 BOUND)}. The first argument is a @code{KEY} and the second argument is the @code{BOUND}.
    5085 
    5086 @code{SIZE} is a @code{fixnum}; the initial size of the hash-table.
    5087 
    5088 @code{INITIAL} is an @code{object}; the default initial value for any @code{KEY}.
    5089 
    5090 @code{MIN-LOAD} is a @code{flonum} in @code{(0.0 1.0)}; the lower bound for resizing the table.
    5091 
    5092 @code{MAX-LOAD} is a @code{flonum} in @code{(0.0 1.0)}; the upper bound for resizing the table.
    5093 
    5094 @code{WEAK-KEYS} is a @code{boolean}; always @code{#f} (until further notice).
    5095 
    5096 @code{WEAK-VALUES} is a @code{boolean}; always @code{#f} (until further notice).
    5097 
    5098 Keyword arguments take precedence over optional arguments when both are specified.
    5099 
    5100 @node Unit extras - Hash Tables - hash-table-min-load, Unit extras - Hash Tables - hash-table-max-load, Unit extras - Hash Tables - make-hash-table, Unit extras - Hash Tables
    5101 @subsection hash-table-min-load
    5102 
    5103 
    5104 @verbatim
    5105 [procedure] (hash-table-min-load HASH-TABLE)
    5106 @end verbatim
    5107 Returns the @code{MIN-LOAD} property of the @code{HASH-TABLE}.
    5108 
    5109 @node Unit extras - Hash Tables - hash-table-max-load, Unit extras - Hash Tables - hash-table-weak-keys, Unit extras - Hash Tables - hash-table-min-load, Unit extras - Hash Tables
    5110 @subsection hash-table-max-load
    5111 
    5112 
    5113 @verbatim
    5114 [procedure] (hash-table-max-load HASH-TABLE)
    5115 @end verbatim
    5116 Returns the @code{MAX-LOAD} property of the @code{HASH-TABLE}.
    5117 
    5118 @node Unit extras - Hash Tables - hash-table-weak-keys, Unit extras - Hash Tables - hash-table-weak-values, Unit extras - Hash Tables - hash-table-max-load, Unit extras - Hash Tables
    5119 @subsection hash-table-weak-keys
    5120 
    5121 
    5122 @verbatim
    5123 [procedure] (hash-table-weak-keys HASH-TABLE)
    5124 @end verbatim
    5125 Returns the @code{WEAK-KEYS} property of the @code{HASH-TABLE}.
    5126 
    5127 @node Unit extras - Hash Tables - hash-table-weak-values, Unit extras - Hash Tables - hash-table-has-initial, Unit extras - Hash Tables - hash-table-weak-keys, Unit extras - Hash Tables
    5128 @subsection hash-table-weak-values
    5129 
    5130 
    5131 @verbatim
    5132 [procedure] (hash-table-weak-values HASH-TABLE)
    5133 @end verbatim
    5134 Returns the @code{WEAK-VALUES} property of the @code{HASH-TABLE}.
    5135 
    5136 @node Unit extras - Hash Tables - hash-table-has-initial, Unit extras - Hash Tables - hash-table-initial, Unit extras - Hash Tables - hash-table-weak-values, Unit extras - Hash Tables
    5137 @subsection hash-table-has-initial
    5138 
    5139 
    5140 @verbatim
    5141 [procedure] (hash-table-has-initial HASH-TABLE)
    5142 @end verbatim
    5143 Does the @code{HASH-TABLE} have an @code{INITIAL} property.
    5144 
    5145 @node Unit extras - Hash Tables - hash-table-initial, Unit extras - Hash Tables - hash-table-update!, Unit extras - Hash Tables - hash-table-has-initial, Unit extras - Hash Tables
    5146 @subsection hash-table-initial
    5147 
    5148 
    5149 @verbatim
    5150 [procedure] (hash-table-initial HASH-TABLE)
    5151 @end verbatim
    5152 Returns the @code{INITIAL} property of the @code{HASH-TABLE}.
    5153 
    5154 @node Unit extras - Hash Tables - hash-table-update!, Unit extras - Hash Tables - hash-table-update!/default, Unit extras - Hash Tables - hash-table-initial, Unit extras - Hash Tables
    5155 @subsection hash-table-update!
    5156 
    5157 
    5158 @verbatim
    5159 [procedure] (hash-table-update! HASH-TABLE KEY [FUNCTION [THUNK]])
    5160 @end verbatim
    5161 The SRFI-69 procedure is extended:
    5162 
    5163 @code{FUNCTION} is optional. The default is @code{identity}.
    5164 
    5165 @code{THUNK} is optional. The default is @code{(lambda () (hash-table-initial HASH-TABLE))}; when the @code{HASH-TABLE} has no initial value an error is signaled.
    5166 
    5167 Returns the new value, after the update.
    5168 
    5169 @node Unit extras - Hash Tables - hash-table-update!/default, Unit extras - Hash Tables - hash-table-remove!, Unit extras - Hash Tables - hash-table-update!, Unit extras - Hash Tables
    5170 @subsection hash-table-update!/default
    5171 
    5172 
    5173 @verbatim
    5174 [procedure] (hash-table-update!/default HASH-TABLE KEY FUNCTION DEFAULT)
    5175 @end verbatim
    5176 The SRFI-69 procedure is extended:
    5177 
    5178 Returns the new value, after the update.
    5179 
    5180 @node Unit extras - Hash Tables - hash-table-remove!, Unit extras - Hash Tables - hash-table-merge, Unit extras - Hash Tables - hash-table-update!/default, Unit extras - Hash Tables
     4999As an extension to SRFI-69, @code{hash-table-update!} and @code{hash-table-update!/default} return the new value (after applying the update procedure).
     5000
     5001@node Unit extras - Hash tables - hash-table-remove!,  ,  , Unit extras - Hash tables
    51815002@subsection hash-table-remove!
    51825003
    51835004
    51845005@verbatim
    5185 [procedure] (hash-table-remove! HASH-TABLE PROC)
    5186 @end verbatim
    5187 Calls @code{PROC} for all entries in @code{HASH-TABLE} with the key and value of each entry. If @code{PROC} returns true, then that entry is removed.
    5188 
    5189 @node Unit extras - Hash Tables - hash-table-merge, Unit extras - Hash Tables - hash-table-map, Unit extras - Hash Tables - hash-table-remove!, Unit extras - Hash Tables
    5190 @subsection hash-table-merge
    5191 
    5192 
    5193 @verbatim
    5194 [procedure] (hash-table-merge HASH-TABLE-1 HASH-TABLE-2)
    5195 @end verbatim
    5196 Returns a new @code{hash-table}, the merged result of @code{HASH-TABLE-1} & @code{HASH-TABLE-2}.
    5197 
    5198 @node Unit extras - Hash Tables - hash-table-map, Unit extras - Hash Tables - hash-table-for-each, Unit extras - Hash Tables - hash-table-merge, Unit extras - Hash Tables
    5199 @subsection hash-table-map
    5200 
    5201 
    5202 @verbatim
    5203 [procedure] (hash-table-map HASH-TABLE PROC)
    5204 @end verbatim
    5205 Calls @code{PROC} for all entries in @code{HASH-TABLE} with the key and value of each entry.
    5206 
    5207 @code{PROC} is a procedure of 2 arguments, @code{(object object -> object)}; the first argument is the @code{KEY}, and the second argument is the @code{VALUE}. The return value is collected in a list.
    5208 
    5209 Returns the list collection.
    5210 
    5211 @node Unit extras - Hash Tables - hash-table-for-each, Unit extras - Hash Tables - number-hash, Unit extras - Hash Tables - hash-table-map, Unit extras - Hash Tables
    5212 @subsection hash-table-for-each
    5213 
    5214 
    5215 @verbatim
    5216 [procedure] (hash-table-for-each HASH-TABLE PROC)
    5217 @end verbatim
    5218 Calls @code{PROC} for all entries in @code{HASH-TABLE} with the key and value of each entry.
    5219 
    5220 @code{PROC} is a procedure of 2 arguments, @code{(object object -> unspecified)}; the first argument is the @code{KEY}, and the second argument is the @code{VALUE}.
    5221 
    5222 No return value.
    5223 
    5224 A synonym for @code{hash-table-walk}.
    5225 
    5226 @node Unit extras - Hash Tables - number-hash, Unit extras - Hash Tables - object-uid-hash, Unit extras - Hash Tables - hash-table-for-each, Unit extras - Hash Tables
    5227 @subsection number-hash
    5228 
    5229 
    5230 @verbatim
    5231 [procedure] (number-hash NUMBER [BOUND])
    5232 @end verbatim
    5233 Returns a hash value for the @code{NUMBER}, with optional @code{BOUND}.
    5234 
    5235 @node Unit extras - Hash Tables - object-uid-hash, Unit extras - Hash Tables - symbol-hash, Unit extras - Hash Tables - number-hash, Unit extras - Hash Tables
    5236 @subsection object-uid-hash
    5237 
    5238 
    5239 @verbatim
    5240 [procedure] (object-uid-hash OBJECT [BOUND])
    5241 @end verbatim
    5242 Returns a hash value for the @code{OBJECT}, with optional @code{BOUND}.
    5243 
    5244 Currently this is a synonym for @code{equal?-hash}.
    5245 
    5246 @node Unit extras - Hash Tables - symbol-hash, Unit extras - Hash Tables - keyword-hash, Unit extras - Hash Tables - object-uid-hash, Unit extras - Hash Tables
    5247 @subsection symbol-hash
    5248 
    5249 
    5250 @verbatim
    5251 [procedure] (symbol-hash SYMBOL [BOUND])
    5252 @end verbatim
    5253 Returns a hash value for the @code{SYMBOL}, with optional @code{BOUND}.
    5254 
    5255 @node Unit extras - Hash Tables - keyword-hash, Unit extras - Hash Tables - eq?-hash, Unit extras - Hash Tables - symbol-hash, Unit extras - Hash Tables
    5256 @subsection keyword-hash
    5257 
    5258 
    5259 @verbatim
    5260 [procedure] (keyword-hash KEYWORD [BOUND])
    5261 @end verbatim
    5262 Returns a hash value for the @code{KEYWORD}, with optional @code{BOUND}.
    5263 
    5264 @node Unit extras - Hash Tables - eq?-hash, Unit extras - Hash Tables - eqv?-hash, Unit extras - Hash Tables - keyword-hash, Unit extras - Hash Tables
    5265 @subsection eq?-hash
    5266 
    5267 
    5268 @verbatim
    5269 [procedure] (eq?-hash OBJECT [BOUND])
    5270 @end verbatim
    5271 Returns a hash value for the @code{OBJECT}, with optional @code{BOUND}.
    5272 
    5273 For use with @code{eq?} as @code{TEST}.
    5274 
    5275 @code{hash-by-identity} is a synonym.
    5276 
    5277 Uses @code{object-uid-hash} for non-immediate, non-symbol objects.
    5278 
    5279 @node Unit extras - Hash Tables - eqv?-hash, Unit extras - Hash Tables - equal?-hash, Unit extras - Hash Tables - eq?-hash, Unit extras - Hash Tables
    5280 @subsection eqv?-hash
    5281 
    5282 
    5283 @verbatim
    5284 [procedure] (eqv?-hash OBJECT [BOUND])
    5285 @end verbatim
    5286 Returns a hash value for the @code{OBJECT}, with optional @code{BOUND}.
    5287 
    5288 For use with @code{eqv?} as @code{TEST}.
    5289 
    5290 Uses @code{object-uid-hash} for non-immediate, non-number, non-symbol objects.
    5291 
    5292 @node Unit extras - Hash Tables - equal?-hash,  , Unit extras - Hash Tables - eqv?-hash, Unit extras - Hash Tables
    5293 @subsection equal?-hash
    5294 
    5295 
    5296 @verbatim
    5297 [procedure] (equal?-hash OBJECT [BOUND])
    5298 @end verbatim
    5299 Returns a hash value for the @code{OBJECT}, with optional @code{BOUND}.
    5300 
    5301 For use with @code{equal?} as @code{TEST}.
    5302 
    5303 @code{hash} is a synonym.
    5304 
    5305 @node Unit extras - Queues, Unit extras - Sorting, Unit extras - Hash Tables, Unit extras
     5006[procedure] (hash-table-remove! HASHTABLE PROC)
     5007@end verbatim
     5008Calls @code{PROC} for all entries in @code{HASHTABLE} with the key and value of each entry. If @code{PROC} returns true, then that entry is removed.
     5009
     5010@node Unit extras - Queues, Unit extras - Sorting, Unit extras - Hash tables, Unit extras
    53065011@section Queues
    53075012
     
    54655170
    54665171@menu
     5172* Unit extras - Random numbers - random-seed::
    54675173* Unit extras - Random numbers - random::
    54685174* Unit extras - Random numbers - randomize::
     
    54715177
    54725178
    5473 @node Unit extras - Random numbers - random, Unit extras - Random numbers - randomize,  , Unit extras - Random numbers
     5179@node Unit extras - Random numbers - random-seed, Unit extras - Random numbers - random,  , Unit extras - Random numbers
     5180@subsection random-seed
     5181
     5182
     5183@verbatim
     5184[procedure] (random-seed [SEED])
     5185@end verbatim
     5186Seeds the random number generator with @code{SEED} (an exact integer) or  @code{(current-seconds)} if @code{SEED} is not given.
     5187
     5188@node Unit extras - Random numbers - random, Unit extras - Random numbers - randomize, Unit extras - Random numbers - random-seed, Unit extras - Random numbers
    54745189@subsection random
    54755190
     
    55695284[procedure] (read-file [FILE-OR-PORT [READER [MAXCOUNT]]])
    55705285@end verbatim
    5571 Returns a list containing all toplevel expressions read from the file or port @code{FILE-OR-PORT}. If no argument is given, input is read from the port that is the current value of @code{(current-input-port)}. After all expressions are read, and if the argument is a port, then the port will not be closed. The @code{READER} argument specifies the procedure used to read expressions from the given file or port and defaults to @code{read}. The reader procedure will be called with a single argument (an input port). If @code{MAXCOUNT} is given then only up to @code{MAXCOUNT} expressions will be read in.
     5286Returns a list containing all toplevel expressions read from the file or port @code{FILE-OR-PORT}. If no argument is given, input is read from the port that is the current value of @code{(current-input-port)}. After all expressions are read, and if the argument is a port, then the port will not be closed. The @code{READER} argument specifies the procedure used to read  expressions from the given file or port and defaults to @code{read}. The reader procedure will be called with a single argument (an input port). If @code{MAXCOUNT} is given then only up to @code{MAXCOUNT} expressions will be read in.
    55725287
    55735288@node Unit extras - Input/Output extensions - read-line, Unit extras - Input/Output extensions - write-line, Unit extras - Input/Output extensions - read-file, Unit extras - Input/Output extensions
     
    56115326[procedure] (write-string STRING [NUM [PORT]]
    56125327@end verbatim
    5613 Read or write @code{NUM} characters from/to @code{PORT}, which defaults to the value of @code{(current-input-port)} or @code{(current-output-port)}, respectively. If @code{NUM} is @code{#f} or not given, then all data up to the end-of-file is read, or, in the case of @code{write-string} the whole string is written. If no more input is available, @code{read-string} returns the empty string. @code{read-string!} reads destructively into the given @code{STRING} argument, but never more characters that would fit into @code{STRING}. If @code{START} is given, then the read characters are stored starting at that position. @code{read-string!} returns the actual number of characters read.
     5328Read or write @code{NUM} characters from/to @code{PORT}, which defaults to the value of @code{(current-input-port)} or @code{(current-output-port)}, respectively.  If @code{NUM} is @code{#f} or not given, then all data up to the end-of-file is read, or, in the case of @code{write-string} the whole string is written. If no more input is available, @code{read-string} returns the empty string. @code{read-string!} reads destructively into the given @code{STRING} argument, but never more characters that would fit into @code{STRING}. If @code{START} is given, then the read characters are stored starting at that position. @code{read-string!} returns the actual number of characters read.
    56145329
    56155330@node Unit extras - Input/Output extensions - read-token, Unit extras - Input/Output extensions - with-error-output-to-port, Unit extras - Input/Output extensions - write-string, Unit extras - Input/Output extensions
     
    57455460[procedure] (string-split STRING [DELIMITER-STRING [KEEPEMPTY]])
    57465461@end verbatim
    5747 Split string into substrings separated by the given delimiters. If no delimiters are specified, a string comprising the tab, newline and space characters is assumed. If the parameter @code{KEEPEMPTY} is given and not @code{#f}, then empty substrings are retained:
     5462Split string into substrings separated by the given delimiters. If no delimiters are specified, a string comprising the tab, newline and space characters  is assumed. If the parameter @code{KEEPEMPTY} is given and not @code{#f}, then empty substrings are retained:
    57485463
    57495464@example
     
    57735488  @strong{"<h1>this is a \"string\"</h1>"}
    57745489  '((@strong{"<"} . @strong{"&lt;"}) (@strong{">"} . @strong{"&gt;"}) (@strong{"\""} . @strong{"&quot;"})) )
    5775 @strong{=>}  @strong{"&lt;h1&gt;this is a &quot;string&quot;&lt;/ht&gt;"}
     5490@strong{=>}  @strong{"&lt;h1&gt;this is a &quot;string&quot;&lt;/h1&gt;"}
    57765491@end example
    57775492@node Unit extras - Strings - substring=?, Unit extras - Strings - substring-index, Unit extras - Strings - string-translate*, Unit extras - Strings
     
    58005515@menu
    58015516* Unit extras - Combinators - any?::
    5802 * Unit extras - Combinators - none?::
    5803 * Unit extras - Combinators - always?::
    5804 * Unit extras - Combinators - never?::
    58055517* Unit extras - Combinators - constantly::
    58065518* Unit extras - Combinators - complement::
     
    58155527* Unit extras - Combinators - noop::
    58165528* Unit extras - Combinators - o::
    5817 * Unit extras - Combinators - left-section::
    5818 * Unit extras - Combinators - right-section::
    5819 
    5820 @end menu
    5821 
    5822 
    5823 @node Unit extras - Combinators - any?, Unit extras - Combinators - none?,  , Unit extras - Combinators
     5529
     5530@end menu
     5531
     5532
     5533@node Unit extras - Combinators - any?, Unit extras - Combinators - constantly,  , Unit extras - Combinators
    58245534@subsection any?
    58255535
     
    58305540Ignores its argument and always returns @code{#t}. This is actually useful sometimes.
    58315541
    5832 @node Unit extras - Combinators - none?, Unit extras - Combinators - always?, Unit extras - Combinators - any?, Unit extras - Combinators
    5833 @subsection none?
    5834 
    5835 
    5836 @verbatim
    5837 [procedure] (none? X)
    5838 @end verbatim
    5839 Ignores its argument and always returns @code{#f}. This is actually useful sometimes.
    5840 
    5841 @node Unit extras - Combinators - always?, Unit extras - Combinators - never?, Unit extras - Combinators - none?, Unit extras - Combinators
    5842 @subsection always?
    5843 
    5844 
    5845 @verbatim
    5846 [procedure] (always? X ...)
    5847 @end verbatim
    5848 Ignores its arguments and always returns @code{#t}. This is actually useful sometimes.
    5849 
    5850 @node Unit extras - Combinators - never?, Unit extras - Combinators - constantly, Unit extras - Combinators - always?, Unit extras - Combinators
    5851 @subsection never?
    5852 
    5853 
    5854 @verbatim
    5855 [procedure] (never? X ...)
    5856 @end verbatim
    5857 Ignores its arguments and always returns @code{#f}. This is actually useful sometimes.
    5858 
    5859 @node Unit extras - Combinators - constantly, Unit extras - Combinators - complement, Unit extras - Combinators - never?, Unit extras - Combinators
     5542@node Unit extras - Combinators - constantly, Unit extras - Combinators - complement, Unit extras - Combinators - any?, Unit extras - Combinators
    58605543@subsection constantly
    58615544
     
    59395622
    59405623@example
    5941 (@strong{lambda} args
     5624(@strong{lambda} args 
    59425625  (apply pp args)
    59435626  (apply eval args) )
     
    59975680Ignores it's arguments, does nothing and returns an unspecified value.
    59985681
    5999 @node Unit extras - Combinators - o, Unit extras - Combinators - left-section, Unit extras - Combinators - noop, Unit extras - Combinators
     5682@node Unit extras - Combinators - o,  , Unit extras - Combinators - noop, Unit extras - Combinators
    60005683@subsection o
    60015684
     
    60055688@end verbatim
    60065689A single value version of @code{compose} (slightly faster). @code{(o)} is equivalent to @code{identity}.
    6007 
    6008 @node Unit extras - Combinators - left-section, Unit extras - Combinators - right-section, Unit extras - Combinators - o, Unit extras - Combinators
    6009 @subsection left-section
    6010 
    6011 
    6012 @verbatim
    6013 [procedure] (left-section PROC ARG ...)
    6014 @end verbatim
    6015 A left section partially applies arguments starting from the left.
    6016 
    6017 Returns a variadic procedure in which some prefix of its arguments, @code{ARG ...}, are partially applied to @code{PROC}.
    6018 
    6019 @node Unit extras - Combinators - right-section,  , Unit extras - Combinators - left-section, Unit extras - Combinators
    6020 @subsection right-section
    6021 
    6022 
    6023 @verbatim
    6024 [procedure] (right-section PROC ARG ...)
    6025 @end verbatim
    6026 A right section partially applies arguments starting from the right.
    6027 
    6028 Returns a variadic procedure in which some reversed suffix of its arguments, @code{ARG ...}, are partially applied to @code{PROC}.
    60295690
    60305691@node Unit extras - Binary searching,  , Unit extras - Combinators, Unit extras
     
    64216082* Unit regex - glob->regexp::
    64226083* Unit regex - glob?::
    6423 * Unit regex - regex-chardef-table?::
    6424 * Unit regex - regex-chardef-table::
    64256084* Unit regex - regexp::
    64266085* Unit regex - regexp*::
     
    64406099
    64416100
    6442 This library unit provides support for regular expressions. The regular expression package used is @code{PCRE} (@emph{Perl Compatible Regular Expressions}) written by Philip Hazel. See @uref{http://www.pcre.org, http://www.pcre.org} for information about the particular regexp flavor and extensions provided by this library.
     6101This library unit provides support for regular expressions. The regular  expression package used is @code{PCRE} (@emph{Perl Compatible Regular Expressions}) written by Philip Hazel. See @uref{http://www.pcre.org, http://www.pcre.org} for information about the particular regexp flavor and extensions provided by this library.
    64436102
    64446103To test that PCRE support has been built into Chicken properly, try:
     
    64466105@example
    64476106(require 'regex)
    6448 (test-feature? 'pcre) @strong{=>} #t
     6107(test-feature? 'pcre) @strong{=>} t
    64496108@end example
    64506109@node Unit regex - grep, Unit regex - glob->regexp,  , Unit regex
     
    64836142?
    64846143@end verbatim
    6485 @node Unit regex - glob?, Unit regex - regex-chardef-table?, Unit regex - glob->regexp, Unit regex
     6144@node Unit regex - glob?, Unit regex - regexp, Unit regex - glob->regexp, Unit regex
    64866145@section glob?
    64876146
     
    64946153A string without any "glob" wildcards does not meet the criteria, even though it technically is a valid "glob" file-pattern.
    64956154
    6496 @node Unit regex - regex-chardef-table?, Unit regex - regex-chardef-table, Unit regex - glob?, Unit regex
    6497 @section regex-chardef-table?
    6498 
    6499 
    6500 @verbatim
    6501 [procedure] (regex-chardef-table? OBJECT)
    6502 @end verbatim
    6503 Returns @code{#t} if the @code{OBJECT} is a @code{character definitions table}, and @code{#f} otherwise.
    6504 
    6505 @node Unit regex - regex-chardef-table, Unit regex - regexp, Unit regex - regex-chardef-table?, Unit regex
    6506 @section regex-chardef-table
    6507 
    6508 
    6509 @verbatim
    6510 [procedure] (regex-chardef-table)
    6511 @end verbatim
    6512 Returns a new @code{character definitions table}.
    6513 
    6514 @node Unit regex - regexp, Unit regex - regexp*, Unit regex - regex-chardef-table, Unit regex
     6155@node Unit regex - regexp, Unit regex - regexp*, Unit regex - glob?, Unit regex
    65156156@section regexp
    65166157
     
    65246165@section regexp*
    65256166
    6526 @menu
    6527 * Unit regex - regexp* - Option Symbols;::
    6528 
    6529 @end menu
    6530 
    6531 
    6532 @verbatim
    6533 [procedure] (regexp* STRING [OPTIONS [CHARDEFS-TABLE]])
    6534 @end verbatim
    6535 Returns a precompiled regular expression object for @code{string}. The optional argument @code{OPTIONS} must be a list of option symbols. The optional argument @code{CHARDEFS-TABLE} must be a character definitions table.
    6536 
    6537 @node Unit regex - regexp* - Option Symbols;,  ,  , Unit regex - regexp*
    6538 @subsection Option Symbols:
    6539 
     6167
     6168@verbatim
     6169[procedure] (regexp* STRING [OPTIONS [TABLES]])
     6170@end verbatim
     6171Returns a precompiled regular expression object for @code{string}. The optional argument @code{OPTIONS} must be a list of option symbols. The optional argument @code{TABLES} must be a character definitions table (not defined here).
     6172
     6173Option Symbols:
    65406174
    65416175@table @b
     
    66386272@verbatim
    66396273[procedure] (regexp-optimize RX)
     6274
    66406275@end verbatim
    66416276Perform available optimizations for the precompiled regular expression @code{RX}. Returns @code{#t} when optimization performed, and @code{#f} otherwise.
     
    66906325
    66916326(string-split-fields @strong{","} s #:suffix)
    6692 
     6327 
    66936328  @strong{=>} (@strong{"this is a string 1"} @strong{" 2"} @strong{" 3"})
    66946329@end example
     
    67006335[procedure] (string-substitute REGEXP SUBST STRING [MODE])
    67016336@end verbatim
    6702 Searches substrings in @code{STRING} that match @code{REGEXP} and substitutes them with the string @code{SUBST}. The substitution can contain references to subexpressions in @code{REGEXP} with the @code{\NUM} notation, where @code{NUM} refers to the NUMth parenthesized expression. The optional argument @code{MODE} defaults to 1 and specifies the number of the match to be substituted. Any non-numeric index specifies that all matches are to be substituted.
     6337Searches substrings in @code{STRING} that match @code{REGEXP} and substitutes them with the string @code{SUBST}. The substitution can contain references to subexpressions in  @code{REGEXP} with the @code{\NUM} notation, where @code{NUM} refers to the NUMth parenthesized expression. The optional argument @code{MODE} defaults to 1 and specifies the number of the match to be substituted. Any non-numeric index specifies that all matches are to be substituted.
    67036338
    67046339@example
     
    71516786* Unit posix - Directories - directory?::
    71526787* Unit posix - Directories - glob::
     6788* Unit posix - Directories - canonical-path::
    71536789* Unit posix - Directories - set-root-directory!::
    71546790
     
    72106846Returns @code{#t} if there exists a file with the name @code{NAME} and if that file is a directory, or @code{#f} otherwise.
    72116847
    7212 @node Unit posix - Directories - glob, Unit posix - Directories - set-root-directory!, Unit posix - Directories - directory?, Unit posix - Directories
     6848@node Unit posix - Directories - glob, Unit posix - Directories - canonical-path, Unit posix - Directories - directory?, Unit posix - Directories
    72136849@subsection glob
    72146850
     
    72196855Returns a list of the pathnames of all existing files matching @code{PATTERN1 ...}, which should be strings containing the usual file-patterns (with @code{*} matching zero or more characters and @code{?} matching zero or one character).
    72206856
    7221 @node Unit posix - Directories - set-root-directory!,  , Unit posix - Directories - glob, Unit posix - Directories
     6857@node Unit posix - Directories - canonical-path, Unit posix - Directories - set-root-directory!, Unit posix - Directories - glob, Unit posix - Directories
     6858@subsection canonical-path
     6859
     6860
     6861@verbatim
     6862[procedure] (canonical-path NAME)
     6863@end verbatim
     6864Returns a canonical path for @code{NAME}, which should be a string containing a path-or-filename.  The string returned by  @code{canonical-path} is OS dependent; it may be quoted and used in a shell on the calling machine. (Quoting is suggested as shell special characters, including space, are not escaped.)  However, all path separators and prefixes are handled in an OS independent fashion.  Any appearance of @code{/} below imply @code{\\} is also handled.
     6865
     6866The prefix for @code{NAME} determines what path to prepend.  If @code{NAME} begins with a @code{"~/"}, this prefix is stripped and the user's  home directory is added.  If beginning with @code{/} or a DRIVE-LETTER:\\ combination, no additional path is added.  Otherwise, the current directory and separator are added.  All relative path elements and duplicate separators are processed and removed.  If @code{NAME} ends with a @code{/} or is empty, the appropriate slash is appended to the tail.
     6867
     6868No directories or files are actually tested for existence; this  procedure only canonicalises path syntax.
     6869
     6870@node Unit posix - Directories - set-root-directory!,  , Unit posix - Directories - canonical-path, Unit posix - Directories
    72226871@subsection set-root-directory!
    72236872
     
    75077156* Unit posix - Retrieving file attributes - file-write-access?::
    75087157* Unit posix - Retrieving file attributes - file-execute-access?::
     7158* Unit posix - Retrieving file attributes - stat-regular?::
     7159* Unit posix - Retrieving file attributes - stat-directory?::
     7160* Unit posix - Retrieving file attributes - stat-char-device?::
     7161* Unit posix - Retrieving file attributes - stat-block-device?::
     7162* Unit posix - Retrieving file attributes - stat-fifo?::
     7163* Unit posix - Retrieving file attributes - stat-symlink?::
     7164* Unit posix - Retrieving file attributes - stat-socket?::
    75097165
    75107166@end menu
     
    75927248
    75937249
    7594 @node Unit posix - Retrieving file attributes - file-execute-access?,  , Unit posix - Retrieving file attributes - file-write-access?, Unit posix - Retrieving file attributes
     7250@node Unit posix - Retrieving file attributes - file-execute-access?, Unit posix - Retrieving file attributes - stat-regular?, Unit posix - Retrieving file attributes - file-write-access?, Unit posix - Retrieving file attributes
    75957251@subsection file-execute-access?
    75967252
     
    76027258@end verbatim
    76037259These procedures return @code{#t} if the current user has read, write or execute permissions on the file named @code{FILENAME}.
     7260
     7261@node Unit posix - Retrieving file attributes - stat-regular?, Unit posix - Retrieving file attributes - stat-directory?, Unit posix - Retrieving file attributes - file-execute-access?, Unit posix - Retrieving file attributes
     7262@subsection stat-regular?
     7263
     7264
     7265@node Unit posix - Retrieving file attributes - stat-directory?, Unit posix - Retrieving file attributes - stat-char-device?, Unit posix - Retrieving file attributes - stat-regular?, Unit posix - Retrieving file attributes
     7266@subsection stat-directory?
     7267
     7268
     7269@node Unit posix - Retrieving file attributes - stat-char-device?, Unit posix - Retrieving file attributes - stat-block-device?, Unit posix - Retrieving file attributes - stat-directory?, Unit posix - Retrieving file attributes
     7270@subsection stat-char-device?
     7271
     7272
     7273@node Unit posix - Retrieving file attributes - stat-block-device?, Unit posix - Retrieving file attributes - stat-fifo?, Unit posix - Retrieving file attributes - stat-char-device?, Unit posix - Retrieving file attributes
     7274@subsection stat-block-device?
     7275
     7276
     7277@node Unit posix - Retrieving file attributes - stat-fifo?, Unit posix - Retrieving file attributes - stat-symlink?, Unit posix - Retrieving file attributes - stat-block-device?, Unit posix - Retrieving file attributes
     7278@subsection stat-fifo?
     7279
     7280
     7281@node Unit posix - Retrieving file attributes - stat-symlink?, Unit posix - Retrieving file attributes - stat-socket?, Unit posix - Retrieving file attributes - stat-fifo?, Unit posix - Retrieving file attributes
     7282@subsection stat-symlink?
     7283
     7284
     7285@node Unit posix - Retrieving file attributes - stat-socket?,  , Unit posix - Retrieving file attributes - stat-symlink?, Unit posix - Retrieving file attributes
     7286@subsection stat-socket?
     7287
     7288
     7289@verbatim
     7290[procedure] (stat-regular? FILENAME)
     7291[procedure] (stat-directory? FILENAME)
     7292[procedure] (stat-char-device? FILENAME)
     7293[procedure] (stat-block-device? FILENAME)
     7294[procedure] (stat-fifo? FILENAME)
     7295[procedure] (stat-symlink? FILENAME)
     7296[procedure] (stat-socket? FILENAME)
     7297@end verbatim
     7298These procedures return @code{#t} if the @code{FILENAME} given is of the  appropriate type.
    76047299
    76057300@node Unit posix - Changing file attributes, Unit posix - Processes, Unit posix - Retrieving file attributes, Unit posix
     
    83458040* Unit posix - Date and time routines - utc-time->seconds::
    83468041* Unit posix - Date and time routines - time->string::
    8347 * Unit posix - Date and time routines - string->time::
    83488042
    83498043@end menu
     
    84378131Converts the ten-element vector @code{VECTOR} representing the UTC time value into the number of seconds since the first of January, 1970 UTC.
    84388132
    8439 @node Unit posix - Date and time routines - time->string, Unit posix - Date and time routines - string->time, Unit posix - Date and time routines - utc-time->seconds, Unit posix - Date and time routines
     8133@node Unit posix - Date and time routines - time->string,  , Unit posix - Date and time routines - utc-time->seconds, Unit posix - Date and time routines
    84408134@subsection time->string
    84418135
    84428136
    84438137@verbatim
    8444 [procedure] (time->string VECTOR [FORMAT])
    8445 @end verbatim
    8446 Without a @code{FORMAT} string converts the broken out time represented in the 10 element vector @code{VECTOR} into a string of the form @code{"Tue May 21 13:46:22 1991"}.
    8447 
    8448 Otherwise returns the time as a string formatted per the @code{FORMAT} string.
    8449 
    8450 See the @code{strftime} C procedure for a specification of the @code{FORMAT} string.
    8451 
    8452 @node Unit posix - Date and time routines - string->time,  , Unit posix - Date and time routines - time->string, Unit posix - Date and time routines
    8453 @subsection string->time
    8454 
    8455 
    8456 @verbatim
    8457 [procedure] (string->time STRING [FORMAT])
    8458 @end verbatim
    8459 Returns the time string parsed per the @code{FORMAT} string as a broken out time 10 element vector.
    8460 
    8461 The default @code{FORMAT} string is @code{"%a %b %e %H:%M:%S %Z %Y"}. (The default @code{date} command format.)
    8462 
    8463 See the @code{strptime} C procedure for a specification of the @code{FORMAT} string.
     8138[procedure] (time->string VECTOR)
     8139@end verbatim
     8140Converts the broken down time represented in the 10 element vector @code{VECTOR} into a string of the form @code{"Tue May 21 13:46:22 1991"}.
    84648141
    84658142@node Unit posix - Raw exit, Unit posix - ERRNO values, Unit posix - Date and time routines, Unit posix
     
    86788355* Unit posix - Terminal ports - terminal-name::
    86798356* Unit posix - Terminal ports - terminal-port?::
    8680 * Unit posix - Terminal ports - terminal-size::
    86818357
    86828358@end menu
     
    86928368Returns the name of the terminal that is connected to @code{PORT}.
    86938369
    8694 @node Unit posix - Terminal ports - terminal-port?, Unit posix - Terminal ports - terminal-size, Unit posix - Terminal ports - terminal-name, Unit posix - Terminal ports
     8370@node Unit posix - Terminal ports - terminal-port?,  , Unit posix - Terminal ports - terminal-name, Unit posix - Terminal ports
    86958371@subsection terminal-port?
    86968372
     
    87008376@end verbatim
    87018377Returns @code{#t} if @code{PORT} is connected to a terminal and @code{#f} otherwise.
    8702 
    8703 @node Unit posix - Terminal ports - terminal-size,  , Unit posix - Terminal ports - terminal-port?, Unit posix - Terminal ports
    8704 @subsection terminal-size
    8705 
    8706 
    8707 @verbatim
    8708 [procedure] (terminal-size PORT)
    8709 @end verbatim
    8710 Returns two values: The height and width of the terminal connected to @code{PORT}.
    87118378
    87128379@node Unit posix - How Scheme procedures relate to UNIX C functions, Unit posix - Windows specific notes, Unit posix - Terminal ports, Unit posix
     
    87148381
    87158382
    8716 <table> <tr><td> change-directory chdir </td></tr><tr><td> change-file-mode chmod </td></tr><tr><td> change-file-owner chown </td></tr><tr><td> create-directory mkdir </td></tr><tr><td> create-fifo mkfifo </td></tr><tr><td> create-pipe pipe </td></tr><tr><td> create-session setsid </td></tr><tr><td> create-symbolic-link link </td></tr><tr><td> current-directory curdir </td></tr><tr><td> current-effective-groupd-id getegid </td></tr><tr><td> current-effective-user-id geteuid </td></tr><tr><td> current-group-id getgid </td></tr><tr><td> current-parent-id getppid </td></tr><tr><td> current-process-id getpid </td></tr><tr><td> current-user-id getuid </td></tr><tr><td> delete-directory rmdir </td></tr><tr><td> duplicate-fileno dup/dup2 </td></tr><tr><td> _exit _exit </td></tr><tr><td> file-close close </td></tr><tr><td> file-access-time stat </td></tr><tr><td> file-change-time stat </td></tr><tr><td> file-modification-time stat </td></tr><tr><td> file-execute-access? access </td></tr><tr><td> file-open open </td></tr><tr><td> file-lock fcntl </td></tr><tr><td> file-position ftell/lseek </td></tr><tr><td> file-read read </td></tr><tr><td> file-read-access? access </td></tr><tr><td> file-select select </td></tr><tr><td> file-control fcntl </td></tr><tr><td> file-stat stat </td></tr><tr><td> file-test-lock fcntl </td></tr><tr><td> file-truncate truncate/ftruncate </td></tr><tr><td> file-unlock fcntl </td></tr><tr><td> file-write write </td></tr><tr><td> file-write-access? access </td></tr><tr><td> get-groups getgroups </td></tr><tr><td> get-host-name gethostname </td></tr><tr><td> initialize-groups initgroups </td></tr><tr><td> local-time->seconds mktime </td></tr><tr><td> local-timezone-abbreviation localtime </td></tr><tr><td> map-file-to-memory mmap </td></tr><tr><td> open-input-file* fdopen </td></tr><tr><td> open-output-file* fdopen </td></tr><tr><td> open-input-pipe popen </td></tr><tr><td> open-output-pipe popen </td></tr><tr><td> port->fileno fileno </td></tr><tr><td> process-execute execvp </td></tr><tr><td> process-fork fork </td></tr><tr><td> process-group-id getpgid </td></tr><tr><td> process-signal kill </td></tr><tr><td> process-wait waitpid </td></tr><tr><td> close-input-pipe pclose </td></tr><tr><td> close-output-pipe pclose </td></tr><tr><td> read-symbolic-link readlink </td></tr><tr><td> seconds->local-time localtime </td></tr><tr><td> seconds->string ctime </td></tr><tr><td> seconds->utc-time gmtime </td></tr><tr><td> set-alarm! alarm </td></tr><tr><td> set-buffering-mode! setvbuf </td></tr><tr><td> set-file-position! fseek/seek </td></tr><tr><td> set-groups! setgroups </td></tr><tr><td> set-signal-mask! sigprocmask </td></tr><tr><td> set-group-id! setgid </td></tr><tr><td> set-process-group-id! setpgid </td></tr><tr><td> set-user-id! setuid </td></tr><tr><td> set-root-directory! chroot </td></tr><tr><td> setenv setenv/putenv </td></tr><tr><td> sleep sleep </td></tr><tr><td> system-information uname </td></tr><tr><td> terminal-name ttyname </td></tr><tr><td> terminal-port? isatty </td></tr><tr><td> time->string asctime </td></tr><tr><td> unsetenv putenv </td></tr><tr><td> unmap-file-from-memory munmap </td></tr><tr><td> user-information getpwnam/getpwuid </td></tr><tr><td> utc-time->seconds timegm </td></tr></table>
    8717 
     8383@table @b
     8384@item @code{change-directory}
     8385
     8386@code{chdir}
     8387@item @code{change-file-mode}
     8388
     8389@code{chmod}
     8390@item @code{change-file-owner}
     8391
     8392@code{chown}
     8393@item @code{create-directory}
     8394
     8395@code{mkdir}
     8396@item @code{create-fifo}
     8397
     8398@code{mkfifo}
     8399@item @code{create-pipe}
     8400
     8401@code{pipe}
     8402@item @code{create-session}
     8403
     8404@code{setsid}
     8405@item @code{create-symbolic-link}
     8406
     8407@code{link}
     8408@item @code{current-directory}
     8409
     8410@code{curdir}
     8411@item @code{current-effective-groupd-id}
     8412
     8413@code{getegid}
     8414@item @code{current-effective-user-id}
     8415
     8416@code{geteuid}
     8417@item @code{current-group-id}
     8418
     8419@code{getgid}
     8420@item @code{current-parent-id}
     8421
     8422@code{getppid}
     8423@item @code{current-process-id}
     8424
     8425@code{getpid}
     8426@item @code{current-user-id}
     8427
     8428@code{getuid}
     8429@item @code{delete-directory}
     8430
     8431@code{rmdir}
     8432@item @code{duplicate-fileno}
     8433
     8434@code{dup/dup2}
     8435@item @code{_exit}
     8436
     8437@code{_exit}
     8438@item @code{file-close}
     8439
     8440@code{close}
     8441@item @code{file-access-time}
     8442
     8443@code{stat}
     8444@item @code{file-change-time}
     8445
     8446@code{stat}
     8447@item @code{file-modification-time}
     8448
     8449@code{stat}
     8450@item @code{file-execute-access?}
     8451
     8452@code{access}
     8453@item @code{file-open}
     8454
     8455@code{open}
     8456@item @code{file-lock}
     8457
     8458@code{fcntl}
     8459@item @code{file-position}
     8460
     8461@code{ftell/lseek}
     8462@item @code{file-read}
     8463
     8464@code{read}
     8465@item @code{file-read-access?}
     8466
     8467@code{access}
     8468@item @code{file-select}
     8469
     8470@code{select}
     8471@item @code{file-control}
     8472
     8473@code{fcntl}
     8474@item @code{file-stat}
     8475
     8476@code{stat}
     8477@item @code{file-test-lock}
     8478
     8479@code{fcntl}
     8480@item @code{file-truncate}
     8481
     8482@code{truncate/ftruncate}
     8483@item @code{file-unlock}
     8484
     8485@code{fcntl}
     8486@item @code{file-write}
     8487
     8488@code{write}
     8489@item @code{file-write-access?}
     8490
     8491@code{access}
     8492@item @code{get-groups}
     8493
     8494@code{getgroups}
     8495@item @code{get-host-name}
     8496
     8497@code{gethostname}
     8498@item @code{initialize-groups}
     8499
     8500@code{initgroups}
     8501@item @code{local-time->seconds}
     8502
     8503@code{mktime}
     8504@item @code{local-timezone-abbreviation}
     8505
     8506@code{localtime}
     8507@item @code{map-file-to-memory}
     8508
     8509@code{mmap}
     8510@item @code{open-input-file*}
     8511
     8512@code{fdopen}
     8513@item @code{open-output-file*}
     8514
     8515@code{fdopen}
     8516@item @code{open-input-pipe}
     8517
     8518@code{popen}
     8519@item @code{open-output-pipe}
     8520
     8521@code{popen}
     8522@item @code{port->fileno}
     8523
     8524@code{fileno}
     8525@item @code{process-execute}
     8526
     8527@code{execvp}
     8528@item @code{process-fork}
     8529
     8530@code{fork}
     8531@item @code{process-group-id}
     8532
     8533@code{getpgid}
     8534@item @code{process-signal}
     8535
     8536@code{kill}
     8537@item @code{process-wait}
     8538
     8539@code{waitpid}
     8540@item @code{close-input-pipe}
     8541
     8542@code{pclose}
     8543@item @code{close-output-pipe}
     8544
     8545@code{pclose}
     8546@item @code{read-symbolic-link}
     8547
     8548@code{readlink}
     8549@item @code{seconds->local-time}
     8550
     8551@code{localtime}
     8552@item @code{seconds->string}
     8553
     8554@code{ctime}
     8555@item @code{seconds->utc-time}
     8556
     8557@code{gmtime}
     8558@item @code{set-alarm!}
     8559
     8560@code{alarm}
     8561@item @code{set-buffering-mode!}
     8562
     8563@code{setvbuf}
     8564@item @code{set-file-position!}
     8565
     8566@code{fseek/seek}
     8567@item @code{set-groups!}
     8568
     8569@code{setgroups}
     8570@item @code{set-signal-mask!}
     8571
     8572@code{sigprocmask}
     8573@item @code{set-group-id!}
     8574
     8575@code{setgid}
     8576@item @code{set-process-group-id!}
     8577
     8578@code{setpgid}
     8579@item @code{set-user-id!}
     8580
     8581@code{setuid}
     8582@item @code{set-root-directory!}
     8583
     8584@code{chroot}
     8585@item @code{setenv}
     8586
     8587@code{setenv/putenv}
     8588@item @code{sleep}
     8589
     8590@code{sleep}
     8591@item @code{system-information}
     8592
     8593@code{uname}
     8594@item @code{terminal-name}
     8595
     8596@code{ttyname}
     8597@item @code{terminal-port?}
     8598
     8599@code{isatty}
     8600@item @code{time->string}
     8601
     8602@code{asctime}
     8603@item @code{unsetenv}
     8604
     8605@code{putenv}
     8606@item @code{unmap-file-from-memory}
     8607
     8608@code{munmap}
     8609@item @code{user-information}
     8610
     8611@code{getpwnam/getpwuid}
     8612@item @code{utc-time->seconds}
     8613
     8614@code{timegm}
     8615
     8616@end table
    87188617@node Unit posix - Windows specific notes,  , Unit posix - How Scheme procedures relate to UNIX C functions, Unit posix
    87198618@section Windows specific notes
     
    87808679map-file-to-memory  unmap-file-from-memory  memory-mapped-file-pointer  memory-mapped-file?
    87818680set-alarm!
    8782 terminal-port?  terminal-name terminal-size
     8681terminal-port?  terminal-name
    87838682process-fork  process-signal
    87848683parent-process-id
    87858684set-root-directory!
    87868685utc-time->seconds
    8787 string->time
    87888686@end verbatim
    87898687@node Unit posix - Windows specific notes - Additional Definitions, Unit posix - Windows specific notes - process-spawn, Unit posix - Windows specific notes - Unsupported Definitions, Unit posix - Windows specific notes
     
    1045610354@verbatim
    1045710355
    10458 (TYPENAME-SLOTNAME-set! FOREIGN-RECORD-POINTER [INXDEX] VALUE)
     10356(TYPENAME-SLOTNAME-set! FOREIGN-RECORD-POINTER [INDEX] VALUE)
    1045910357@end verbatim
    1046010358A procedure of two arguments (a pointer to a C structure) and a value, that sets the slot value of the slot @code{SLOTNAME} in the structure. If a @code{SIZE} has been given in the slot definition, then an additional argument @code{INDEX} is required for the array index.
     
    1200211900* chicken-setup - Procedures and macros available in setup scripts - try-compile::
    1200311901* chicken-setup - Procedures and macros available in setup scripts - create-directory::
     11902* chicken-setup - Procedures and macros available in setup scripts - chicken-prefix::
    1200411903* chicken-setup - Procedures and macros available in setup scripts - installation-prefix::
    1200511904* chicken-setup - Procedures and macros available in setup scripts - program-path::
     
    1222512124Returns @code{#t} if the C code in @code{CODE} compiles and links successfully, or @code{#f} otherwise. The keyword parameters @code{cc} (compiler name, defaults to the C compiler used to build this system), @code{cflags} and @code{ldflags} accept additional compilation and linking options. If @code{compile-only} is true, then no linking step takes place. If the keyword argument @code{c++} is given and true, then the code will be compiled in C++ mode.
    1222612125
    12227 @node chicken-setup - Procedures and macros available in setup scripts - create-directory, chicken-setup - Procedures and macros available in setup scripts - installation-prefix, chicken-setup - Procedures and macros available in setup scripts - try-compile, chicken-setup - Procedures and macros available in setup scripts
     12126@node chicken-setup - Procedures and macros available in setup scripts - create-directory, chicken-setup - Procedures and macros available in setup scripts - chicken-prefix, chicken-setup - Procedures and macros available in setup scripts - try-compile, chicken-setup - Procedures and macros available in setup scripts
    1222812127@subsection create-directory
    1222912128
     
    1223412133Creates the directory given in the string @code{PATH}, with all parent directories as needed.
    1223512134
    12236 @node chicken-setup - Procedures and macros available in setup scripts - installation-prefix, chicken-setup - Procedures and macros available in setup scripts - program-path, chicken-setup - Procedures and macros available in setup scripts - create-directory, chicken-setup - Procedures and macros available in setup scripts
     12135@node chicken-setup - Procedures and macros available in setup scripts - chicken-prefix, chicken-setup - Procedures and macros available in setup scripts - installation-prefix, chicken-setup - Procedures and macros available in setup scripts - create-directory, chicken-setup - Procedures and macros available in setup scripts
     12136@subsection chicken-prefix
     12137
     12138
     12139@verbatim
     12140[parameter] chicken-prefix
     12141@end verbatim
     12142The installation prefix specified when CHICKEN was built.
     12143
     12144@node chicken-setup - Procedures and macros available in setup scripts - installation-prefix, chicken-setup - Procedures and macros available in setup scripts - program-path, chicken-setup - Procedures and macros available in setup scripts - chicken-prefix, chicken-setup - Procedures and macros available in setup scripts
    1223712145@subsection installation-prefix
    1223812146
     
    1224112149[parameter] installation-prefix
    1224212150@end verbatim
    12243 Holds the prefix under which CHICKEN executables and libraries have been installed (either the value of the environment variable @code{CHICKEN_PREFIX} or whatever prefix was specified at the time the system was built.
     12151An alternative installation prefix that will be prepended to extension installation paths if specified. It is set by the @code{-install-prefix} option or environment variable @code{CHICKEN_INSTALL_PREFIX}.
    1224412152
    1224512153@node chicken-setup - Procedures and macros available in setup scripts - program-path, chicken-setup - Procedures and macros available in setup scripts - setup-root-directory, chicken-setup - Procedures and macros available in setup scripts - installation-prefix, chicken-setup - Procedures and macros available in setup scripts
     
    1254912457
    1255012458Fetch extension from local file
    12551 @item @code{-destdir PATHNAME}
     12459@item @code{-install-prefix PATHNAME}
    1255212460
    1255312461Specify alternative installation prefix (for packaging)
     
    1255512463
    1255612464Compile extension in "host" mode (sets the parameter @code{host-extension} to @code{#f})
     12465@item @code{-build-prefix PATHNAME}
     12466
     12467Location where chicken-setup will create egg build directories  (default: the value of environment variable CHICKEN_TMPDIR, or @code{/tmp/chicken-@{MAJOR-VERSION-build-@{USER}@}@})
     12468@item @code{-download-path PATHNAME}
     12469
     12470Location where chicken-setup will save downloaded files  (default: @code{build-prefix/downloads})
    1255712471@item @code{--}
    1255812472
     
    1276412678@menu
    1276512679* FAQ - General - Why yet another Scheme implementation?::
     12680* FAQ - General - Why call it 'Chicken'?::
    1276612681* FAQ - General - What should I do if I find a bug?::
    1276712682* FAQ - General - Why are values defined with define-foreign-variable or define-constant or define-inline not seen outside of the containing source file?::
     
    1277912694
    1278012695
    12781 @node FAQ - General - Why yet another Scheme implementation?, FAQ - General - What should I do if I find a bug?,  , FAQ - General
     12696@node FAQ - General - Why yet another Scheme implementation?, FAQ - General - Why call it 'Chicken'?,  , FAQ - General
    1278212697@subsection Why yet another Scheme implementation?
    1278312698
     
    1279812713
    1279912714@end itemize
    12800 @node FAQ - General - What should I do if I find a bug?, FAQ - General - Why are values defined with define-foreign-variable or define-constant or define-inline not seen outside of the containing source file?, FAQ - General - Why yet another Scheme implementation?, FAQ - General
     12715@node FAQ - General - Why call it 'Chicken'?, FAQ - General - What should I do if I find a bug?, FAQ - General - Why yet another Scheme implementation?, FAQ - General
     12716@subsection Why call it 'Chicken'?
     12717
     12718
     12719According to @uref{http://chicken.wiki.br/felix winkelmann, felix}:
     12720
     12721@quotation
     12722Well, it's pretty boring, really: when I started the project and needed some name, the first thing that met my eyes was the "chicken" (actually a disguised penguin)  from the Wallace + Gromit movie... And then there is of course the ever occurring chicken-and-egg problem with bootstrapped compilers.
     12723
     12724
     12725@end quotation
     12726@node FAQ - General - What should I do if I find a bug?, FAQ - General - Why are values defined with define-foreign-variable or define-constant or define-inline not seen outside of the containing source file?, FAQ - General - Why call it 'Chicken'?, FAQ - General
    1280112727@subsection What should I do if I find a bug?
    1280212728
    1280312729
    12804 Send e-mail to @uref{mailto:chicken-janitors@@nongnu.org, chicken-janitors@@nongnu.org} (preferably using the @code{chicken-bug(1)} tool) with some hints about the problem, like version/build of the compiler, platform, system configuration, code that causes the bug, etc.
     12730Send e-mail to @uref{mailto:felix@@call-with-current-continuation.org, felix@@call-with-current-continuation.org} with some hints about the problem, like version/build of the compiler, platform, system configuration, code that causes the bug, etc.
    1280512731
    1280612732@node FAQ - General - Why are values defined with define-foreign-variable or define-constant or define-inline not seen outside of the containing source file?, FAQ - General - How does cond-expand know which features are registered in used units?, FAQ - General - What should I do if I find a bug?, FAQ - General
     
    1285912785- Dispatching of arithmetic operations is more efficient.
    1286012786
    12861 There is an extension based on the GNU Multiprecision Package that implements most of the full numeric tower, see @uref{http://chicken.wiki.br/numbers, http://chicken.wiki.br/numbers}.
     12787There is an extension based on the GNU Multiprecision Package that implements most of the full numeric tower, see @uref{http://chicken.wiki.br/numbers, numbers}.
    1286212788
    1286312789@node FAQ - General - How can I specialize a generic function method to match instances of every class?, FAQ - General - Does CHICKEN support native threads?, FAQ - General - Why doesn't CHICKEN support the full numeric tower by default?, FAQ - General
     
    1335813284
    1335913285
    13360 Many thanks to Nico Amtsberg, William Annis, Marc Baily, Peter Barabas, Jonah Beckford, Arto Bendiken, Peter Bex, Jean-Francois Bignolles, Alaric Blagrave-Snellpym, Dave Bodenstab, Fabian Boehlke, T. Kurt Bond, Ashley Bone, Dominique Boucher, Terence Brannon, Roy Bryant, Adam Buchbinder, Hans Bulfone, Category 5, Taylor Campbell, Naruto Canada, Esteban U. Caamano Castro, Franklin Chen, Thomas Chust, Gian Paolo Ciceri, John Cowan, Grzegorz Chrupa&#322;a, James Crippen, Tollef Fog Heen, Alejandro Forero Cuervo, Linh Dang, Brian Denheyer, dgym, Don, Chris Double, Jarod Eells, Petter Egesund, Steve Elkins, Daniel B. Faken, Will Farr, Graham Fawcett, Marc Feeley, Fizzie, Kimura Fuyuki, Tony Garnock-Jones, Martin Gasbichler, Joey Gibson, Stephen C. Gilardi, Joshua Griffith, Johannes Groedem, Damian Gryski, Mario Domenech Goulart, Andreas Gustafsson, Sven Hartrumpf, Jun-ichiro itojun Hagino, Ahdi Hargo, Matthias Heiler, Karl M. Hegbloom, William P. Heinemann, Bill Hoffman, Bruce Hoult, Hans Huebner, Markus Huelsmann, Goetz Isenmann, Andrei Ivushkin, Paulo Jabardo, David Janssens, Christian Jaeger, Dale Jordan, Valentin Kamyshenko, Daishi Kato, Peter Keller, Brad Kind, Ron Kneusel, Matthias Koeppe, Krysztof Kowa&#322;czyk, Andre Kuehne, Todd R. Kueny Sr, Goran Krampe, David Krentzlin, Ben Kurtz, Micky Latowicki, John Lenz, Kirill Lisovsky, Juergen Lorenz, Kon Lovett, Dennis Marti, Charles Martin, Bob McIsaac, Alain Mellan, Eric Merrit, Perry Metzger, Scott G. Miller, Mikael, Bruce Mitchener, Chris Moline, Eric E. Moore, Julian Morrison, Dan Muresan, Lars Nilsson, Ian Oversby, o.t., Gene Pavlovsky, Levi Pearson, Nicolas Pelletier, Carlos Pita, Robin Lee Powell, Pupeno, Davide Puricelli, Doug Quale, Eric Raible, Ivan Raikov, Joel Reymont, Eric Rochester, Andreas Rottman, David Rush, Lars Rustemeier, Daniel Sadilek, Oskar Schirmer, Burton Samograd, Reed Sheridan, Ronald Schroeder, Spencer Schumann, Alex Shinn, Ivan Shmakov, Shmul, Tony Sidaway, Jeffrey B. Siegal, Andrey Sidorenko, Michele Simionato, Volker Stolz, Jon Strait, Dorai Sitaram, Robert Skeels, Jason Songhurst, Clifford Stein, Sunnan, Zbigniew Szadkowski, Rick Taube, Mike Thomas, Minh Thu, Christian Tismer, Andre van Tonder, John Tobey, Henrik Tramberend, Vladimir Tsichevsky, Neil van Dyke, Sander Vesik, Jaques Vidrine, Panagiotis Vossos, Shawn Wagner, Peter Wang, Ed Watkeys, Brad Watson, Thomas Weidner, Goeran Weinholt, Matthew Welland, Joerg Wittenberger, Peter Wright, Mark Wutka, Richard Zidlicky and Houman Zolfaghari for bug-fixes, tips and suggestions.
     13286Many thanks to Nico Amtsberg, William Annis, Marc Baily, Peter Barabas, Jonah Beckford, Arto Bendiken, Peter Bex, Jean-Francois Bignolles, Alaric Blagrave-Snellpym, Dave Bodenstab, Fabian Boehlke, T. Kurt Bond, Ashley Bone, Dominique Boucher, Terence Brannon, Roy Bryant, Adam Buchbinder, Hans Bulfone, Category 5, Taylor Campbell, Naruto Canada, Esteban U. Caamano Castro, Franklin Chen, Thomas Chust, Gian Paolo Ciceri, John Cowan, Grzegorz Chrupa&#322;a, James Crippen, Tollef Fog Heen, Alejandro Forero Cuervo, Linh Dang, Brian Denheyer, dgym, Don, Chris Double, Jarod Eells, Petter Egesund, Steve Elkins, Daniel B. Faken, Will Farr, Graham Fawcett, Marc Feeley, Fizzie, Kimura Fuyuki, Tony Garnock-Jones, Martin Gasbichler, Joey Gibson, Stephen C. Gilardi, Joshua Griffith, Johannes Groedem, Damian Gryski, Mario Domenech Goulart, Andreas Gustafsson, Sven Hartrumpf, Jun-ichiro itojun Hagino, Ahdi Hargo, Matthias Heiler, Karl M. Hegbloom, William P. Heinemann, Bill Hoffman, Bruce Hoult, Hans Huebner, Markus Huelsmann, Goetz Isenmann, Paulo Jabardo, David Janssens, Christian Jaeger, Dale Jordan, Valentin Kamyshenko, Daishi Kato, Peter Keller, Brad Kind, Ron Kneusel, Matthias Koeppe, Krysztof Kowa&#322;czyk, Andre Kuehne, Todd R. Kueny Sr, Goran Krampe, David Krentzlin, Ben Kurtz, Micky Latowicki, John Lenz, Kirill Lisovsky, Juergen Lorenz, Kon Lovett, Dennis Marti, Charles Martin, Bob McIsaac, Alain Mellan, Eric Merrit, Perry Metzger, Scott G. Miller, Mikael, Bruce Mitchener, Chris Moline, Eric E. Moore, Julian Morrison, Dan Muresan, Lars Nilsson, Ian Oversby, o.t., Gene Pavlovsky, Levi Pearson, Nicolas Pelletier, Carlos Pita, Robin Lee Powell, Pupeno, Davide Puricelli, Doug Quale, Eric Raible, Ivan Raikov, Joel Reymont, Eric Rochester, Andreas Rottman, David Rush, Lars Rustemeier, Daniel Sadilek, Oskar Schirmer, Burton Samograd, Reed Sheridan, Ronald Schroeder, Spencer Schumann, Alex Shinn, Ivan Shmakov, Shmul, Tony Sidaway, Jeffrey B. Siegal, Andrey Sidorenko, Michele Simionato, Volker Stolz, Jon Strait, Dorai Sitaram, Robert Skeels, Jason Songhurst, Clifford Stein, Sunnan, Zbigniew Szadkowski, Rick Taube, Mike Thomas, Minh Thu, Christian Tismer, Andre van Tonder, John Tobey, Henrik Tramberend, Vladimir Tsichevsky, Neil van Dyke, Sander Vesik, Jaques Vidrine, Panagiotis Vossos, Shawn Wagner, Peter Wang, Ed Watkeys, Brad Watson, Thomas Weidner, Goeran Weinholt, Matthew Welland, Joerg Wittenberger, Peter Wright, Mark Wutka, Richard Zidlicky and Houman Zolfaghari for bug-fixes, tips and suggestions.
    1336113287
    1336213288CHICKEN uses the PCRE regular expression package (@uref{http://www.pcre.org, http://www.pcre.org}), which is written by Philip Hazel.
     
    1339513321
    1339613322pattern matcher.
    13397 @item Alex Shinn
     13323@item @uref{http://chicken.wiki.br/Alex Shinn, Alex Shinn}
    1339813324
    1339913325@code{scheme-complete.el} emacs tab-completion
  • chicken/branches/prerelease/manual/Accessing external objects

    r6691 r9424  
    138138==== TYPENAME-SLOTNAME-set!
    139139 
    140  (TYPENAME-SLOTNAME-set! FOREIGN-RECORD-POINTER [INXDEX] VALUE)
     140 (TYPENAME-SLOTNAME-set! FOREIGN-RECORD-POINTER [INDEX] VALUE)
    141141
    142142A procedure of two arguments (a pointer to a C structure) and a value, that
  • chicken/branches/prerelease/manual/Acknowledgements

    r9381 r9424  
    1818itojun Hagino, Ahdi Hargo, Matthias Heiler, Karl M. Hegbloom, William
    1919P. Heinemann, Bill Hoffman, Bruce Hoult, Hans Huebner, Markus
    20 Huelsmann, Goetz Isenmann, Andrei Ivushkin, Paulo Jabardo, David Janssens, Christian
     20Huelsmann, Goetz Isenmann, Paulo Jabardo, David Janssens, Christian
    2121Jaeger, Dale Jordan, Valentin Kamyshenko, Daishi Kato, Peter Keller,
    2222Brad Kind, Ron Kneusel, Matthias Koeppe, Krysztof Kowa&#322;czyk,
     
    6363; Andrew Wilcox : queues.
    6464; Andrew Wright : pattern matcher.
    65 ; [[Alex Shinn]] : {{scheme-complete.el}} emacs tab-completion
     65; [[http://chicken.wiki.br/Alex Shinn|Alex Shinn]] : {{scheme-complete.el}} emacs tab-completion
    6666
    6767Previous: [[FAQ]]
  • chicken/branches/prerelease/manual/Locations

    r6691 r9424  
    7171</enscript>
    7272
    73 See [[location-and-c-string-star|location and c-string*]] for a tip on returning a {{c-string*}} type.
     73See [[http://chicken.wiki.br/location-and-c-string-star|location and c-string*]] for a tip on returning a {{c-string*}} type.
    7474
    7575{{location}} returns a value of type {{c-pointer}}, when given
  • chicken/branches/prerelease/manual/The User's Manual

    r9381 r9424  
    33== The User's Manual
    44
    5 ''(This document describes version 3.0.5)''
     5This is the user's manual for the Chicken Scheme compiler, version 3.0.6.
    66
    7 '''CHICKEN is a compiler that translates Scheme source files into C''', which in
    8 turn can be fed to a C-compiler to generate a standalone executable.
    9 An interpreter is also available and can be used as
    10 a scripting environment or for testing programs before compilation.
    11 
    12 This package is distributed under the '''BSD license''' and as such is free
    13 to use and modify.
    14 
    15 The method of compilation and the design of the runtime-system follow
    16 closely Henry Baker's [[http://home.pipeline.com/~hbaker1/CheneyMTA.html|CONS Should Not CONS Its Arguments, Part II: Cheney on the M.T.A.]] paper and expose a number of interesting
    17 properties:
    18 
    19 * Consing (creation of data on the heap) is relatively inexpensive, because a generational garbage collection scheme is used, in which short-lived data structures are reclaimed extremely quickly.
    20 
    21 * Moreover, {{call-with-current-continuation}} is practically for free and CHICKEN does not suffer under any performance penalties if first-class continuations are used in complex ways.
    22 
    23 The generated C code is fully tail-recursive.
    24 
    25 Some of the features supported by CHICKEN:
    26 
    27 * SRFIs 0, 1, 2, 4, 6-19, 23, 25-31, 37-40, 42, 43, 45, 47, 55, 57, 60-63, 66, 69, 72, 78, 85 and 95.
    28 * Lightweight threads based on first-class continuations
    29 * Pattern matching with Andrew Wright's {{match}} package
    30 * Record structures
    31 * Extended comment- and string-literal syntaxes
    32 * Libraries for regular expressions, string handling
    33 * UNIX system calls and extended data structures
    34 * Create interpreted or compiled shell scripts written in Scheme for UNIX or Windows
    35 * Compiled C files can be easily distributed
    36 * Allows the creation of fully self-contained statically linked executables
    37 * On systems that support it, compiled code can be loaded dynamically
    38 
    39 This manual is merely a reference for the CHICKEN system and assumes
    40 a working knowledge of Scheme.
    41 
    42 The manual is split in the following sections:
     7; [[Overview]] : What is Chicken?
    438
    449; [[Basic mode of operation]] : Compiling Scheme files.
  • chicken/branches/prerelease/manual/Unit extras

    r9381 r9424  
    44== Unit extras
    55
    6 This unit contains a collection of useful utility definitions.
     6This unit contains a collection of useful utility definitions. 
    77This unit is used by default, unless the program
    88is compiled with the {{-explicit-use}} option.
     
    228228
    229229
    230 === Hash Tables
    231 
    232 CHICKEN implements an extended SRFI-69. For more information,
    233 see [[http://srfi.schemers.org/srfi-69/srfi-69.html|SRFI-69]] and
    234 [[http://srfi.schemers.org/srfi-69/srfi-90.html|SRFI-90]].
     230=== Hash tables
     231
     232CHICKEN implements SRFI-69. For more information,
     233see [[http://srfi.schemers.org/srfi-69/srfi-69.html|SRFI-69]].
    235234
    236235A setter for {{hash-table-ref}} is defined, so
     
    246245</enscript>
    247246
    248 
    249 ==== make-hash-table
    250 
    251  [procedure] (make-hash-table [TEST [HASH [SIZE]]] [#:TEST #:HASH #:SIZE #:INITIAL #:MIN-LOAD #:MAX-LOAD #:WEAK-KEYS #:WEAK-VALUES])
    252 
    253 The SRFI-69 procedure is extended:
    254 
    255 Returns a new {{HASH-TABLE}}, parameterized as follows:
    256 
    257 {{TEST}} is a procedure of one argument, {{(object -> boolean)}}; an equality
    258 predicate. The first argument is a {{KEY}}.
    259 
    260 {{HASH}} is a procedure of two arguments, {{(object (fixnum positive) ->
    261 (fixnum (<= 0 _ _2)))}}; a bounded hash function, where the returned hash value
    262 is in {{[0 BOUND)}}. The first argument is a {{KEY}} and the second argument is
    263 the {{BOUND}}.
    264 
    265 {{SIZE}} is a {{fixnum}}; the initial size of the hash-table.
    266 
    267 {{INITIAL}} is an {{object}}; the default initial value for any {{KEY}}.
    268 
    269 {{MIN-LOAD}} is a {{flonum}} in {{(0.0 1.0)}}; the lower bound for resizing the table.
    270 
    271 {{MAX-LOAD}} is a {{flonum}} in {{(0.0 1.0)}}; the upper bound for resizing the table.
    272 
    273 {{WEAK-KEYS}} is a {{boolean}}; always {{#f}} (until further notice).
    274 
    275 {{WEAK-VALUES}} is a {{boolean}}; always {{#f}} (until further notice).
    276 
    277 Keyword arguments take precedence over optional arguments when both are specified.
    278 
    279 
    280 ==== hash-table-min-load
    281 
    282  [procedure] (hash-table-min-load HASH-TABLE)
    283 
    284 Returns the {{MIN-LOAD}} property of the {{HASH-TABLE}}.
    285 
    286 
    287 ==== hash-table-max-load
    288 
    289  [procedure] (hash-table-max-load HASH-TABLE)
    290 
    291 Returns the {{MAX-LOAD}} property of the {{HASH-TABLE}}.
    292 
    293 
    294 ==== hash-table-weak-keys
    295 
    296  [procedure] (hash-table-weak-keys HASH-TABLE)
    297 
    298 Returns the {{WEAK-KEYS}} property of the {{HASH-TABLE}}.
    299 
    300 
    301 ==== hash-table-weak-values
    302 
    303  [procedure] (hash-table-weak-values HASH-TABLE)
    304 
    305 Returns the {{WEAK-VALUES}} property of the {{HASH-TABLE}}.
    306 
    307 
    308 ==== hash-table-has-initial
    309 
    310  [procedure] (hash-table-has-initial HASH-TABLE)
    311 
    312 Does the {{HASH-TABLE}} have an {{INITIAL}} property.
    313 
    314 
    315 ==== hash-table-initial
    316 
    317  [procedure] (hash-table-initial HASH-TABLE)
    318 
    319 Returns the {{INITIAL}} property of the {{HASH-TABLE}}.
    320 
    321 
    322 ==== hash-table-update!
    323 
    324  [procedure] (hash-table-update! HASH-TABLE KEY [FUNCTION [THUNK]])
    325 
    326 The SRFI-69 procedure is extended:
    327 
    328 {{FUNCTION}} is optional. The default is {{identity}}.
    329 
    330 {{THUNK}} is optional. The default is {{(lambda () (hash-table-initial
    331 HASH-TABLE))}}; when the {{HASH-TABLE}} has no initial value an error is
    332 signaled.
    333 
    334 Returns the new value, after the update.
    335 
    336 
    337 ==== hash-table-update!/default
    338 
    339  [procedure] (hash-table-update!/default HASH-TABLE KEY FUNCTION DEFAULT)
    340 
    341 The SRFI-69 procedure is extended:
    342 
    343 Returns the new value, after the update.
    344 
     247As an extension to SRFI-69, {{hash-table-update!}} and {{hash-table-update!/default}} return
     248the new value (after applying the update procedure).
    345249
    346250==== hash-table-remove!
    347251
    348  [procedure] (hash-table-remove! HASH-TABLE PROC)
    349 
    350 Calls {{PROC}} for all entries in {{HASH-TABLE}} with the key and value of each
     252 [procedure] (hash-table-remove! HASHTABLE PROC)
     253
     254Calls {{PROC}} for all entries in {{HASHTABLE}} with the key and value of each
    351255entry. If {{PROC}} returns true, then that entry is removed.
    352 
    353 
    354 ==== hash-table-merge
    355 
    356  [procedure] (hash-table-merge HASH-TABLE-1 HASH-TABLE-2)
    357 
    358 Returns a new {{hash-table}}, the merged result of {{HASH-TABLE-1}} &
    359 {{HASH-TABLE-2}}.
    360 
    361 
    362 ==== hash-table-map
    363 
    364  [procedure] (hash-table-map HASH-TABLE PROC)
    365 
    366 Calls {{PROC}} for all entries in {{HASH-TABLE}} with the key and value of each
    367 entry.
    368 
    369 {{PROC}} is a procedure of 2 arguments, {{(object object -> object)}}; the
    370 first argument is the {{KEY}}, and the second argument is the {{VALUE}}. The
    371 return value is collected in a list.
    372 
    373 Returns the list collection.
    374 
    375 
    376 ==== hash-table-for-each
    377 
    378  [procedure] (hash-table-for-each HASH-TABLE PROC)
    379 
    380 Calls {{PROC}} for all entries in {{HASH-TABLE}} with the key and value of each
    381 entry.
    382 
    383 {{PROC}} is a procedure of 2 arguments, {{(object object -> unspecified)}}; the first
    384 argument is the {{KEY}}, and the second argument is the {{VALUE}}.
    385 
    386 No return value.
    387 
    388 A synonym for {{hash-table-walk}}.
    389 
    390 
    391 ==== number-hash
    392 
    393  [procedure] (number-hash NUMBER [BOUND])
    394 
    395 Returns a hash value for the {{NUMBER}}, with optional {{BOUND}}.
    396 
    397 
    398 ==== object-uid-hash
    399 
    400  [procedure] (object-uid-hash OBJECT [BOUND])
    401 
    402 Returns a hash value for the {{OBJECT}}, with optional {{BOUND}}.
    403 
    404 Currently this is a synonym for {{equal?-hash}}.
    405 
    406 
    407 ==== symbol-hash
    408 
    409  [procedure] (symbol-hash SYMBOL [BOUND])
    410 
    411 Returns a hash value for the {{SYMBOL}}, with optional {{BOUND}}.
    412 
    413 
    414 ==== keyword-hash
    415 
    416  [procedure] (keyword-hash KEYWORD [BOUND])
    417 
    418 Returns a hash value for the {{KEYWORD}}, with optional {{BOUND}}.
    419 
    420 
    421 ==== eq?-hash
    422 
    423  [procedure] (eq?-hash OBJECT [BOUND])
    424 
    425 Returns a hash value for the {{OBJECT}}, with optional {{BOUND}}.
    426 
    427 For use with {{eq?}} as {{TEST}}.
    428 
    429 {{hash-by-identity}} is a synonym.
    430 
    431 Uses {{object-uid-hash}} for non-immediate, non-symbol objects.
    432 
    433 
    434 ==== eqv?-hash
    435 
    436  [procedure] (eqv?-hash OBJECT [BOUND])
    437 
    438 Returns a hash value for the {{OBJECT}}, with optional {{BOUND}}.
    439 
    440 For use with {{eqv?}} as {{TEST}}.
    441 
    442 Uses {{object-uid-hash}} for non-immediate, non-number, non-symbol objects.
    443 
    444 
    445 ==== equal?-hash
    446 
    447  [procedure] (equal?-hash OBJECT [BOUND])
    448 
    449 Returns a hash value for the {{OBJECT}}, with optional {{BOUND}}.
    450 
    451 For use with {{equal?}} as {{TEST}}.
    452 
    453 {{hash}} is a synonym.
    454256
    455257
     
    578380
    579381=== Random numbers
     382
     383
     384==== random-seed
     385
     386 [procedure] (random-seed [SEED])
     387
     388Seeds the random number generator with {{SEED}} (an exact integer) or
     389{{(current-seconds)}} if {{SEED}} is not given.
    580390
    581391
     
    660470input is read from the port that is the current value of {{(current-input-port)}}.
    661471After all expressions are read, and if the argument is a port, then the port will
    662 not be closed. The {{READER}} argument specifies the procedure used to read
     472not be closed. The {{READER}} argument specifies the procedure used to read 
    663473expressions from the given file or port and defaults to {{read}}. The reader
    664474procedure will be called with a single argument (an input port).
     
    697507
    698508Read or write {{NUM}} characters from/to {{PORT}}, which defaults to the
    699 value of {{(current-input-port)}} or {{(current-output-port)}}, respectively.
     509value of {{(current-input-port)}} or {{(current-output-port)}}, respectively. 
    700510If {{NUM}} is {{#f}} or not given, then all data
    701511up to the end-of-file is read, or, in the case of {{write-string}} the whole
     
    757567
    758568
     569
    759570==== ->string
    760571
     
    820631
    821632Split string into substrings separated by the given delimiters. If
    822 no delimiters are specified, a string comprising the tab, newline and space characters
     633no delimiters are specified, a string comprising the tab, newline and space characters 
    823634is assumed. If the
    824635parameter {{KEEPEMPTY}} is given and not {{#f}}, then empty
     
    857668  "<h1>this is a \"string\"</h1>"
    858669  '(("<" . "&lt;") (">" . "&gt;") ("\"" . "&quot;")) )
    859 =>  "&lt;h1&gt;this is a &quot;string&quot;&lt;/ht&gt;"
     670=>  "&lt;h1&gt;this is a &quot;string&quot;&lt;/h1&gt;"
    860671</enscript>
    861672
     
    895706
    896707
    897 ==== none?
    898 
    899  [procedure] (none? X)
    900 
    901 Ignores its argument and always returns {{#f}}. This is actually useful sometimes.
    902 
    903 
    904 ==== always?
    905 
    906  [procedure] (always? X ...)
    907 
    908 Ignores its arguments and always returns {{#t}}. This is actually useful sometimes.
    909 
    910 
    911 ==== never?
    912 
    913  [procedure] (never? X ...)
    914 
    915 Ignores its arguments and always returns {{#f}}. This is actually useful sometimes.
    916 
    917 
    918708==== constantly
    919709
     
    979769
    980770
     771
    981772==== each
    982773
     
    993784
    994785<enscript highlight=scheme>
    995 (lambda args
     786(lambda args 
    996787  (apply pp args)
    997788  (apply eval args) )
     
    1054845A single value version of {{compose}} (slightly faster). {{(o)}} is equivalent
    1055846to {{identity}}.
    1056 
    1057 
    1058 ==== left-section
    1059 
    1060  [procedure] (left-section PROC ARG ...)
    1061 
    1062 A left section partially applies arguments starting from the left.
    1063 
    1064 Returns a variadic procedure in which some prefix of its arguments,
    1065 {{ARG ...}}, are partially applied to {{PROC}}.
    1066 
    1067 
    1068 ==== right-section
    1069 
    1070  [procedure] (right-section PROC ARG ...)
    1071 
    1072 A right section partially applies arguments starting from the right.
    1073 
    1074 Returns a variadic procedure in which some reversed suffix of its arguments,
    1075 {{ARG ...}}, are partially applied to {{PROC}}.
    1076 
    1077 
    1078847
    1079848=== Binary searching
  • chicken/branches/prerelease/manual/Unit library

    r9381 r9424  
    9898; [procedure] (fp<= X Y)
    9999
    100 ==== flonum-print-precision
    101 
    102  [procedure] (flonum-print-precision [PRECISION])
    103 
    104 Gets and sets the number of significant digits printed for a floating-point
    105 number. {{PRECISION}} must be a positive {{fixnum}}. Always returns
    106 the setting in effect at the moment of invocation.
    107 
    108100==== signum
    109101
  • chicken/branches/prerelease/manual/Unit posix

    r9381 r9424  
    118118file-patterns (with {{*}} matching zero or more characters and
    119119{{?}} matching zero or one character).
     120
     121==== canonical-path
     122
     123 [procedure] (canonical-path NAME)
     124
     125Returns a canonical path for {{NAME}}, which should be a string
     126containing a path-or-filename.  The string returned by
     127{{canonical-path}} is OS dependent; it may be quoted and used in
     128a shell on the calling machine. (Quoting is suggested as shell
     129special characters, including space, are not escaped.)  However,
     130all path separators and prefixes are handled in an OS independent
     131fashion.  Any appearance of {{/}} below imply {{\\}} is also handled.
     132
     133The prefix for {{NAME}} determines what path to prepend.  If {{NAME}}
     134begins with a {{"~/"}}, this prefix is stripped and the user's
     135home directory is added.  If beginning with {{/}} or a DRIVE-LETTER:\\
     136combination, no additional path is added.  Otherwise, the current
     137directory and separator are added.  All relative path elements and
     138duplicate separators are processed and removed.  If {{NAME}} ends with
     139a {{/}} or is empty, the appropriate slash is appended to the tail.
     140
     141No directories or files are actually tested for existence; this
     142procedure only canonicalises path syntax.
    120143
    121144==== set-root-directory!
     
    426449These procedures return {{#t}} if the current user has read,
    427450write or execute permissions on the file named {{FILENAME}}.
     451
     452
     453==== stat-regular?
     454==== stat-directory?
     455==== stat-char-device?
     456==== stat-block-device?
     457==== stat-fifo?
     458==== stat-symlink?
     459==== stat-socket?
     460
     461 [procedure] (stat-regular? FILENAME)
     462 [procedure] (stat-directory? FILENAME)
     463 [procedure] (stat-char-device? FILENAME)
     464 [procedure] (stat-block-device? FILENAME)
     465 [procedure] (stat-fifo? FILENAME)
     466 [procedure] (stat-symlink? FILENAME)
     467 [procedure] (stat-socket? FILENAME)
     468
     469These procedures return {{#t}} if the {{FILENAME}} given is of the
     470appropriate type.
    428471
    429472
     
    9581001==== time->string
    9591002
    960  [procedure] (time->string VECTOR [FORMAT])
    961 
    962 Without a {{FORMAT}} string converts the broken out time represented in the 10
    963 element vector {{VECTOR}} into a string of the form {{"Tue May 21 13:46:22
     1003 [procedure] (time->string VECTOR)
     1004
     1005Converts the broken down time represented in the 10 element vector
     1006{{VECTOR}} into a string of the form {{"Tue May 21 13:46:22
    96410071991"}}.
    9651008
    966 Otherwise returns the time as a string formatted per the {{FORMAT}} string.
    967 
    968 See the {{strftime}} C procedure for a specification of the {{FORMAT}} string.
    969 
    970 ==== string->time
    971 
    972  [procedure] (string->time STRING [FORMAT])
    973 
    974 Returns the time string parsed per the {{FORMAT}} string as a broken out time
    975 10 element vector.
    976 
    977 The default {{FORMAT}} string is {{"%a %b %e %H:%M:%S %Z %Y"}}. (The default
    978 {{date}} command format.)
    979 
    980 See the {{strptime}} C procedure for a specification of the {{FORMAT}} string.
    9811009
    9821010=== Raw exit
     
    10871115{{#f}} otherwise.
    10881116
    1089 ==== terminal-size
    1090 
    1091  [procedure] (terminal-size PORT)
    1092 
    1093 Returns two values: The height and width of the terminal connected to {{PORT}}.
    10941117
    10951118=== How Scheme procedures relate to UNIX C functions
    10961119
    1097 <table>
    1098 <tr><td> change-directory
    1099 chdir
    1100 </td></tr><tr><td> change-file-mode
    1101 chmod
    1102 </td></tr><tr><td> change-file-owner
    1103 chown
    1104 </td></tr><tr><td> create-directory
    1105 mkdir
    1106 </td></tr><tr><td> create-fifo
    1107 mkfifo
    1108 </td></tr><tr><td> create-pipe
    1109 pipe
    1110 </td></tr><tr><td> create-session
    1111 setsid
    1112 </td></tr><tr><td> create-symbolic-link
    1113 link
    1114 </td></tr><tr><td> current-directory
    1115 curdir
    1116 </td></tr><tr><td> current-effective-groupd-id
    1117 getegid
    1118 </td></tr><tr><td> current-effective-user-id
    1119 geteuid
    1120 </td></tr><tr><td> current-group-id
    1121 getgid
    1122 </td></tr><tr><td> current-parent-id
    1123 getppid
    1124 </td></tr><tr><td> current-process-id
    1125 getpid
    1126 </td></tr><tr><td> current-user-id
    1127 getuid
    1128 </td></tr><tr><td> delete-directory
    1129 rmdir
    1130 </td></tr><tr><td> duplicate-fileno
    1131 dup/dup2
    1132 </td></tr><tr><td> _exit
    1133 _exit
    1134 </td></tr><tr><td> file-close
    1135 close
    1136 </td></tr><tr><td> file-access-time
    1137 stat
    1138 </td></tr><tr><td> file-change-time
    1139 stat
    1140 </td></tr><tr><td> file-modification-time
    1141 stat
    1142 </td></tr><tr><td> file-execute-access?
    1143 access
    1144 </td></tr><tr><td> file-open
    1145 open
    1146 </td></tr><tr><td> file-lock
    1147 fcntl
    1148 </td></tr><tr><td> file-position
    1149 ftell/lseek
    1150 </td></tr><tr><td> file-read
    1151 read
    1152 </td></tr><tr><td> file-read-access?
    1153 access
    1154 </td></tr><tr><td> file-select
    1155 select
    1156 </td></tr><tr><td> file-control
    1157 fcntl
    1158 </td></tr><tr><td> file-stat
    1159 stat
    1160 </td></tr><tr><td> file-test-lock
    1161 fcntl
    1162 </td></tr><tr><td> file-truncate
    1163 truncate/ftruncate
    1164 </td></tr><tr><td> file-unlock
    1165 fcntl
    1166 </td></tr><tr><td> file-write
    1167 write
    1168 </td></tr><tr><td> file-write-access?
    1169 access
    1170 </td></tr><tr><td> get-groups
    1171 getgroups
    1172 </td></tr><tr><td> get-host-name
    1173 gethostname
    1174 </td></tr><tr><td> initialize-groups
    1175 initgroups
    1176 </td></tr><tr><td> local-time->seconds
    1177 mktime
    1178 </td></tr><tr><td> local-timezone-abbreviation
    1179 localtime
    1180 </td></tr><tr><td> map-file-to-memory
    1181 mmap
    1182 </td></tr><tr><td> open-input-file*
    1183 fdopen
    1184 </td></tr><tr><td> open-output-file*
    1185 fdopen
    1186 </td></tr><tr><td> open-input-pipe
    1187 popen
    1188 </td></tr><tr><td> open-output-pipe
    1189 popen
    1190 </td></tr><tr><td> port->fileno
    1191 fileno
    1192 </td></tr><tr><td> process-execute
    1193 execvp
    1194 </td></tr><tr><td> process-fork
    1195 fork
    1196 </td></tr><tr><td> process-group-id
    1197 getpgid
    1198 </td></tr><tr><td> process-signal
    1199 kill
    1200 </td></tr><tr><td> process-wait
    1201 waitpid
    1202 </td></tr><tr><td> close-input-pipe
    1203 pclose
    1204 </td></tr><tr><td> close-output-pipe
    1205 pclose
    1206 </td></tr><tr><td> read-symbolic-link
    1207 readlink
    1208 </td></tr><tr><td> seconds->local-time
    1209 localtime
    1210 </td></tr><tr><td> seconds->string
    1211 ctime
    1212 </td></tr><tr><td> seconds->utc-time
    1213 gmtime
    1214 </td></tr><tr><td> set-alarm!
    1215 alarm
    1216 </td></tr><tr><td> set-buffering-mode!
    1217 setvbuf
    1218 </td></tr><tr><td> set-file-position!
    1219 fseek/seek
    1220 </td></tr><tr><td> set-groups!
    1221 setgroups
    1222 </td></tr><tr><td> set-signal-mask!
    1223 sigprocmask
    1224 </td></tr><tr><td> set-group-id!
    1225 setgid
    1226 </td></tr><tr><td> set-process-group-id!
    1227 setpgid
    1228 </td></tr><tr><td> set-user-id!
    1229 setuid
    1230 </td></tr><tr><td> set-root-directory!
    1231 chroot
    1232 </td></tr><tr><td> setenv
    1233 setenv/putenv
    1234 </td></tr><tr><td> sleep
    1235 sleep
    1236 </td></tr><tr><td> system-information
    1237 uname
    1238 </td></tr><tr><td> terminal-name
    1239 ttyname
    1240 </td></tr><tr><td> terminal-port?
    1241 isatty
    1242 </td></tr><tr><td> time->string
    1243 asctime
    1244 </td></tr><tr><td> unsetenv
    1245 putenv
    1246 </td></tr><tr><td> unmap-file-from-memory
    1247 munmap
    1248 </td></tr><tr><td> user-information
    1249 getpwnam/getpwuid
    1250 </td></tr><tr><td> utc-time->seconds
    1251 timegm
    1252 </td></tr></table>
     1120; {{change-directory}} : {{chdir}}
     1121; {{change-file-mode}} : {{chmod}}
     1122; {{change-file-owner}} : {{chown}}
     1123; {{create-directory}} : {{mkdir}}
     1124; {{create-fifo}} : {{mkfifo}}
     1125; {{create-pipe}} : {{pipe}}
     1126; {{create-session}} : {{setsid}}
     1127; {{create-symbolic-link}} : {{link}}
     1128; {{current-directory}} : {{curdir}}
     1129; {{current-effective-groupd-id}} : {{getegid}}
     1130; {{current-effective-user-id}} : {{geteuid}}
     1131; {{current-group-id}} : {{getgid}}
     1132; {{current-parent-id}} : {{getppid}}
     1133; {{current-process-id}} : {{getpid}}
     1134; {{current-user-id}} : {{getuid}}
     1135; {{delete-directory}} : {{rmdir}}
     1136; {{duplicate-fileno}} : {{dup/dup2}}
     1137; {{_exit}} : {{_exit}}
     1138; {{file-close}} : {{close}}
     1139; {{file-access-time}} : {{stat}}
     1140; {{file-change-time}} : {{stat}}
     1141; {{file-modification-time}} : {{stat}}
     1142; {{file-execute-access?}} : {{access}}
     1143; {{file-open}} : {{open}}
     1144; {{file-lock}} : {{fcntl}}
     1145; {{file-position}} : {{ftell/lseek}}
     1146; {{file-read}} : {{read}}
     1147; {{file-read-access?}} : {{access}}
     1148; {{file-select}} : {{select}}
     1149; {{file-control}} : {{fcntl}}
     1150; {{file-stat}} : {{stat}}
     1151; {{file-test-lock}} : {{fcntl}}
     1152; {{file-truncate}} : {{truncate/ftruncate}}
     1153; {{file-unlock}} : {{fcntl}}
     1154; {{file-write}} : {{write}}
     1155; {{file-write-access?}} : {{access}}
     1156; {{get-groups}} : {{getgroups}}
     1157; {{get-host-name}} : {{gethostname}}
     1158; {{initialize-groups}} : {{initgroups}}
     1159; {{local-time->seconds}} : {{mktime}}
     1160; {{local-timezone-abbreviation}} : {{localtime}}
     1161; {{map-file-to-memory}} : {{mmap}}
     1162; {{open-input-file*}} : {{fdopen}}
     1163; {{open-output-file*}} : {{fdopen}}
     1164; {{open-input-pipe}} : {{popen}}
     1165; {{open-output-pipe}} : {{popen}}
     1166; {{port->fileno}} : {{fileno}}
     1167; {{process-execute}} : {{execvp}}
     1168; {{process-fork}} : {{fork}}
     1169; {{process-group-id}} : {{getpgid}}
     1170; {{process-signal}} : {{kill}}
     1171; {{process-wait}} : {{waitpid}}
     1172; {{close-input-pipe}} : {{pclose}}
     1173; {{close-output-pipe}} : {{pclose}}
     1174; {{read-symbolic-link}} : {{readlink}}
     1175; {{seconds->local-time}} : {{localtime}}
     1176; {{seconds->string}} : {{ctime}}
     1177; {{seconds->utc-time}} : {{gmtime}}
     1178; {{set-alarm!}} : {{alarm}}
     1179; {{set-buffering-mode!}} : {{setvbuf}}
     1180; {{set-file-position!}} : {{fseek/seek}}
     1181; {{set-groups!}} : {{setgroups}}
     1182; {{set-signal-mask!}} : {{sigprocmask}}
     1183; {{set-group-id!}} : {{setgid}}
     1184; {{set-process-group-id!}} : {{setpgid}}
     1185; {{set-user-id!}} : {{setuid}}
     1186; {{set-root-directory!}} : {{chroot}}
     1187; {{setenv}} : {{setenv/putenv}}
     1188; {{sleep}} : {{sleep}}
     1189; {{system-information}} : {{uname}}
     1190; {{terminal-name}} : {{ttyname}}
     1191; {{terminal-port?}} : {{isatty}}
     1192; {{time->string}} : {{asctime}}
     1193; {{unsetenv}} : {{putenv}}
     1194; {{unmap-file-from-memory}} : {{munmap}}
     1195; {{user-information}} : {{getpwnam/getpwuid}}
     1196; {{utc-time->seconds}} : {{timegm}}
    12531197
    12541198
     
    13061250 map-file-to-memory  unmap-file-from-memory  memory-mapped-file-pointer  memory-mapped-file?
    13071251 set-alarm!
    1308  terminal-port?  terminal-name terminal-size
     1252 terminal-port?  terminal-name
    13091253 process-fork  process-signal
    13101254 parent-process-id
    13111255 set-root-directory!
    13121256 utc-time->seconds
    1313  string->time
    13141257
    13151258==== Additional Definitions
  • chicken/branches/prerelease/manual/Unit regex

    r9381 r9424  
    44== Unit regex
    55
    6 This library unit provides support for regular expressions. The regular
    7 expression package used is {{PCRE}} (''Perl Compatible Regular Expressions'')
     6This library unit provides support for regular expressions. The regular 
     7expression package used is {{PCRE}} (''Perl Compatible Regular Expressions'') 
    88written by Philip Hazel. See [[http://www.pcre.org]] for information about
    99the particular regexp flavor and extensions provided by this library.
     
    1313<enscript highlight=scheme>
    1414(require 'regex)
    15 (test-feature? 'pcre) => #t
     15(test-feature? 'pcre) => t
    1616</enscript>
    1717
     
    6060
    6161
    62 === regex-chardef-table?
    63 
    64  [procedure] (regex-chardef-table? OBJECT)
    65 
    66 Returns {{#t}} if the {{OBJECT}} is a {{character definitions table}}, and
    67 {{#f}} otherwise.
    68 
    69 
    70 === regex-chardef-table
    71 
    72  [procedure] (regex-chardef-table)
    73 
    74 Returns a new {{character definitions table}}.
    75 
    76 
    7762=== regexp
    7863
     
    8873=== regexp*
    8974
    90  [procedure] (regexp* STRING [OPTIONS [CHARDEFS-TABLE]])
     75 [procedure] (regexp* STRING [OPTIONS [TABLES]])
    9176
    9277Returns a precompiled regular expression object for {{string}}. The optional
    9378argument {{OPTIONS}} must be a list of option symbols. The optional argument
    94 {{CHARDEFS-TABLE}} must be a character definitions table.
    95 
    96 
    97 ==== Option Symbols:
     79{{TABLES}} must be a character definitions table (not defined here).
     80
     81
     82Option Symbols:
    9883
    9984; caseless : Character case insensitive match
     
    138123
    139124 [procedure] (regexp-optimize RX)
    140 
     125 
    141126Perform available optimizations for the precompiled regular expression {{RX}}.
    142127Returns {{#t}} when optimization performed, and {{#f}} otherwise.
     
    199184
    200185(string-split-fields "," s #:suffix)
    201 
     186 
    202187  => ("this is a string 1" " 2" " 3")
    203188</enscript>
     
    210195Searches substrings in {{STRING}} that match {{REGEXP}}
    211196and substitutes them with the string {{SUBST}}. The substitution
    212 can contain references to subexpressions in
     197can contain references to subexpressions in 
    213198{{REGEXP}} with the {{\NUM}} notation, where {{NUM}}
    214199refers to the NUMth parenthesized expression. The optional argument
  • chicken/branches/prerelease/manual/chicken-setup

    r7809 r9424  
    256256
    257257
     258==== chicken-prefix
     259
     260 [parameter] chicken-prefix
     261
     262The installation prefix specified when CHICKEN was built.
     263
    258264==== installation-prefix
    259265
    260266 [parameter] installation-prefix
    261267
    262 Holds the prefix under which CHICKEN executables and libraries have been installed (either
    263 the value of the environment variable {{CHICKEN_PREFIX}} or whatever prefix was
    264 specified at the time the system was built.
    265 
     268An alternative installation prefix that will be prepended to extension
     269installation paths if specified. It is set by the {{-install-prefix}}
     270option or environment variable {{CHICKEN_INSTALL_PREFIX}}.
    266271
    267272==== program-path
     
    543548; {{-revision REV}} : Specifies SVN revision to check out
    544549; {{-local PATHNAME}} : Fetch extension from local file
    545 ; {{-destdir PATHNAME}} : Specify alternative installation prefix (for packaging)
     550; {{-install-prefix PATHNAME}} : Specify alternative installation prefix (for packaging)
    546551; {{-host-extension}} : Compile extension in "host" mode (sets the parameter {{host-extension}} to {{#f}})
     552; {{-build-prefix PATHNAME}} : Location where chicken-setup will create egg build directories  (default: the value of environment variable CHICKEN_TMPDIR, or {{/tmp/chicken-{MAJOR-VERSION-build-{USER}}}})
     553; {{-download-path PATHNAME}} : Location where chicken-setup will save downloaded files  (default: {{build-prefix/downloads}})
    547554; {{--}} : Ignore all following arguments
    548555
  • chicken/branches/prerelease/manual/faq

    r9381 r9424  
    2727* As far as we know, CHICKEN is the first implementation of Scheme that uses Henry Baker's [[http://home.pipeline.com/~hbaker1/CheneyMTA.html|Cheney on the M.T.A]] concept.
    2828
     29==== Why call it 'Chicken'?
     30
     31According to [[http://chicken.wiki.br/felix winkelmann|felix]]:
     32
     33> Well, it's pretty boring, really: when I started the project and needed some
     34> name, the first thing that met my eyes was the "chicken" (actually a disguised penguin)
     35> from the Wallace + Gromit movie...
     36> And then there is of course the ever occurring chicken-and-egg problem
     37> with bootstrapped compilers.
     38
    2939==== What should I do if I find a bug?
    3040
    31 Send e-mail to chicken-janitors@nongnu.org (preferably using the {{chicken-bug(1)}} tool)
     41Send e-mail to felix@call-with-current-continuation.org
    3242with some hints about the problem, like
    3343version/build of the compiler, platform, system configuration, code that
     
    95105
    96106There is an extension based on the GNU Multiprecision Package that implements most of the full
    97 numeric tower, see [[numbers]].
     107numeric tower, see [[http://chicken.wiki.br/numbers|numbers]].
    98108
    99109
Note: See TracChangeset for help on using the changeset viewer.