>From 5750438f1cf80ca86647edf1319f5d51a0d7ce9c Mon Sep 17 00:00:00 2001 From: Christian Kellermann Date: Tue, 24 Apr 2012 22:02:30 +0200 Subject: [PATCH] Merge manual changes from the wiki --- manual/Unit irregex | 2 +- manual/Unit lolevel | 22 ++++++++++++++++------ manual/Unit posix | 5 +++++ manual/Unit srfi-18 | 15 +++++++++++++++ manual/Unit srfi-69 | 3 +++ manual/Using the compiler | 4 ++-- manual/Using the interpreter | 2 +- 7 files changed, 43 insertions(+), 10 deletions(-) diff --git a/manual/Unit irregex b/manual/Unit irregex index 155946c..0548a35 100644 --- a/manual/Unit irregex +++ b/manual/Unit irregex @@ -347,7 +347,7 @@ exactly. (irregex-search "needle" "hayneedlehay") => # - + By default the match is case-sensitive, though you can control this either with the compiler flags or local overrides: diff --git a/manual/Unit lolevel b/manual/Unit lolevel index 494feab..4223665 100644 --- a/manual/Unit lolevel +++ b/manual/Unit lolevel @@ -294,7 +294,7 @@ error is signalled. === Pointer vectors -/Pointer-vectors/ are specialized and space-efficient vectors or +''Pointer vectors'' are specialized and space-efficient vectors for foreign pointer objects. All procedures defined below that accept a pointer object allow {{#f}} as an alternative representation of the {{NULL}}-pointer. @@ -539,9 +539,9 @@ Signals an error if any of the above constraints is violated. (object-evict X [ALLOCATOR]) Copies the object {{X}} recursively into the memory pointed to by the foreign -pointer object returned by {{ALLOCATOR}}, which should be a procedure of a -single argument (the number of bytes to allocate). The freshly copied object is -returned. +pointer object returned by {{ALLOCATOR}}. The freshly copied object is +returned. {{ALLOCATOR}} should be a procedure of a single argument +(the number of bytes to allocate), and defaults to {{allocate}}. This facility allows moving arbitrary objects into static memory, but care should be taken when mutating evicted data: setting slots in evicted @@ -549,7 +549,9 @@ vector-like objects to non-evicted data is not allowed. It '''is''' possible to set characters/bytes in evicted strings or byte-vectors, though. It is advisable '''not''' to evict ports, because they might be mutated by certain file-operations. {{object-evict}} is able to handle circular and shared -structures, but evicted symbols are no longer unique: a fresh copy of the +structures. + +Evicted symbols are no longer unique: a fresh copy of the symbol is created, so @@ -561,8 +563,16 @@ y ==> foo (eq? (car z) (cadr z)) ==> #t -The {{ALLOCATOR}} defaults to {{allocate}}. +This loss of uniqueness also implies that an evicted structure -- +such as one created with {{define-record}} -- cannot be operated on with +the existing predicate or accessors, as internally a symbol is used to +denote the type: + +(define-record point x y) +(point? (make-point x y)) ; => #t +(point? (object-evict (make-point x y))) ; => #f + ==== object-evict-to-location diff --git a/manual/Unit posix b/manual/Unit posix index 309f80b..5376149 100644 --- a/manual/Unit posix +++ b/manual/Unit posix @@ -106,6 +106,11 @@ then {{(current-directory DIR)}} is equivalent to {{(change-directory DIR)}}. Creates a directory with the pathname {{NAME}}. If the {{PARENTS?}} argument is given and not false, any nonexistent parent directories are also created. +Notice that if {{NAME}} exists, {{create-directory}} won't try to create it +and will return {{NAME}} (i.e., it won't raise an error when given a {{NAME}} +that already exists). + + ==== delete-directory (delete-directory NAME [RECURSIVE]) diff --git a/manual/Unit srfi-18 b/manual/Unit srfi-18 index 418b4e1..c35e32f 100644 --- a/manual/Unit srfi-18 +++ b/manual/Unit srfi-18 @@ -80,6 +80,21 @@ Suspends the current thread until input ({{MODE}} is {{#:input}}), output ({{MOD or both ({{MODE}} is {{#:all}}) is available. {{FD}} should be a file-descriptor (not a port!) open for input or output, respectively. +(thread-state thread)
+ +Returns information about the state of the {{thread}}. The possible results +are: + + +* '''symbol {{created}}''': the {{thread}} is in the created state +* '''symbol {{ready}}''': the {{thread}} is in the ready state +* '''symbol {{running}}''': the {{thread}} is in the running state +* '''symbol {{blocked}}''': the {{thread}} is in the blocked state +* '''symbol {{suspended}}''': the {{thread}} is in the suspended state +* '''symbol {{sleeping}}''': the {{thread}} is in the sleeping state +* '''symbol {{terminated}}''': the {{thread}} is in the terminated state +* '''symbol {{dead}}''': the {{thread}} is in the dead state + == SRFI-18 specification diff --git a/manual/Unit srfi-69 b/manual/Unit srfi-69 index 79532dd..c4b909e 100644 --- a/manual/Unit srfi-69 +++ b/manual/Unit srfi-69 @@ -26,6 +26,9 @@ Returns a new {{HASH-TABLE}} with the supplied configuration. ; {{WEAK-KEYS}} : Use weak references for keys. (Ignored) ; {{WEAK-VALUES}} : Use weak references for values. (Ignored) +Please note that hash tables are ''not'' guaranteed to compare {{equal?}} +to each other, even if they contain exactly the same key/value pairs. + ==== alist->hash-table diff --git a/manual/Using the compiler b/manual/Using the compiler index 924356e..568a262 100644 --- a/manual/Using the compiler +++ b/manual/Using the compiler @@ -145,8 +145,8 @@ the source text should be read from standard input. ; -raw : Disables the generation of any implicit code that uses the Scheme libraries (that is all runtime system files besides {{runtime.c}} and {{chicken.h}}). -; -require-extension NAME : Loads the extension {{NAME}} before the compilation process commences. This is identical to adding {{(require-extension NAME)}} at the start of the compiled program. If {{-uses NAME}} is also given on the command line, then any occurrences of {{-require-extension NAME}} are replaced with {{(declare (uses NAME))}}. Multiple names may be given and should be separated by {{,}}. - +; -require-extension NAME : Loads the extension {{NAME}} before the compilation process commences. This is identical to adding {{(require-extension NAME)}} at the start of the compiled program. If {{-uses NAME}} is also given on the command line, then any occurrences of {{-require-extension NAME}} are replaced with {{(declare (uses NAME))}}. Multiple names may be given and should be separated by commas. + ; -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. ; -scrutinize : Enable simple flow-analysis to catch common type errors and argument/result mismatches. You can also use the {{scrutinize}} declaration to enable scrutiny. diff --git a/manual/Using the interpreter b/manual/Using the interpreter index 07ea51e..e3c0d7c 100644 --- a/manual/Using the interpreter +++ b/manual/Using the interpreter @@ -61,7 +61,7 @@ The options recognized by the interpreter are: ; -R -require-extension NAME : Equivalent to evaluating {{(require-extension NAME)}}. -; -version : Write the banner with version information to standard output and exit. +; -v -version : Write the banner with version information to standard output and exit. === Writing Scheme scripts -- 1.7.6