Changes between Version 5 and Version 6 of StandardConditionPredicatesCowan


Ignore:
Timestamp:
08/29/10 20:03:36 (7 years ago)
Author:
cowan
Comment:

Added constructors

Legend:

Unmodified
Added
Removed
Modified
  • StandardConditionPredicatesCowan

    v5 v6  
    1 = Standard condition predicates and accessors = 
     1= Standard condition predicates, accessors, and constructors = 
    22 
    33Conditions created by an implementation are opaque objects as far as 
    4 this standard is concerned; they may be any Scheme object such as a list, a vector, or a 
    5 record.  However, a variety of predicates and accessors 
     4this proposal is concerned; they may be any Scheme object such as a list, a vector, or a 
     5record.  However, a variety of constructors, predicates, and accessors 
    66are provided in order to help programs  
    7 examine implementation-specific conditions. 
     7create and/or examine implementation-specific conditions. 
    88If a predicate returns `#t` on a particular condition, the related accessor(s) 
    99will return information, hopefully meaningful and useful.  Otherwise, calling the accessors 
    1010has undefined effect. 
    1111It is common for more than one predicate to return `#t` on a particular condition. 
     12The constructors allow user programs to create conditions that answer to the related predicates and constructors. 
    1213 
    1314 * `(message-condition? `''condition''`)` 
     
    3738Returns the list of irritants (possibly empty) associated with ''message-condition''. 
    3839 
     40 * `(make-error-condition `''who''` `''message''` . `''irritants''`)` 
     41 
     42Creates a condition which answers #t to `who-condition?`, `message-condition?`, and `error-condition?`. 
     43 
    3944 * `(external-condition? `''condition''`)` 
    4045 
    4146Returns `#t` iff ''condition'' describes an exceptional situation that is 
    4247caused by something that has gone wrong in the interaction 
    43 of the program with the external world or the user, otherwise `#f`.  
     48of the program with the external world or the user, otherwise `#f`. 
     49 
     50 * `(make-external-condition . `''args''`)` 
     51 
     52Creates a condition which answers `#t` to `external-condition?`.  The ''args'' have implementation-dependent meaning. 
    4453 
    4554 * `(violation-condition? `''condition''`)` 
     
    4958typically caused by a programming error, otherwise `#f`.  
    5059 
     60 * `(make-violation-condition . `''args''`)` 
     61 
     62Creates a condition which answers `#t` to `violation-condition?`.  The ''args'' have implementation-dependent meaning. 
     63 
    5164 * `(invocation-condition? `''condition''`)` 
    5265 
     
    5467such as passing an invalid number of arguments or passing an argument of the wrong type, otherwise `#f`. 
    5568 
     69 * `(make-invocation-condition . `''args''`)` 
     70 
     71Creates a condition which answers `#t` to `invocation-condition?`.  The ''args'' have implementation-dependent meaning. 
     72 
    5673 * `(implementation-restriction-condition? `''condition''`)` 
    5774 
     
    5976that is allowed by the specification, otherwise `#f`. 
    6077 
     78 * `(make-implementation-restriction-condition . `''args''`)` 
     79 
     80Creates a condition which answers `#t` to `implementation-restriction-condition?`.  The ''args'' have implementation-dependent meaning. 
     81 
    6182 * `(storage-exhausted-condition? `''condition''`)` 
    6283 
    6384Returns `#t` iff ''condition'' is reporting that storage is exhausted, otherwise `#f`. 
     85 
     86 * `(make-storage-exhausted-condition . `''args''`)` 
     87 
     88Creates a condition which answers `#t` to `storage-exhausted-condition?`.  The ''args'' have implementation-dependent meaning. 
    6489 
    6590 * `(parse-condition? `''condition''`)` 
     
    7297Returns the string which could not be parsed. 
    7398 
     99 * `(make-parse-condition `''parse-string''` . `''args''`)` 
     100 
     101Creates a condition which answers `#t` to `parse-condition?`.  ''Parse-string'' is the string which could not be parsed.  The ''args'' have implementation-dependent meaning. 
     102 
    74103 * `(syntax-condition? `''condition''`)` 
    75104 
     
    84113Returns the subform which more precisely locates the syntax error. 
    85114 
     115 * `(make-syntax-condition `''form''` `''subform''` . `''args''`)` 
     116 
     117Creates a condition which answers `#t` to `syntax-condition?`.  The ''args'' have implementation-dependent meaning.  ''Form'' and ''subform'' are the form containing a syntax error and the form containing a syntax error respectively. 
     118 
    86119 * `(identifier-condition? `''condition''`)` 
    87120 
     
    92125Returns the identifier which is undefined as a symbol. 
    93126 
     127 * `(make-identifier-condition `''identifier''` . `''args''`)` 
     128 
     129Creates a condition which answers `#t` to `identifier-condition?`.  ''Identifier'' is a symbol representing the identifier which is undefined.  The ''args'' have implementation-dependent meaning. 
     130 
    94131 * `(port-condition? `''condition''`)` 
    95132 
     
    100137Returns the port associated with ''port-condition''. 
    101138 
     139 * `(make-port-condition `''port''` . `''args''`)` 
     140 
     141Creates a condition which answers `#t` to `port-condition?`.  ''Port'' is the port associated with the condition.  The ''args'' have implementation-dependent meaning. 
     142 
    102143 * `(i/o-condition? `''condition''`)` 
    103144 
    104145Returns `#t` iff ''condition'' describes an exceptional situation with I/O, otherwise `#f`. 
    105146 
     147 * `(make-i/o-condition `''port''` . `''args''`)` 
     148 
     149Creates a condition which answers `#t` to `i/o-condition?`.  ''Port'' is the port associated with the condition.  The ''args'' have implementation-dependent meaning. 
     150 
    106151 * `(read-condition? `''condition''`)` 
    107152 
    108153Returns `#t` iff ''condition'' describes an exceptional situation with input, otherwise `#f`. 
    109154 
     155 * `(make-read-condition `''port''` . `''args''`)` 
     156 
     157Creates a condition which answers `#t` to `read-condition?`.  ''Port'' is the port associated with the condition.  The ''args'' have implementation-dependent meaning. 
     158 
    110159 * `(write-condition? `''condition''`)` 
    111160 
    112161Returns `#t` iff ''condition'' describes an exceptional situation with output, otherwise `#f`. 
     162 
     163 * `(make-write-condition `''port''` . `''args''`)` 
     164 
     165Creates a condition which answers `#t` to `write-condition?`.  ''Port'' is the port associated with the condition.  The ''args'' have implementation-dependent meaning. 
    113166 
    114167 * `(position-condition? `''condition''`)` 
     
    121174Returns the position specified by the user. 
    122175 
     176 * `(make-position-condition `''port''` . `''args''`)` 
     177 
     178Creates a condition which answers `#t` to `position-condition?`.  ''Port'' is the port associated with the condition.  The ''args'' have implementation-dependent meaning. 
     179 
    123180 * `(filename-condition? `''condition''`)` 
    124181 
     
    129186Returns the filename associated with ''filename-condition'' as a string. 
    130187 
     188 * `(make-filename-condition `''port''` `''filename''` . `''args''`)` 
     189 
     190Creates a condition which answers `#t` to `filename-condition?`.  ''Filename'' is the name of the file associated with the condition.  ''Port'' is the port associated with the condition.  The ''args'' have implementation-dependent meaning. 
     191 
    131192 * `(file-protection-condition? `''condition''`)` 
    132193 
    133194Returns `#t` iff ''condition'' describes a file protection violation, otherwise `#f`. 
     195 
     196 * `(make-file-protection-condition `''port''` `''filename''` . `''args''`)` 
     197 
     198Creates a condition which answers `#t` to `file-protection-condition?`.  ''Filename'' is the name of the file associated with the condition.  ''Port'' is the port associated with the condition.  The ''args'' have implementation-dependent meaning. 
    134199 
    135200 * `(file-existence-condition? `''condition''`)` 
     
    141206Returns `#t` if the filename associated with ''file-existence-condition'' exists but should not, 
    142207or `#f` if it does not exist but should. 
     208 
     209 * `(make-file-exists-condition `''port''` `''filename''` `''file-exists?''` . `''args''`)` 
     210 
     211Creates a condition which answers `#t` to `filename-condition?`.  ''Filename'' is the name of the file associated with the condition.  ''File-exists?'' specifies whether the file exists or not.  ''Port'' is the port associated with the condition.  The ''args'' have implementation-dependent meaning. 
     212