~ chicken-core (chicken-5) 896eb83e19c939d41091153bda10aceb8e3482b6


commit 896eb83e19c939d41091153bda10aceb8e3482b6
Author:     felix <felix@call-with-current-continuation.org>
AuthorDate: Thu Dec 24 00:52:04 2009 +0100
Commit:     felix <felix@call-with-current-continuation.org>
CommitDate: Thu Dec 24 00:52:04 2009 +0100

    merged wiki changes into manual

diff --git a/manual/Data representation b/manual/Data representation
index 3fff3123..75fd994a 100644
--- a/manual/Data representation	
+++ b/manual/Data representation	
@@ -1,6 +1,5 @@
 [[tags: manual]]
 
-
 == Data representation
 
 There exist two different kinds of data objects in the CHICKEN system:
@@ -59,50 +58,63 @@ collection or internal data type dispatching.
 
 ; C_8ALIGN_BIT : Flag that specifies whether the data area of this block should be aligned on an 8-byte boundary (floating-point numbers, for example).
 
-The actual data follows immediately after the header. Note that
-block-addresses are always aligned to the native machine-word
-boundary. Scheme data objects map to blocks in the following manner:
+After these four bits comes a 4-bit type code representing one of the following types:
 
-'''pairs''': vector-like object (type bits {{C_PAIR_TYPE}}),
-where the car and the cdr are contained in the first and second slots,
-respectively.
+'''vectors''': vector objects with type bits {{C_VECTOR_TYPE}}, currently 0000.
 
-'''vectors''': vector object (type bits {{C_VECTOR_TYPE}}).
+'''symbols''': vector objects with type bits {{C_SYMBOL_TYPE}}, currently 0001. The three slots
+contain the toplevel variable value, the print-name (a string), and the property list
+of the symbol.
 
-'''strings''': byte-vector object (type bits {{C_STRING_TYPE}}).
+'''strings''': byte-vector objects with type bits {{C_STRING_TYPE}}, currently 0010.
 
-'''procedures''': special vector object (type bits
-{{C_CLOSURE_TYPE}}). The first slot contains a pointer to a
+'''pairs''': vector-like object with type bits {{C_PAIR_TYPE}}, currently 0011).
+The car and the cdr are contained in the first and second slots,
+respectively.
+
+'''closures''': special vector objects with type bits
+{{C_CLOSURE_TYPE}}, currently 0100. The first slot contains a pointer to a
 compiled C function. Any extra slots contain the free variables (since
 a flat closure representation is used).
 
-'''flonums''': a byte-vector object (type bits
-{{C_FLONUM_BITS}}). Slots one and two (or a single slot on
+'''flonums''': byte-vector objects with type bits
+{{C_FLONUM_BITS}}, currently 0101. Slots one and two (or a single slot on
 64 bit architectures) contain a 64-bit floating-point number, in the
 representation used by the host systems C compiler.
 
-'''symbols''': a vector object (type bits {{C_SYMBOL_TYPE}}). Slots
-one and two contain the toplevel variable value and the print-name
-(a string) of the symbol, respectively.
-
-'''ports''': a special vector object (type bits
-{{C_PORT_TYPE}}). The first slot contains a pointer to a file-
+'''ports''': special vector objects with type bits
+{{C_PORT_TYPE}}, currently 0111. The first slot contains a pointer to a file-
 stream, if this is a file-pointer, or NULL if not. The other slots
 contain housekeeping data used for this port.
 
-'''structures''': a vector object (type bits
-{{C_STRUCTURE_TYPE}}). The first slot contains a symbol that
+'''structures''': vector objects with type bits
+{{C_STRUCTURE_TYPE}}, currently 1000. The first slot contains a symbol that
 specifies the kind of structure this record is an instance of. The other
 slots contain the actual record items.
 
-'''pointers''': a special vector object (type bits
-{{C_POINTER_TYPE}}). The single slot contains a machine pointer.
+'''pointers''': special vector objects with type bits
+{{C_POINTER_TYPE}}, currently 1001. The single slot contains a machine pointer.
+
+'''locatives''': special vector objects with type bits {{C_LOCATIVE_TYPE}}, currently 1010.
+FIXME FIXME FIXME.
 
-'''tagged pointers''': similar to a pointer (type bits 
-{{C_TAGGED_POINTER_TYPE}}), but the object contains an additional
+'''tagged pointers''': special vector objects with type bits 
+{{C_TAGGED_POINTER_TYPE}}, currently 1011, Tagged pointers are similar to pointers,
+but the object contains an additional
 slot with a tag (an arbitrary data object) that identifies the type
 of the pointer.
 
+'''SWIG pointers''': special vector objects with type bits {{C_SWIG_POINTER_TYPE}}, currently
+1100.
+
+'''lambda infos''': byte-vector objects with type-bits {{C_LAMBDA_INFO_TYPE}}, currently 1101.
+
+'''buckets''': vector objects with type-bits {{C_BUCKET_TYPE}}, currently 1111.
+
+The actual data follows immediately after the header. Note that
+block addresses are always aligned to the native machine-word
+boundary.
+
 Data objects may be allocated outside of the garbage collected heap, as
 long as their layout follows the above mentioned scheme. But care has to
 be taken not to mutate these objects with heap-data (i.e. non-immediate
@@ -110,6 +122,8 @@ objects), because this will confuse the garbage collector.
 
 For more information see the header file {{chicken.h}}.
 
+
+
 ---
 Previous: [[Extensions]]
 
diff --git a/manual/Deviations from the standard b/manual/Deviations from the standard
index 40b5ed34..b7a6bd2f 100644
--- a/manual/Deviations from the standard	
+++ b/manual/Deviations from the standard	
@@ -74,22 +74,6 @@ and {{make-polar}} are not implemented. Fixnums are limited to
 on 64-bit hardware).  Support for the full numeric tower is available
 as a separate package, provided the GNU multiprecision library is installed.
 
-[6.2.6] The procedure {{string->number}} does not obey read/write
-invariance on inexact numbers.
-
-[6.4] The maximum number of values that can be passed to continuations
-captured using {{call-with-current-continuation}} is 120.
-
-[6.5] Code evaluated in {{scheme-report-environment}} or
-{{null-environment}} still sees non-standard syntax.
-
-[6.6.2] The procedure {{char-ready?}} always returns {{#t}} for
-terminal ports.  The procedure {{read}} does not obey read/write
-invariance on inexact numbers.
-
-[6.6.3] The procedures {{write}} and {{display}} do not obey
-read/write invariance to inexact numbers.
-
 [6.6.4] The {{transcript-on}} and {{transcript-off}} procedures are
 not implemented.  R5RS does not require them.
 
diff --git a/manual/Extensions to the standard b/manual/Extensions to the standard
index 9937906a..51e8664b 100644
--- a/manual/Extensions to the standard	
+++ b/manual/Extensions to the standard	
@@ -2,23 +2,23 @@
 
 == Extensions to the standard
 
-=== [2.1] 
+=== Identifiers
 
 Identifiers may contain special characters if delimited with
 {{| ... |}}.
 
-=== [2.3] 
+=== Brackets and braces
 
 The brackets {{[ ... ]}} and the braces {{ { ... } }} are
 provided as an alternative syntax for {{( ... )}}.  A number of reader
 extensions is provided. See [[Non-standard read syntax]].
 
-=== [4] 
+=== Non-standard macros
 
 Numerous non-standard macros are provided. See 
 [[Non-standard macros and special forms]] for more information.
 
-=== [4.1.4] 
+=== Extended DSSSL style lambda lists
 
 Extended DSSSL style lambda lists are supported. DSSSL parameter lists are defined by the following grammar:
 
@@ -58,16 +58,16 @@ Example:
      (list x y z i: i j: j))
   3 4 5 i: 6 i: 7)            => (3 4 5 i: 6 j: 1)
 
-=== [4.1.6] 
+=== {{set!}}
 
 {{set!}} for unbound toplevel variables is allowed. {{set! (PROCEDURE ...) ...)}}
 is supported, as CHICKEN implements [[http://srfi.schemers.org/srfi-17/srfi-17.html|SRFI-17]].
 
-=== [4.2.1]
+=== {{cond}}
 
 The {{cond}} form supports [[http://srfi.schemers.org/srfi-61|SRFI-61]].
 
-=== [4.2.2] 
+=== Binding values in {{letrec}}
 
 It is allowed for initialization values of bindings in a {{letrec}}
 construct to refer to previous variables in the same set of bindings, so
@@ -78,16 +78,16 @@ construct to refer to previous variables in the same set of bindings, so
 
 is allowed and returns {{123}}.
 
-=== [4.2.3] 
+=== {{begin}}
 
 {{(begin)}} is allowed in non-toplevel contexts and evaluates
 to an unspecified value.
 
-=== [4.2.5] 
+=== Delayed expressions
 
 Delayed expressions may return multiple values.
 
-=== [5.2.2] 
+=== Internal definitions
 
 CHICKEN extends standard semantics by allowing internal definitions
 everywhere, and not only at the beginning of a body. A set of internal definitions
@@ -110,7 +110,7 @@ Local sequences of {{define-syntax}} forms are translated into equivalent
 {{letrec-syntax}} forms that enclose the following forms as the body of
 the expression.
 
-=== [5.2] 
+=== {{define}}
 
 {{define}} with a single argument is allowed and initializes the toplevel or local binding
 to an unspecified value. CHICKEN supports ''curried'' definitions, where the variable name
@@ -122,17 +122,17 @@ is equivalent to
 
  (define (make-adder x) (lambda (y) (+ x y)))
 
-=== [6] 
+=== Non-standard procedures
 
 CHICKEN provides numerous non-standard procedures. See the manual
 sections on library units for more information.
 
-=== [6.2.4] 
+=== Special IEEE floating-point numbers
 
 The special IEEE floating-point numbers ''+nan'', ''+inf'' and ''-inf''
 are supported, as is negative zero.
 
-=== [6.3.4] 
+=== User defined character names
 
 User defined character names are supported. See
 {{char-name}}. Characters can be given
@@ -143,7 +143,7 @@ written) using the ''#\uXXXX'' and ''#\UXXXXXXXX'' notations.
 Non-standard characters names supported are {{#\tab}}, {{#\linefeed}}, {{#\return}}, {{#\alarm}},
 {{#\vtab}}, {{#\nul}}, {{#\page}}, {{#\esc}}, {{#\delete}} and {{#\backspace}}.
 
-=== [6.3.5]  
+=== Special characters in strings
 
 CHICKEN supports special characters preceded with
 a backslash ''\'' in quoted string
@@ -157,7 +157,7 @@ The latter is encoded in UTF-8 format.
 The third argument to {{substring}} is optional and defaults to the length
 of the string.
 
-=== [6.4] 
+=== {{force}}
 
 {{force}} called with an argument that is not a promise returns
 that object unchanged.  Captured continuations can be safely invoked
@@ -170,7 +170,7 @@ unspecified value. Note that this slight relaxation of the behaviour of
 returning mulitple values to non-multival continuations does not apply to
 explicit continuations (created with {{call-with-current-continuation}}).
 
-=== [6.5] 
+=== {{eval}}
 
 The second argument to {{eval}} is optional and
 defaults to the value of {{(interaction-environment)}}.
@@ -179,13 +179,13 @@ an optional 2nd parameter: if not {{#f}} (which is the default),
 toplevel bindings to standard procedures are mutable and new toplevel
 bindings may be introduced.
 
-=== [6.6] 
+=== Pathnames expansion
 
 The ''tilde'' character ({{~}}) is automatically expanded in pathnames.
 Additionally, if a pathname starts with {{$VARIABLE...}}, then the prefix is replaced
 by the value of the given environment variable.
 
-=== [6.6.1] 
+=== Optional arguments for port-related procedures
 
 If the procedures {{current-input-port}} and
 {{current-output-port}} are called with an argument (which should
@@ -199,7 +199,7 @@ arguments specify the mode in which the file is opened. Possible
 values are the keywords {{#:text}}, {{#:binary}} or
 {{#:append}}.
 
-=== [6.7] 
+=== {{exit}}
 
 The {{exit}} procedure exits a program right away and does ''not'' invoke pending {{dynamic-wind}} thunks.
 
diff --git a/manual/Non-standard macros and special forms b/manual/Non-standard macros and special forms
index 6529beb8..830ca303 100644
--- a/manual/Non-standard macros and special forms	
+++ b/manual/Non-standard macros and special forms	
@@ -50,7 +50,7 @@ See also: {{set-extension-specifier!}}
 <macro>(require-extension ID ...)</macro>
 
 This is equivalent to {{(require-library ID ...)}} but performs an implicit
-{{import}}.
+{{import}}, if necessary.
 This implementation of {{require-extension}} is compliant with [[http://srfi.schemers.org/srfi-55/srfi-55.html|SRFI-55]]
 (see the [[http://srfi.schemers.org/srfi-55/srfi-55.html|SRFI-55]] document for more information).
 
@@ -288,6 +288,7 @@ definitions should only appear at toplevel.
 
 <macro>(define-for-syntax (NAME VAR ...) EXP1 ...)</macro><br>
 <macro>(define-for-syntax (NAME VAR1 ... VARn . VARn+1) EXP1 ...)</macro><br>
+<macro>(define-for-syntax NAME [VALUE])</macro>
 
 Defines the toplevel variable {{NAME}} at macro-expansion time. This can
 be helpful when you want to define support procedures for use in macro-transformers,
diff --git a/manual/Unit data-structures b/manual/Unit data-structures
index 34df6e4b..ebd83f23 100644
--- a/manual/Unit data-structures	
+++ b/manual/Unit data-structures	
@@ -4,7 +4,8 @@
 == Unit data-structures
 
 This unit contains a collection of procedures related to data
-structures.
+structures.  This unit is used by default, unless the program is
+compiled with the {{-explicit-use}} option.
 
 
 === Lists
@@ -245,13 +246,13 @@ is the destructive version of sort.
 
 ==== sorted?
 
- [procedure] (sorted? SEQUENCE LESS?)
+<procedure>(sorted? SEQUENCE LESS?)</procedure>
 
 Returns true if the list or vector {{SEQUENCE}} is already sorted.
 
 ==== topological-sort
 
- [procedure] (topological-sort DAG PRED)
+<procedure>(topological-sort DAG PRED)</procedure>
 
 Sorts the directed acyclic graph dag {{DAG}} so that for every edge from vertex
 u to v, u will come before v in the resulting list of vertices.
@@ -281,6 +282,16 @@ Time complexity: O (|V| + |E|)
 (socks undershorts pants shoes watch shirt belt tie jacket)
 </enscript>
 
+=== Random numbers
+
+
+==== random-seed
+
+<procedure>(random-seed [SEED])</procedure>
+
+Seeds the random number generator with {{SEED}} (an exact integer) or 
+{{(current-seconds)}} if {{SEED}} is not given.
+
 
 === Strings
 
diff --git a/manual/Unit files b/manual/Unit files
index fdf399ae..f0ff1c99 100644
--- a/manual/Unit files	
+++ b/manual/Unit files	
@@ -27,8 +27,8 @@ For any component that is not contained in {{PATHNAME}}, {{#f}} is returned.
 ==== make-pathname
 ==== make-absolute-pathname
 
-<procedure>(make-pathname DIRECTORY FILENAME [EXTENSION])</procedure><br>
-<procedure>(make-absolute-pathname DIRECTORY FILENAME [EXTENSION])</procedure>
+<procedure>(make-pathname DIRECTORY FILENAME [EXTENSION [SEPARATOR]])</procedure><br>
+<procedure>(make-absolute-pathname DIRECTORY FILENAME [EXTENSION [SEPARATOR]])</procedure>
 
 Returns a string that names the file with the
 components {{DIRECTORY, FILENAME}} and (optionally)
diff --git a/manual/Unit lolevel b/manual/Unit lolevel
index 324e832f..36739fa0 100644
--- a/manual/Unit lolevel	
+++ b/manual/Unit lolevel	
@@ -434,6 +434,14 @@ These procedures operate with what are known as {{vector-like objects}}. A
 Note that strings and blobs are not considered vector-like.
 
 
+==== vector-like?
+
+<procedure>(vector-like? X)</procedure>
+
+Returns {{#t}} when {{X}} is a vector-like object, returns {{#f}}
+otherwise.
+
+
 ==== block-ref
 
 <procedure>(block-ref VECTOR* INDEX)</procedure>
diff --git a/manual/Unit utils b/manual/Unit utils
index f7622b93..20d581bb 100644
--- a/manual/Unit utils	
+++ b/manual/Unit utils	
@@ -51,7 +51,7 @@ using backslash ({{\}}).
 
 ==== compile-file
 
- [procedure] (compile-file FILENAME #!key options output-file load)
+<procedure>(compile-file FILENAME #!key options output-file load)</procedure>
 
 Compiles the Scheme source file {{FILENAME}} into a dynamically
 loadable library by invoking the {{csc}} compiler driver. If the
@@ -75,7 +75,7 @@ Notes:
 
 ==== compile-file-options
 
- [parameter] compile-file-options
+<parameter>compile-file-options</parameter>
 
 A parameter that holds a list of default options that should be given
 to {{csc}} after invocation of the {{compile-file}} procedure. 
@@ -85,7 +85,7 @@ The initial default options are {{-scrutinize -O2 -d2}}.
 
 ==== qs
 
- [procedure] (qs STRING [PLATFORM])
+<procedure>(qs STRING [PLATFORM])</procedure>
 
 Escapes {{STRING}} suitably for passing to a shell command on {{PLATFORM}}.
 {{PLATFORM}} defaults to the value of {{(build-platform)}} and indicates in
diff --git a/manual/Using the interpreter b/manual/Using the interpreter
index fec1ab56..c8c67fe1 100644
--- a/manual/Using the interpreter	
+++ b/manual/Using the interpreter	
@@ -57,7 +57,7 @@ The options recognized by the interpreter are:
 
 ; -ss PATHNAME : The same as {{-s PATHNAME}} but invokes the procedure {{main}} with the value of {{(command-line-arguments)}} as its single argument. If the main procedure returns an integer result, then the interpreter is terminated, returning the integer as the status code back to the invoking process. Any other result terminates the interpreter with a zero exit status.
 
-; -setup-mode : When locating extension, search the current directory first. By default, extensions are located first in the ''extension repository'', where {{chicken-install}} stores compiled extensions and their associated metadata.
+; -setup-mode : When locating extensions, search the current directory first. By default, extensions are located first in the ''extension repository'', where {{chicken-install}} stores compiled extensions and their associated metadata.
 
 ; -R  -require-extension NAME : Equivalent to evaluating {{(require-extension NAME)}}.
 
diff --git a/manual/faq b/manual/faq
index effaad74..364528a7 100644
--- a/manual/faq
+++ b/manual/faq
@@ -432,6 +432,7 @@ The following extended bindings are handled specially:
 {{fx-}} {{fx*}} {{fx/}} {{fxmod}}
 {{fx=}} {{fx>}} {{fx>=}} {{fixnum?}} {{fxneg}} {{fxmax}} {{fxmin}}
 {{fxand}} {{fxior}} {{fxxor}} {{fxnot}} {{fxshl}} {{fxshr}}
+{{finite?}} {{fp=}} {{fp>}} {{fp<}} {{fp>=}} {{fp<=}} {{fpinteger?}}
 {{flonum?}} {{fp+}}
 {{fp-}} {{fp*}} {{fp/}} {{atom?}}
 {{fp=}} {{fp>}} {{fp>=}} {{fpneg}} {{fpmax}} {{fpmin}}
Trap