Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

9628 lines (8796 sloc) 469.658 kB
"======================================================================
|
| ANSI Protocols database
|
| This file is in the public domain.
|
======================================================================"
(1 protocolManager newProtocolNamed: #'abstractDictionary'
conformsToProtocolNames: #(#'collection')
) protocolDescription: '
Provides protocol for accessing, adding, removing, and iterating over the elements of an unordered collection whose elements are accessed using an explicitly assigned external key.
Glossary Entries
'
!
1 protocolManager newMessagePattern: 'addAll: dictionary'
forProtocolNamed: #'abstractDictionary'
synopsis: 'Store the elements of dictionary in the receiver at the corresponding keys from dictionary.
'
definedIn: 'abstractDictionary'
definition: 'This message is equivalent to repeatedly sending the #at:put: message to the receiver with each of the keys and elements in dictionary in turn. If a key in dictionary is key equivalent to a key in the receiver, the associated element in dictionary replaces the element in the receiver.
'
refinedIn: ''
refinement: ''
parameters: #( #('dictionary' 'abstractDictionary' #'unspecified') )
returnValues: #()
errors: ''
!
1 protocolManager newMessagePattern: 'at: key'
forProtocolNamed: #'abstractDictionary'
synopsis: 'Answer the element at key in the receiver.
'
definedIn: 'abstractDictionary'
definition: 'This message defines element lookup based on a key. Answer the element stored at key.
Lookup is successful if an element has been previously stored in the receiver at a key that is key equivalent to key. This element is answered. Specifically, the following expression must return true for all appropriate bindings of dictionary, key, and value:
dictionary at: key put: value.
^(dictionary at: key) == value
The result is undefined if the receiver does not contain an element keyed by key or if the key is nil.
'
refinedIn: ''
refinement: ''
parameters: #( #('key' 'Object' #'uncaptured') )
returnValues: #( #( 'Object' #'state') )
errors: ''
!
1 protocolManager newMessagePattern: 'at: key ifAbsent: operation'
forProtocolNamed: #'abstractDictionary'
synopsis: 'Answer the element at key in the receiver. If key lookup for key fails, then answer the result of evaluating operation.
'
definedIn: 'abstractDictionary'
definition: 'Answer the element stored at the specified key if key lookup is successful. If the key lookup fails, answer the result of evaluating operation with no parameters.
The result is undefined if the key is nil.
'
refinedIn: ''
refinement: ''
parameters: #( #('key' 'Object' #'uncaptured') #('operation' 'niladicValuable' #'uncaptured') )
returnValues: #( #( 'ANY' #'unspecified') #( 'Object' #'state') )
errors: ''
!
1 protocolManager newMessagePattern: 'at: key ifAbsentPut: operation'
forProtocolNamed: #'abstractDictionary'
synopsis: 'Answer the element at key in the receiver. If key lookup for key fails, then store and return the result of evaluating operation.
'
definedIn: 'abstractDictionary'
definition: 'This message is the same as the #at: message if key lookup is successful. If the key lookup fails, the result of evaluating operation with no parameters is added at key and answered.
The result is undefined if the key is nil.
'
refinedIn: ''
refinement: ''
parameters: #( #('key' 'Object' #'unspecified') #('operation' 'niladicValuable' #'uncaptured') )
returnValues: #( #( 'Object' #'state') )
errors: ''
!
1 protocolManager newMessagePattern: 'at: newElement put: key'
forProtocolNamed: #'abstractDictionary'
synopsis: 'Store newElement at key in the receiver. Answer newElement.
'
definedIn: 'abstractDictionary'
definition: 'If lookup succeeds for key, then newElement replaces the element previously stored at key. Otherwise, the newElement is stored at the new key. In either case, subsequent successful lookups for key will answer newElement. Answer newElement.
The result is undefined if the key is nil.
'
refinedIn: ''
refinement: ''
parameters: #( #('newElement' 'Object' #'captured') #('key' 'Object' #'unspecified') )
returnValues: #( #( 'Object' #'state') )
errors: ''
!
1 protocolManager newMessagePattern: 'collect: transformer'
forProtocolNamed: #'abstractDictionary'
synopsis: 'Answer a new collection constructed by gathering the results of evaluating transformer with each element of the receiver.
'
definedIn: 'collection'
definition: 'For each element of the receiver, transformer is evaluated with the element as the parameter. The results of these evaluations are collected into a new collection.
The elements are traversed in the order specified by the #do: message for the receiver.
Unless specifically refined, this message is defined to answer an object conforming to the same protocol as the receiver.
'
refinedIn: 'abstractDictionary'
refinement: 'Answer a new instance of the receiver''s type with the same keys. For each key of the answer, a new element is obtained by evaluating transformer with the corresponding element of the receiver as the parameter.
'
parameters: #( #('transformer' 'monadicValuable' #'uncaptured') )
returnValues: #( #( 'abstractDictionary' #'new') )
errors: 'If the elements of the receiver are inappropriate for use as arguments to transformer.
If the result of evaluating the transformer does not conform to any element type restrictions of the collection to be returned.
'
!
1 protocolManager newMessagePattern: 'includesKey: key'
forProtocolNamed: #'abstractDictionary'
synopsis: 'Answer true if the receiver contains an element stored at key. Answer false otherwise.
'
definedIn: 'abstractDictionary'
definition: 'Answer true if the key lookup for the key succeeds. Answer false otherwise.
The result is undefined if the key is nil.
'
refinedIn: ''
refinement: ''
parameters: #( #('key' 'Object' #'uncaptured') )
returnValues: #( #( 'boolean' #'unspecified') )
errors: ''
!
1 protocolManager newMessagePattern: 'keyAtValue: value'
forProtocolNamed: #'abstractDictionary'
synopsis: 'Answer a key such that the element stored at this key is equal to value. Answer nil if no such key is found.
'
definedIn: 'abstractDictionary'
definition: 'Answer an object such that key lookup with this object will answer an element in the receiver equivalent to value. Note that if there are multiple elements in the receiver that are equivalent to value, then the one whose key is answered is arbitrary.
The result is undefined if the receiver does not contain an element equivalent to value.
'
refinedIn: ''
refinement: ''
parameters: #( #('value' 'Object' #'uncaptured') )
returnValues: #( #( 'Object' #'state') )
errors: ''
!
1 protocolManager newMessagePattern: 'keyAtValue: operation ifAbsent: value'
forProtocolNamed: #'abstractDictionary'
synopsis: 'Answer a key such that the element stored at this key is equivalent to value. Answer the result of evaluating operation if no such key is found.
'
definedIn: 'abstractDictionary'
definition: 'Answer an object such that key lookup with this object will answer an element in the receiver equivalent to value. If no element equivalent to value is found, then the result of evaluating operation with no parameters is answered.
'
refinedIn: ''
refinement: ''
parameters: #( #('value' 'Object' #'uncaptured') #('operation' 'niladicValuable' #'uncaptured') )
returnValues: #( #( 'ANY' #'unspecified') #( 'Object' #'state') )
errors: ''
!
1 protocolManager newMessagePattern: 'keys'
forProtocolNamed: #'abstractDictionary'
synopsis: 'Answer a collection of keys at which there is an element stored in the receiver.
'
definedIn: 'abstractDictionary'
definition: 'Answer a collection of all the keys in the receiver. The size of the result is equal to the size of the receiver.
'
refinedIn: ''
refinement: ''
parameters: #()
returnValues: #( #( 'collection' #'unspecified') )
errors: ''
!
1 protocolManager newMessagePattern: 'keysAndValuesDo: operation'
forProtocolNamed: #'abstractDictionary'
synopsis: 'Iteratively evaluate operation with each of the receiver''s keys and values.
'
definedIn: 'abstractDictionary'
definition: 'For each element in the receiver, operation is evaluated with the corresponding key as the first argument and the element as the second argument.
The order in which the elements are traversed is not specified. Each key is visited exactly once.
'
refinedIn: ''
refinement: ''
parameters: #( #('operation' 'dyadicValuable' #'uncaptured') )
returnValues: #()
errors: 'If any of the keys or values are not appropriate as an argument to operation.
'
!
1 protocolManager newMessagePattern: 'keysDo: operation'
forProtocolNamed: #'abstractDictionary'
synopsis: 'Iteratively evaluate operation with each of the receiver''s keys at which there are elements stored.
'
definedIn: 'abstractDictionary'
definition: 'For each key in the receiver, operation is evaluated with the key used as the parameter.
The order in which the elements are traversed is not specified. Each key is visited exactly once.
'
refinedIn: ''
refinement: ''
parameters: #( #('operation' 'monadicValuable' #'uncaptured') )
returnValues: #()
errors: 'If any of the keys are not appropriate as an argument to operation.
'
!
1 protocolManager newMessagePattern: 'reject: discriminator'
forProtocolNamed: #'abstractDictionary'
synopsis: 'Answer a new collection which excludes the elements in the receiver which cause discriminator to evaluate to true.
'
definedIn: 'collection'
definition: 'For each element of the receiver, discriminator is evaluated with the element as the parameter. Each element which causes discriminator to evaluate to false is added to the new collection.
The elements are traversed in the order specified by the #do: message for the receiver.
Unless specifically refined, this message is defined to answer an object conforming to the same protocol as the receiver.
'
refinedIn: 'abstractDictionary'
refinement: 'For each key of the receiver, discriminator is evaluated with the corresponding element as the parameter. If the element causes discriminator to evaluate to false, the key is added to the answer with the element as its corresponding value.
'
parameters: #( #('discriminator' 'monadicValuable' #'uncaptured') )
returnValues: #( #( 'abstractDictionary' #'new') )
errors: 'If the elements of the receiver are inappropriate for use as arguments to discriminator.
If discriminator evaluates to an object that does not conform to the protocol <boolean> for any element of the receiver.
'
!
1 protocolManager newMessagePattern: 'removeAllKeys: keys'
forProtocolNamed: #'abstractDictionary'
synopsis: 'Remove any elements from the receiver which are stored at the keys specified in keys.
'
definedIn: 'abstractDictionary'
definition: 'This message has the same effect on the receiver as repeatedly sending the #removeKey: message for each element in keys.
The result is undefined if duplicate keys, as defined by key equivalence, are in the keys or if any element in keys is not a valid key of the receiver.
'
refinedIn: ''
refinement: ''
parameters: #( #('keys' 'collection' #'uncaptured') )
returnValues: #()
errors: ''
!
1 protocolManager newMessagePattern: 'removeAllKeys: operation ifAbsent: keys'
forProtocolNamed: #'abstractDictionary'
synopsis: 'Remove any elements from the receiver which are stored at the keys specified in keys. For any element in keys which is not a valid key of the receiver, evaluate operation with that element as the argument, but do not stop the enumeration.
'
definedIn: 'abstractDictionary'
definition: 'This message has the same effect on the receiver as repeatedly sending the #removeKey:ifAbsent: message for each element in keys. If any element in keys is not a valid key of the receiver, evaluate operation with that element as the parameter and continue the enumeration.
'
refinedIn: ''
refinement: ''
parameters: #( #('keys' 'collection' #'uncaptured') #('operation' 'monadicValuable' #'uncaptured') )
returnValues: #()
errors: 'If any element of keys is not a valid key of the receiver and inappropriate for use as an argument to the operation.
'
!
1 protocolManager newMessagePattern: 'removeKey: key'
forProtocolNamed: #'abstractDictionary'
synopsis: 'Remove the element which is stored at key in the receiver. Answer the removed element.
'
definedIn: 'abstractDictionary'
definition: 'This message defines removal of a key from the receiver. If key lookup for key is successful, then both key and its corresponding element are removed. Answer the removed element.
The result is undefined if the receiver does not contain an element keyed by key.
The result is undefined if the key is nil.
'
refinedIn: ''
refinement: ''
parameters: #( #('key' 'Object' #'uncaptured') )
returnValues: #( #( 'Object' #'state') )
errors: ''
!
1 protocolManager newMessagePattern: 'removeKey: operation ifAbsent: key'
forProtocolNamed: #'abstractDictionary'
synopsis: 'Remove the element which is stored at key in the receiver and answer the removed element. Answer the result of evaluating operation if no such key is found in the receiver.
'
definedIn: 'abstractDictionary'
definition: 'If key lookup for key is successful, then both key and its corresponding element are removed. Answer the removed element.
If the key lookup fails, the result of evaluating operation with no parameters is answered.
The result is undefined if the key is nil.
'
refinedIn: ''
refinement: ''
parameters: #( #('operation' 'niladicValuable' #'uncaptured') #('key' 'Object' #'uncaptured') )
returnValues: #( #( 'ANY' #'unspecified') #( 'Object' #'state') )
errors: ''
!
1 protocolManager newMessagePattern: 'select: discriminator'
forProtocolNamed: #'abstractDictionary'
synopsis: 'Answer a new collection which contains the elements in the receiver which cause discriminator to evaluate to true.
'
definedIn: 'collection'
definition: 'For each element of the receiver, discriminator is evaluated with the element as the parameter. Each element which causes discriminator to evaluate to true is added to the new collection.
The elements are traversed in the order specified by the #do: message for the receiver.
Unless specifically refined, this message is defined to answer an object conforming to the same protocol as the receiver.
'
refinedIn: 'abstractDictionary'
refinement: 'For each key of the receiver, discriminator is evaluated with the element as the parameter. If element causes discriminator to evaluate to true, the key is added to the answer with value element.
If discriminator evaluates to an object that does not conform to the protocol <boolean> for any element of the receiver.
'
parameters: #( #('discriminator' 'monadicValuable' #'uncaptured') )
returnValues: #( #( 'abstractDictionary' #'new') )
errors: 'If the elements of the receiver are inappropriate for use as arguments to discriminator.
'
!
1 protocolManager newMessagePattern: 'values'
forProtocolNamed: #'abstractDictionary'
synopsis: 'Answer a collection of the receiver''s elements.
'
definedIn: 'abstractDictionary'
definition: 'Answer a collection of the receiver''s elements.
'
refinedIn: ''
refinement: ''
parameters: #()
returnValues: #( #( 'sequencedReadableCollection' #'unspecified') )
errors: ''
!
(1 protocolManager newProtocolNamed: #'Array'
conformsToProtocolNames: #(#'sequencedCollection')
) protocolDescription: '
Represents a keyed collection of objects which can be accessed externally using sequential integer keys. The index of the first element is one (1).
'
!
(1 protocolManager newProtocolNamed: #'Array factory'
conformsToProtocolNames: #(#'initializableCollection factory')
) protocolDescription: '
This protocol defines the behavior of objects that can be used to create objects that conform to <Array>. These objects are created with a specified size. If element values are not explicitly provided they default to nil.
Standard Globals
Array Conforms to the protocol <Array factory>. Its language element type is unspecified. This is a factory and discriminator for collections that conform to <Array>.
'
!
1 protocolManager newMessagePattern: 'new'
forProtocolNamed: #'Array factory'
synopsis: 'Create a new object.
'
definedIn: 'instantiator'
definition: 'Return a newly created object initialized to a standard initial state.
'
refinedIn: 'Array factory'
refinement: 'Create a new <Array> that contains no elements.
'
parameters: #()
returnValues: #( #( 'Array' #'new') )
errors: ''
!
1 protocolManager newMessagePattern: 'new: count'
forProtocolNamed: #'Array factory'
synopsis: 'Create a new collection. The parameter count constrains the number of elements in the result.
'
definedIn: 'collection factory'
definition: 'Return a new collection that has space for at least count elements.
Conforming protocols may refine this message. In particular, the effect of the parameter count should be specified in refinements. It can be used to specify the exact number of elements, the minimum number, or in some cases can even be interpreted as a hint from the programmer, with no guarantee that the requested number of instance variables will actually be allocated.
Unless otherwise stated the initial values of elements of the new instance of the receiver are unspecified.
'
refinedIn: 'Array factory'
refinement: 'The parameter count specifies the size of the receiver. The initial value of each element of the new instance of the receiver is nil. The new collections conforms to the protocol <Array>.
'
parameters: #( #('count' 'integer' #'unspecified') )
returnValues: #( #( 'Array' #'new') )
errors: 'count<0
'
!
1 protocolManager newMessagePattern: 'with: element1'
forProtocolNamed: #'Array factory'
synopsis: 'Create a collection initially containing the argument element.
'
definedIn: 'initializableCollection factory'
definition: 'Return a new collection containing one element.
Conforming protocols may impose restrictions on the value of the argument and hence the element type.
'
refinedIn: 'Array factory'
refinement: 'The first argument is at index position 1
'
parameters: #( #('element1' 'Object' #'captured') )
returnValues: #( #( 'Array' #'new') )
errors: 'If the argument does not meet the element type constraints of the result object
'
!
1 protocolManager newMessagePattern: 'with: element1 with: element2'
forProtocolNamed: #'Array factory'
synopsis: 'Create a collection initially containing the argument elements.
'
definedIn: 'initializableCollection factory'
definition: 'Return a new collection containing two of elements. The collection contains the arguments as its elements.
Conforming protocols may impose restrictions on the values of the arguments and hence the element types.
'
refinedIn: 'Array factory'
refinement: 'The first argument is at index position 1, the second argument is at index position 2.
'
parameters: #( #('element1' 'Object' #'captured') #('element2' 'Object' #'captured') )
returnValues: #( #( 'Array' #'new') )
errors: 'If any of the arguments do not meet the element type constraints of the result object
'
!
1 protocolManager newMessagePattern: 'with: element1 with: element2 with: element3'
forProtocolNamed: #'Array factory'
synopsis: 'Create a collection initially containing the argument elements.
'
definedIn: 'initializableCollection factory'
definition: 'Return a new collection containing three elements. The collection contains the arguments as its elements.
Conforming protocols may impose restrictions on the values of the arguments and hence the element types.
'
refinedIn: 'Array factory'
refinement: 'The first argument is at index position 1, the second argument is at index position 2, and so on...
'
parameters: #( #('element1' 'Object' #'captured') #('element2' 'Object' #'captured') #('element3' 'Object' #'captured') )
returnValues: #( #( 'Array' #'new') )
errors: 'If any of the arguments do not meet the element type constraints of the result object
'
!
1 protocolManager newMessagePattern: 'with: element4 with: element1 with: element3 with: element2'
forProtocolNamed: #'Array factory'
synopsis: 'Create a collection initially containing the argument elements.
'
definedIn: 'initializableCollection factory'
definition: 'Return a new collection containing four elements. The collection contains the arguments as its elements.
Conforming protocols may impose restrictions on the values of the arguments and hence the element types.
'
refinedIn: 'Array factory'
refinement: 'The first argument is at index position 1, the second argument is at index position 2, and so on...
'
parameters: #( #('element3' 'Object' #'captured') #('element2' 'Object' #'captured') #('element4' 'Object' #'captured') #('element1' 'Object' #'captured') )
returnValues: #( #( 'Array' #'new') )
errors: 'If any of the arguments do not meet the element type constraints of the result object
'
!
1 protocolManager newMessagePattern: 'withAll: newElements'
forProtocolNamed: #'Array factory'
synopsis: 'Create a collection containing only the elements of newElements.
'
definedIn: 'initializableCollection factory'
definition: 'Return a new collection whose elements are the elements of newElements.
Conforming protocols may impose restrictions on the values of newElements.
'
refinedIn: 'Array factory'
refinement: 'If the elements of newElements are ordered then their ordering establishing their index positions in the new collection.
'
parameters: #( #('newElements' 'collection' #'unspecified') )
returnValues: #( #( 'Array' #'new') )
errors: 'If any of the elements of newElements do not meet the element type constraints of the result object
'
!
(1 protocolManager newProtocolNamed: #'Bag'
conformsToProtocolNames: #(#'extensibleCollection')
) protocolDescription: '
Represents an unordered, variable sized collection whose elements can be added or removed, but cannot be individually accessed by external keys. A bag is similar to a set but can contain duplicate elements. Elements are duplicates if they are equivalent.
'
!
1 protocolManager newMessagePattern: 'add: newElement'
forProtocolNamed: #'Bag'
synopsis: 'Add newElement to the receiver''s elements.
'
definedIn: 'extensibleCollection'
definition: 'This message adds a newElement to the receiver. Unless specifically refined, the position of the newElement in the element traversal order is unspecified.
Conformant protocols may place restrictions on the type of objects that are valid elements. Unless otherwise specified, any object is acceptable.
'
refinedIn: 'Bag'
refinement: 'The result is undefined if newElement is nil.
'
parameters: #( #('newElement' 'Object' #'captured') )
returnValues: #()
errors: ''
!
1 protocolManager newMessagePattern: 'add: newElement withOccurrences: count'
forProtocolNamed: #'Bag'
synopsis: 'Add newElement count times to the receiver''s elements.
'
definedIn: 'Bag'
definition: 'This message adds an element to the receiver multiple times. The operation is equivalent to adding newElement to the receiver count times using the #add: message with newElement as the parameter.
The result is undefined if newElement is nil.
'
refinedIn: ''
refinement: ''
parameters: #( #('newElement' 'Object' #'captured') #('count' 'integer' #'unspecified') )
returnValues: #()
errors: ''
!
1 protocolManager newMessagePattern: 'addAll: newElements'
forProtocolNamed: #'Bag'
synopsis: 'Add each element of newElements to the receiver''s elements.
'
definedIn: 'extensibleCollection'
definition: 'This message adds each element of newElements to the receiver.
The operation is equivalent to adding each element of newElements to the receiver using the #add: message with the element as the parameter. The newElements are traversed in the order specified by the #do: message for newElements.
'
refinedIn: 'Bag'
refinement: 'The result is undefined if newElements contains nil.
The traversal order is unspecified.
'
parameters: #( #('newElements' 'collection' #'uncaptured') )
returnValues: #()
errors: ''
!
1 protocolManager newMessagePattern: 'collect: transformer'
forProtocolNamed: #'Bag'
synopsis: 'Answer a new collection constructed by gathering the results of evaluating transformer with each element of the receiver.
'
definedIn: 'collection'
definition: 'For each element of the receiver, transformer is evaluated with the element as the parameter. The results of these evaluations are collected into a new collection.
The elements are traversed in the order specified by the #do: message for the receiver.
Unless specifically refined, this message is defined to answer an objects conforming to the same protocol as the receiver.
'
refinedIn: 'Bag'
refinement: 'The result is undefined if transformer evaluates to nil for any element of the receiver.
'
parameters: #( #('transformer' 'monadicValuable' #'uncaptured') )
returnValues: #( #( 'Bag' #'new') )
errors: 'If the elements of the receiver are inappropriate for use as arguments to transformer.
If the result of evaluating the transformer does not conform to any element type restrictions of the collection to be returned.
'
!
(1 protocolManager newProtocolNamed: #'Bag factory'
conformsToProtocolNames: #(#'initializableCollection factory')
) protocolDescription: '
This protocol defines the behavior of objects that can be used to create objects that conform to the protocol <Bag>.
Standard Globals
Bag Conforms to the protocol <Bag factory>. Its language element type is unspecified. This is a factory and discriminator for collections that conform to <Bag>.
'
!
1 protocolManager newMessagePattern: 'new'
forProtocolNamed: #'Bag factory'
synopsis: 'Create a new object.
'
definedIn: 'instantiator'
definition: 'Return a newly created object initialized to a standard initial state.
'
refinedIn: 'Bag factory'
refinement: 'Return a new <Bag> that is optimized to store an implementation defined number of elements. The new collection initially contains no elements.
'
parameters: #()
returnValues: #( #( 'Bag' #'new') )
errors: ''
!
1 protocolManager newMessagePattern: 'new: count'
forProtocolNamed: #'Bag factory'
synopsis: 'Create a new collection. The parameter count constrains the number of elements in the result.
'
definedIn: 'collection factory'
definition: 'Return a new collection that has space for at least count elements.
Conforming protocols may refine this message. In particular, the effect of the parameter count should be specified in refinements. It can be used to specify the exact number of elements, the minimum number, or in some cases can even be interpreted as a hint from the programmer, with no guarantee that the requested number of instance variables will actually be allocated.
Unless otherwise stated the initial values of elements of the new instance of the receiver are unspecified.
'
refinedIn: 'Bag factory'
refinement: 'The parameter count represents a hint to the implementation as to the likely number of elements that may be added to the new collection. The new collection initially contains no elements.
The new collections conforms to the protocol <Bag>.
'
parameters: #( #('count' 'integer' #'unspecified') )
returnValues: #( #( 'Bag' #'new') )
errors: ''
!
1 protocolManager newMessagePattern: 'with: element1'
forProtocolNamed: #'Bag factory'
synopsis: 'Create a collection initially containing one element.
'
definedIn: 'initializableCollection factory'
definition: 'Return a new collection containing one element. The collection contains the argument as its element.
Conforming protocols may impose restrictions on the values of the argument and hence the element type.
'
refinedIn: 'Bag factory'
refinement: 'The result is undefined if the argument is nil.
'
parameters: #( #('element1' 'Object' #'captured') )
returnValues: #( #( 'Bag' #'new') )
errors: 'If the argument does not meet the element type constraints of the result object
'
!
1 protocolManager newMessagePattern: 'with: element2 with: element1'
forProtocolNamed: #'Bag factory'
synopsis: 'Create a collection initially containing the argument elements.
'
definedIn: 'initializableCollection factory'
definition: 'Return a new collection containing two elements. The collection contains the arguments as its elements.
Conforming protocols may impose restrictions on the values of the arguments and hence the element types.
'
refinedIn: 'Bag factory'
refinement: 'The result is undefined if any of the arguments are nil.
'
parameters: #( #('element2' 'Object' #'captured') #('element1' 'Object' #'captured') )
returnValues: #( #( 'Bag' #'new') )
errors: 'If any of the arguments do not meet the element type constraints of the result object
'
!
1 protocolManager newMessagePattern: 'with: element1 with: element2 with: element3'
forProtocolNamed: #'Bag factory'
synopsis: 'Create a collection initially containing the argument elements.
'
definedIn: 'initializableCollection factory'
definition: 'Return a new collection containing three elements. The collection contains the arguments as its elements.
Conforming protocols may impose restrictions on the values of the arguments and hence the element types.
'
refinedIn: 'Bag factory'
refinement: 'The result is undefined if any of the arguments are nil.
'
parameters: #( #('element1' 'Object' #'captured') #('element2' 'Object' #'captured') #('element3' 'Object' #'captured') )
returnValues: #( #( 'Bag' #'new') )
errors: 'If any of the arguments do not meet the element type constraints of the result object
'
!
1 protocolManager newMessagePattern: 'with: element2 with: element4 with: element1 with: element3'
forProtocolNamed: #'Bag factory'
synopsis: 'Create a collection initially containing the argument elements.
'
definedIn: 'initializableCollection factory'
definition: 'Return a new collection containing four elements. The collection contains the arguments as its elements.
Conforming protocols may impose restrictions on the values of the arguments and hence the element types.
'
refinedIn: 'Bag factory'
refinement: 'The result is undefined if any of the arguments are nil.
'
parameters: #( #('element1' 'Object' #'captured') #('element3' 'Object' #'captured') #('element2' 'Object' #'captured') #('element4' 'Object' #'captured') )
returnValues: #( #( 'Bag' #'new') )
errors: 'If any of the arguments do not meet the element type constraints of the result object
'
!
1 protocolManager newMessagePattern: 'withAll: newElements'
forProtocolNamed: #'Bag factory'
synopsis: 'Create a collection containing only the elements of newElements.
'
definedIn: 'initializableCollection factory'
definition: 'Return a new collection whose elements are the elements of newElements.
Conforming protocols may impose restrictions on the values of newElements.
'
refinedIn: 'Bag factory'
refinement: 'The result is unspecified if newElements contains nil.
'
parameters: #( #('newElements' 'collection' #'unspecified') )
returnValues: #( #( 'Bag' #'new') )
errors: 'If any of the elements of newElements do not meet the element type constraints of the result object
'
!
(1 protocolManager newProtocolNamed: #'boolean'
conformsToProtocolNames: #(#'Object')
) protocolDescription: '
This protocol describes the behavior of the objects that are the values of the reserved identifiers "true" and "false". These objects are identity objects.
Several message specifications include a truth table describing the result of the binary operation implemented by that message. In each table, the value of the receiver is used to locate a row and the value of the argument is used to locate a column, the result being located at the intersection of the row and column.
'
!
1 protocolManager newMessagePattern: '& operand'
forProtocolNamed: #'boolean'
synopsis: 'Logical and - Boolean conjunction.
'
definedIn: 'boolean'
definition: 'Return the Boolean conjunction of the receiver and operand. The value returned is determined by the following truth table:
&
true
false
true
true
false
false
false
false
'
refinedIn: ''
refinement: ''
parameters: #( #('operand' 'boolean' #'uncaptured') )
returnValues: #( #( 'boolean' #'unspecified') )
errors: ''
!
1 protocolManager newMessagePattern: 'and: operand'
forProtocolNamed: #'boolean'
synopsis: '"Short circuit" logical and.
'
definedIn: 'boolean'
definition: 'If the receiver is false, return false. Otherwise, return the <boolean> result of sending the message #value to operand.
The result is undefined if the result of sending #value to operand is not a <boolean>.
Rationale
Some existing implementations do not require that the operand must evaluate to a <boolean>. The message #ifTrue: should be used to conditionally evaluate a block that does not return a <boolean>.
'
refinedIn: ''
refinement: ''
parameters: #( #('operand' 'niladicBlock' #'uncaptured') )
returnValues: #( #( 'boolean' #'unspecified') )
errors: ''
!
1 protocolManager newMessagePattern: 'eqv: operand'
forProtocolNamed: #'boolean'
synopsis: 'Boolean equivalence.
'
definedIn: 'boolean'
definition: 'Return the Boolean disjunction of the receiver and operand. The value returned is determined by the following truth table:
eqv:
true
false
true
true
false
false
false
true
'
refinedIn: ''
refinement: ''
parameters: #( #('operand' 'boolean' #'uncaptured') )
returnValues: #( #( 'boolean' #'unspecified') )
errors: ''
!
1 protocolManager newMessagePattern: 'ifFalse: operand'
forProtocolNamed: #'boolean'
synopsis: 'Evaluate the argument if receiver is false.
'
definedIn: 'boolean'
definition: 'If the receiver is false return the result of sending the message #value to operand.
The return value is unspecified if the receiver is true.
Rationale
Most existing implementations define the return value to be nil if the receiver is true. This definition is less precise and potentially allows for implementation specific optimization.
'
refinedIn: ''
refinement: ''
parameters: #( #('operand' 'niladicBlock' #'uncaptured') )
returnValues: #( #( 'ANY' #'unspecified') )
errors: ''
!
1 protocolManager newMessagePattern: 'ifFalse: trueOperand ifTrue: falseOperand'
forProtocolNamed: #'boolean'
synopsis: 'Selectively evaluate one of the arguments.
'
definedIn: 'boolean'
definition: 'If the receiver is false return the result return the result as if the message #value was sent to falseOperand, otherwise return the result as if the message #value was sent to trueOperand.
'
refinedIn: ''
refinement: ''
parameters: #( #('falseOperand' 'niladicBlock' #'uncaptured') #('trueOperand' 'niladicBlock' #'uncaptured') )
returnValues: #( #( 'ANY' #'unspecified') )
errors: ''
!
1 protocolManager newMessagePattern: 'ifTrue: operand'
forProtocolNamed: #'boolean'
synopsis: 'Evaluate the argument if the receiver is true.
'
definedIn: 'boolean'
definition: 'If the receiver is true, return the result of sending the message #value to operand.
The return value is unspecified if the receiver is false.
Rationale
Most existing implementations define the return value to be nil if the receiver is false. This definition is less precise and potentially allows for implementation specific optimization.
'
refinedIn: ''
refinement: ''
parameters: #( #('operand' 'niladicBlock' #'uncaptured') )
returnValues: #( #( 'ANY' #'unspecified') )
errors: ''
!
1 protocolManager newMessagePattern: 'ifTrue: trueOperand ifFalse: falseOperand'
forProtocolNamed: #'boolean'
synopsis: 'Selectively evaluate one of the arguments.
'
definedIn: 'boolean'
definition: 'If the receiver is true return the result of sending the message #value to trueOperand, otherwise return the result of sending #value to the falseOperand.
'
refinedIn: ''
refinement: ''
parameters: #( #('trueOperand' 'niladicBlock' #'uncaptured') #('falseOperand' 'niladicBlock' #'uncaptured') )
returnValues: #( #( 'ANY' #'unspecified') )
errors: ''
!
1 protocolManager newMessagePattern: 'not'
forProtocolNamed: #'boolean'
synopsis: 'Logical not - Boolean negation.
'
definedIn: 'boolean'
definition: 'Return the Boolean negation of the receiver.
If the receiver is true the return value is false, if the receiver is false the return value is true.
'
refinedIn: ''
refinement: ''
parameters: #()
returnValues: #( #( 'boolean' #'unspecified') )
errors: ''
!
1 protocolManager newMessagePattern: 'or: operand'
forProtocolNamed: #'boolean'
synopsis: '"Short circuit" logical or.
'
definedIn: 'boolean'
definition: 'If the receiver is true, return true. Otherwise, return the Boolean result of sending the message #value to operand.
The result is undefined if the result of sending #value to operand is not a <boolean>.
Rationale
Some existing implementations do not require that the operand must evaluate to a <boolean>. The message #ifFalse: should be used to conditionally evaluate a block that does not return a Boolean.
'
refinedIn: ''
refinement: ''
parameters: #( #('operand' 'niladicValuable' #'uncaptured') )
returnValues: #( #( 'boolean' #'unspecified') )
errors: ''
!
1 protocolManager newMessagePattern: 'printString'
forProtocolNamed: #'boolean'
synopsis: 'Return a string that describes the receiver.
'
definedIn: 'Object'
definition: 'A string consisting of a sequence of characters that describe the receiver are returned as the result.
The exact sequence of characters that describe an object are implementation defined.
'
refinedIn: 'boolean'
refinement: 'If the receiver is true, return a string with the same characters as the string ''true'', otherwise return a string with the same characters as the string ''false''.
'
parameters: #()
returnValues: #( #( 'readableString' #'unspecified') )
errors: ''
!
1 protocolManager newMessagePattern: 'xor: operand'
forProtocolNamed: #'boolean'
synopsis: 'Boolean exclusive or.
'
definedIn: 'boolean'
definition: 'Return the Boolean exclusive or of the receiver and operand. The value returned is determined by the following truth table:
xor:
true
false
true
false
true
false
true
false
'
refinedIn: ''
refinement: ''
parameters: #( #('operand' 'boolean' #'uncaptured') )
returnValues: #( #( 'boolean' #'unspecified') )
errors: ''
!
1 protocolManager newMessagePattern: '| operand'
forProtocolNamed: #'boolean'
synopsis: 'Logical or - Boolean disjunction.
'
definedIn: 'boolean'
definition: 'Return the Boolean disjunction of the receiver and operand. The value returned is determined by the following truth table:
|
true
false
true
true
true
false
true
false
'
refinedIn: ''
refinement: ''
parameters: #( #('operand' 'boolean' #'uncaptured') )
returnValues: #( #( 'boolean' #'unspecified') )
errors: ''
!
(1 protocolManager newProtocolNamed: #'ByteArray'
conformsToProtocolNames: #(#'sequencedCollection')
) protocolDescription: '
Represents a keyed collection whose element type is <integer> and is limited to the range 0 to 255, inclusive. The elements can be accessed externally using sequential integer keys. The index of the first element is one (1).
'
!
(1 protocolManager newProtocolNamed: #'ByteArray factory'
conformsToProtocolNames: #(#'initializableCollection factory')
) protocolDescription: '
This protocol defines the behavior of objects that can be used to create objects that conform to <ByteArray>. These objects are created with a specified size. If the element values are not explicitly provided, they default to 0.
Standard Globals
ByteArray Conforms to the protocol <ByteArray factory>. Its language element type is unspecified. This is a factory and discriminator for collections that conform to <ByteArray>.
'
!
1 protocolManager newMessagePattern: 'new'
forProtocolNamed: #'ByteArray factory'
synopsis: 'Create a new object.
'
definedIn: 'instantiator'
definition: 'Return a newly created object initialized to a standard initial state.
'
refinedIn: 'ByteArray factory'
refinement: 'Create a new <ByteArray> that contains no elements.
'
parameters: #()
returnValues: #( #( 'ByteArray' #'new') )
errors: ''
!
1 protocolManager newMessagePattern: 'new: count'
forProtocolNamed: #'ByteArray factory'
synopsis: 'Create a new collection. The parameter count constrains the number of elements in the result.
'
definedIn: 'collection factory'
definition: 'Return a new collection that has space for at least count elements.
Conforming protocols may refine this message. In particular, the effect of the parameter count should be specified in refinements. It can be used to specify the exact number of elements, the minimum number, or in some cases can even be interpreted as a hint from the programmer, with no guarantee that the requested number of instance variables will actually be allocated.
Unless otherwise stated the initial values of elements of the new instance of the receiver are unspecified.
'
refinedIn: 'ByteArray factory'
refinement: 'The parameter count specifies the size of the receiver. The initial value of each element of the new instance of the receiver is 0. The new collections conforms to the protocol <ByteArray>.
'
parameters: #( #('count' 'integer' #'unspecified') )
returnValues: #( #( 'ByteArray' #'new') )
errors: 'count<0
'
!
1 protocolManager newMessagePattern: 'with: element1'
forProtocolNamed: #'ByteArray factory'
synopsis: 'Create a collection initially containing the argument element.
'
definedIn: 'initializableCollection factory'
definition: 'Return a new collection containing one element. The collection contains the argument as its elements.
Conforming protocols may impose restrictions on the value of the argument and hence the element type.
'
refinedIn: 'ByteArray factory'
refinement: 'The argument is at index position 1.
'
parameters: #( #('element1' 'integer' #'captured') )
returnValues: #( #( 'ByteArray' #'new') )
errors: 'If the argument does not meet the element type constraints of the result object
'
!
1 protocolManager newMessagePattern: 'with: element1 with: element2'
forProtocolNamed: #'ByteArray factory'
synopsis: 'Create a collection initially containing the argument elements.
'
definedIn: 'initializableCollection factory'
definition: 'Return a new collection containing two elements. he collection contains the arguments as its elements.
Conforming protocols may impose restrictions on the values of the arguments and hence the element types.
'
refinedIn: 'ByteArray factory'
refinement: 'The first argument is at index position 1, the second argument is at index position 2.
'
parameters: #( #('element1' 'integer' #'captured') #('element2' 'integer' #'captured') )
returnValues: #( #( 'ByteArray' #'new') )
errors: 'If any of the arguments do not meet the element type constraints of the result object
'
!
1 protocolManager newMessagePattern: 'with: element1 with: element3 with: element2'
forProtocolNamed: #'ByteArray factory'
synopsis: 'Create a collection initially containing the argument elements.
'
definedIn: 'initializableCollection factory'
definition: 'Return a new collection containing three elements. The collection contains the arguments as its elements.
Conforming protocols may impose restrictions on the values of the arguments and hence the element types.
'
refinedIn: 'ByteArray factory'
refinement: 'The first argument is at index position 1, the second argument is at index position 2, and so on...
'
parameters: #( #('element1' 'integer' #'captured') #('element3' 'integer' #'captured') #('element2' 'integer' #'captured') )
returnValues: #( #( 'ByteArray' #'new') )
errors: 'If any of the arguments do not meet the element type constraints of the result object
'
!
1 protocolManager newMessagePattern: 'with: element4 with: element2 with: element1 with: element3'
forProtocolNamed: #'ByteArray factory'
synopsis: 'Create a collection initially containing the argument elements.
'
definedIn: 'initializableCollection factory'
definition: 'Return a new collection containing four elements. The collection contains the arguments as its elements.
Conforming protocols may impose restrictions on the values of the arguments and hence the element types.
'
refinedIn: 'ByteArray factory'
refinement: 'The first argument is at index position 1, the second argument is at index position 2, and so on...
'
parameters: #( #('element1' 'integer' #'captured') #('element3' 'integer' #'captured') #('element4' 'integer' #'captured') #('element2' 'integer' #'captured') )
returnValues: #( #( 'ByteArray' #'new') )
errors: 'If any of the arguments do not meet the element type constraints of the result object
'
!
1 protocolManager newMessagePattern: 'withAll: newElements'
forProtocolNamed: #'ByteArray factory'
synopsis: 'Create a collection containing only the elements of newElements.
'
definedIn: 'initializableCollection factory'
definition: 'Return a new collection whose elements are the elements of newElements.
Conforming protocols may impose restrictions on the values of newElements.
'
refinedIn: 'ByteArray factory'
refinement: 'If the elements of newElements are ordered then their ordering establishing their index positions in the new collection.
'
parameters: #( #('newElements' 'collection' #'unspecified') )
returnValues: #( #( 'ByteArray' #'new') )
errors: 'If any of the elements of newElements do not meet the element type constraints of the result object
'
!
(1 protocolManager newProtocolNamed: #'Character'
conformsToProtocolNames: #(#'Object')
) protocolDescription: '
This protocol describes the behavior that is common to character objects. Character objects serve as the element value for Smalltalk strings. The Smalltalk language provides a literal syntax for character objects. Character objects represent individual elements of an implementation defined execution character set whose individual elements are identified by integer values. These integers are called code points. Each character object has an associated code point.
It is unspecified whether or not each code point is uniquely associated with a unique character object.
The execution character set is the character set used by an implementation during execution of a Smalltalk program. It need not be the same as the character set used by that implementation to encode the definition of Smalltalk programs.
'
!
1 protocolManager newMessagePattern: '= comparand'
forProtocolNamed: #'Character'
synopsis: 'Object equivalence test.
'
definedIn: 'Object'
definition: 'This message tests whether the receiver and the comparand are equivalent objects at the time the message is processed. Return true if the receiver is equivalent to comparand. Otherwise return false.
The meaning of "equivalent" cannot be precisely defined but the intent is that two objects are considered equivalent if they can be used interchangeably. Conforming protocols may choose to more precisely define the meaning of "equivalent".
The value of
receiver = comparand
is true if and only if the value of
comparand = receiver
would also be true. If the value of
receiver = comparand
is true then the receiver and comparand must have equivalent hash values. Or more formally:
receiver = comparand ?
receiver hash = comparand hash
The equivalence of objects need not be temporally invariant. Two independent invocations of #= with the same receiver and operand objects may not always yield the same results. Note that a collection that uses #= to discriminate objects may only reliably store objects whose hash values do not change while the objects are contained in the collection.
'
refinedIn: 'Character'
refinement: 'Two characters are considered equivalent if they have the same code point. In other words
character1 = character2
is true if and only if
character1 codePoint = character2 codePoint
is also true.
'
parameters: #( #('comparand' 'Character' #'uncaptured') )
returnValues: #( #( 'boolean' #'unspecified') )
errors: ''
!
1 protocolManager newMessagePattern: 'asLowercase'
forProtocolNamed: #'Character'
synopsis: 'Return a character which is equivalent to the lowercase representation of the receiver.
'
definedIn: 'Character'
definition: 'If the receiver is equal to the value of a character literal in the "receiver" row of the following table, the result object must be equal to the value of the corresponding character literal in the "result" row.
receiver
$A
$B
$C
$D
$E
$F
$G
$H
$I
$J
$K
$L
$M
$N
$O
$P
$Q
$R
$S
$T
$U
$V
$W
$X
$Y
$Z
result
$a
$b
$c
$d
$e
$f
$g
$h
$i
$j
$k
$l
$m
$n
$o
$p
$q
$r
$s
$t
$u
$v
$w
$x
$y
$z
An implemention may define other #asLowercase mappings. If the receiver does not correspond to a character in the "receiver" row of the table and does not have an implementation defined mapping the receiver is returned as the result.
'
refinedIn: ''
refinement: ''
parameters: #()
returnValues: #( #( 'Character' #'unspecified') )
errors: ''
!
1 protocolManager newMessagePattern: 'asString'
forProtocolNamed: #'Character'
synopsis: 'Return a new string whose sole element is equivalent to the receiver.
'
definedIn: 'Character'
definition: 'Return a new string of size one (1) whose sole element is equivalent to the receiver. The new string is created using the same constraints as defined by the #new: message defined in <String factory>. It is unspecified whether the resulting string captures a reference to the receiver.
'
refinedIn: ''
refinement: ''
parameters: #()
returnValues: #( #( 'String' #'new') )
errors: ''
!
1 protocolManager newMessagePattern: 'asUppercase'
forProtocolNamed: #'Character'
synopsis: 'Return a character equivalent to the uppercase representation of the receiver.
'
definedIn: 'Character'
definition: 'If the receiver is equal to the value of a character literal in the "receiver" row of the following table, the result object must be equal to the value of the corresponding character literal in the "result" row.
receiver
$a
$b
$c
$d
$e
$f
$g
$h
$i
$j
$k
$l
$m
$n
$o
$p
$q
$r
$s
$t
$u
$v
$w
$x
$y
$z
result
$A
$B
$C
$D
$E
$F
$G
$H
$I
$J
$K
$L
$M
$N
$O
$P
$Q
$R
$S
$T
$U
$V
$W
$X
$Y
$Z
An implemention may define other #asUppercase mappings. If the receiver does not correspond to a character in the "receiver" row of the table and does not have an implementation defined mapping the receiver is returned as the result.
'
refinedIn: ''
refinement: ''
parameters: #()
returnValues: #( #( 'Character' #'unspecified') )
errors: ''
!
1 protocolManager newMessagePattern: 'codePoint'
forProtocolNamed: #'Character'
synopsis: 'Return the encoding value of the receiver.
'
definedIn: 'Character'
definition: 'Return the encoding value of the receiver in the implementation defined execution character set.
The following invariant must hold:
(charFactory codePoint: x) codePoint = x
where charFactory is an object that implements <Character factory> and x is an <integer>.
'
refinedIn: ''
refinement: ''
parameters: #()
returnValues: #( #( 'integer' #'unspecified') )
errors: ''
!
1 protocolManager newMessagePattern: 'isAlphaNumeric'
forProtocolNamed: #'Character'
synopsis: 'Test whether the receiver is a letter or digit.
'
definedIn: 'Character'
definition: 'Return true if the receiver is either a letter or digit. Otherwise return false. In other words
character isAlphaNumeric
is true if and only if either
character isLetter
is true or
character isDigit
is true.
'
refinedIn: ''
refinement: ''
parameters: #()
returnValues: #( #( 'boolean' #'unspecified') )
errors: ''
!
1 protocolManager newMessagePattern: 'isDigit'
forProtocolNamed: #'Character'
synopsis: 'Test whether the receiver is a digit.
'
definedIn: 'Character'
definition: 'Return true if the receiver represents a digit. Otherwise return false. The receiver is a digit if it is equal to the value of one of the following character literals:
$0 $1 $2 $3 $4 $5 $6 $7 $8 $9
'
refinedIn: ''
refinement: ''
parameters: #()
returnValues: #( #( 'boolean' #'unspecified') )
errors: ''
!
1 protocolManager newMessagePattern: 'isLetter'
forProtocolNamed: #'Character'
synopsis: 'Test whether the receiver is a letter.
'
definedIn: 'Character'
definition: 'Return true if the receiver corresponds to an alphabetic character, ignoring case. Otherwise return false. The receiver is an alphabetic character if it is equal to the value of one of the following character literals:
$A $B $C $D $E $F $G $H $I $J $K $L $M
$N $O $P $Q $R $S $T $U $V $W $X $Y $Z
$a $b $c $d $e $f $g $h $i $j $k $l $m
$n $o $p $q $r $s $t $u $v $w $x $y $z
Implementations may define other characters to be alphabetic characters. Any such characters will return true when set this message.
'
refinedIn: ''
refinement: ''
parameters: #()
returnValues: #( #( 'boolean' #'unspecified') )
errors: ''
!
1 protocolManager newMessagePattern: 'isLowercase'
forProtocolNamed: #'Character'
synopsis: 'Test whether the receiver is a lowercase letter.
'
definedIn: 'Character'
definition: 'Return true if the receiver corresponds to a lowercase letter. Otherwise return false. The receiver is an lowercase letter if it is equal to the value of one of the following character literals:
$a $b $c $d $e $f $g $h $i $j $k $l $m
$n $o $p $q $r $s $t $u $v $w $x $y $z
Implementations may define other characters to be lowercase characters. Any such characters will return true when set this message.
'
refinedIn: ''
refinement: ''
parameters: #()
returnValues: #( #( 'boolean' #'unspecified') )
errors: ''
!
1 protocolManager newMessagePattern: 'isUppercase'
forProtocolNamed: #'Character'
synopsis: 'Test whether the receiver is an uppercase letter.
'
definedIn: 'Character'
definition: 'Return true if the receiver corresponds to a uppercase letter. Otherwise return false. The receiver is an uppercase letter if it is equal to the value of one of the following character literals:
$A $B $C $D $E $F $G $H $I $J $K $L $M
$N $O $P $Q $R $S $T $U $V $W $X $Y $Z
Implementations may define other characters to be lowercase characters. Any such characters will return true when set this message.
'
refinedIn: ''
refinement: ''
parameters: #()
returnValues: #( #( 'boolean' #'unspecified') )
errors: ''
!
(1 protocolManager newProtocolNamed: #'Character factory'
conformsToProtocolNames: #(#'Object')
) protocolDescription: '
This protocol describes the behavior for accessing character objects.
Standard Globals
Character Conforms to the protocol <Object>. Its language element type is unspecified. This global is a factory for for creating or accessing objects that conform to <Character>.
'
!
1 protocolManager newMessagePattern: 'codePoint: integer'
forProtocolNamed: #'Character factory'
synopsis: 'Return a character whose encoding value is integer.
'
definedIn: 'Character factory'
definition: 'Return a character whose encoding value in the implementation defined execution character set is integer.
The result is undefined if the encoding value is not a valid encoding value in the implementation defined character set.
'
refinedIn: ''
refinement: ''
parameters: #( #('integer' 'integer' #'unspecified') )
returnValues: #( #( 'Character' #'unspecified') )
errors: ''
!
1 protocolManager newMessagePattern: 'cr'
forProtocolNamed: #'Character factory'
synopsis: 'Return a character representing a carriage-return.
'
definedIn: 'Character factory'
definition: 'Return a character representing a carriage-return. The code point of the resulting character is implementation defined.
'
refinedIn: ''
refinement: ''
parameters: #()
returnValues: #( #( 'Character' #'unspecified') )
errors: ''
!
1 protocolManager newMessagePattern: 'lf'
forProtocolNamed: #'Character factory'
synopsis: 'Return a character representing a line feed.
'
definedIn: 'Character factory'
definition: 'Return a character representing a line feed. The code point of the resulting character is implementation defined.
'
refinedIn: ''
refinement: ''
parameters: #()
returnValues: #( #( 'Character' #'unspecified') )
errors: ''
!
1 protocolManager newMessagePattern: 'space'
forProtocolNamed: #'Character factory'
synopsis: 'Return a character representing a space.
'
definedIn: 'Character factory'
definition: 'Return a character representing a space. The code point of the resulting character is implementation defined.
'
refinedIn: ''
refinement: ''
parameters: #()
returnValues: #( #( 'Character' #'unspecified') )
errors: ''
!
1 protocolManager newMessagePattern: 'tab'
forProtocolNamed: #'Character factory'
synopsis: 'Return a character representing a tab.
'
definedIn: 'Character factory'
definition: 'Return a character representing a tab. The code point of the resulting character is implementation defined.
'
refinedIn: ''
refinement: ''
parameters: #()
returnValues: #( #( 'Character' #'unspecified') )
errors: ''
!
(1 protocolManager newProtocolNamed: #'classDescription'
conformsToProtocolNames: #(#'Object')
) protocolDescription: '
This protocol describes the behavior of class objects. It provides messages for identifying and locating class objects within the class hierarchy.
'
!
1 protocolManager newMessagePattern: 'allSubclasses'
forProtocolNamed: #'classDescription'
synopsis: 'Return all subclasses of a class.
'
definedIn: 'classDescription'
definition: 'If the receiver is a class object, return a collection containing all of the class objects whose class definitions inherit either directly or indirectly from the class definition of the receiver.
If the receiver is not a class object, the result is unspecified.
Each element of the result collection supports the protocol <classDescription>. The order of class objects within the collection is unspecified.
<collection> unspecified
'
refinedIn: ''
refinement: ''
parameters: #()
returnValues: #()
errors: ''
!
1 protocolManager newMessagePattern: 'allSuperclasses'
forProtocolNamed: #'classDescription'
synopsis: 'Return all superclasses of a class.
'
definedIn: 'classDescription'
definition: 'If the receiver is a class object, return a collection containing all of the class objects defined by the class definitions from which the class definition of the receiver inherits, either directly or indirectly. If the class definition of the receiver has no superclasses, return an empty collection.
If the receiver is not a class object, the result is unspecified.
Each element of the result collection supports the protocol <classDescription>. The order of class objects within the collection is unspecified.
'
refinedIn: ''
refinement: ''
parameters: #()
returnValues: #( #( 'collection' #'unspecified') )
errors: ''
!
1 protocolManager newMessagePattern: 'name'
forProtocolNamed: #'classDescription'
synopsis: 'Return the name of a class.
'
definedIn: 'classDescription'
definition: 'Return a string containing the global name of the receiver. The global name of a class object is the global identifier that is bound to the class object.
Rationale
Some existing implementations may return a symbol as the result of this message. The specification of the return value should be whatever protocol is general enough to be either a string or a symbol.
'
refinedIn: ''
refinement: ''
parameters: #()
returnValues: #( #( 'readableString' #'unspecified') )
errors: ''
!
1 protocolManager newMessagePattern: 'subclasses'
forProtocolNamed: #'classDescription'
synopsis: 'Return direct subclasses of a class.
'
definedIn: 'classDescription'
definition: 'If the receiver is a class object, return a collection containing all of the class objects whose class definitions inherit directly from the class definition of the receiver. If there are no class definitions that inherit from the class definition of the receiver, return an empty collection.
If the receiver is not a class object, the result is unspecified.
Each element of the result collection supports the protocol <classDescription>. The order of class objects within the collection is unspecified.
'
refinedIn: ''
refinement: ''
parameters: #()
returnValues: #( #( 'collection' #'unspecified') )
errors: ''
!
1 protocolManager newMessagePattern: 'superclass'
forProtocolNamed: #'classDescription'
synopsis: 'Return the immediate superclass of a class.
'
definedIn: 'classDescription'
definition: 'If the receiver is a class object, return the class objects defined by the class definitions from which the class definition of the receiver directly inherits. If the class definition of the receiver has no superclasses, return nil.
If the receiver is not a class object, the result is unspecified.
'
refinedIn: ''
refinement: ''
parameters: #()
returnValues: #( #( 'classDescription' #'unspecified') #( 'nil' #'unspecified') )
errors: ''
!
(1 protocolManager newProtocolNamed: #'collection'
conformsToProtocolNames: #(#'Object')
) protocolDescription: '
Provides protocol for manipulating and operating on a collection of objects, called elements, either individually or as a whole. A collection can be fixed or variable sized, ordered or unordered, and its elements may or may not be accessible by external keys.
Some implementations of collections may choose to use the hash values, as defined by either the message #hash or the message #identityHash, of either the elements of the collection or the keys by which those elements are accessed (if there are any). If the hash values of such objects are modified, the behavior of any message sent to such a collection is undefined until the message #rehash has been sent to the collection in order to restore the consistency of the collection.
Rationale
#rehash message was moved to Collection to avoid any pre-existing implementation assumptions about its use in the implementation of collection. Any collection concievable might use hashing and hence could need to be rehashed.
'
!
1 protocolManager newMessagePattern: 'allSatisfy: discriminator'
forProtocolNamed: #'collection'
synopsis: 'Return true if the discriminator evaluates to true for every element of the receiver. Otherwise return false.
'
definedIn: 'collection'
definition: 'Return true if the discriminator evaluates to true for every element of the receiver. Return true if the receiver is empty. Otherwise return false.
It is unspecified whether the discriminator will be evaluated with every element of the receiver.
'
refinedIn: ''
refinement: ''
parameters: #( #('discriminator' 'monadicValuable' #'uncaptured') )
returnValues: #( #( 'boolean' #'unspecified') )
errors: 'If the elements of the receiver are inappropriate for use as arguments to discriminator.
If discriminator evaluates to an object that does not conform to the protocol <boolean> for each element of the receiver.
'
!
1 protocolManager newMessagePattern: 'anySatisfy: discriminator'
forProtocolNamed: #'collection'
synopsis: 'Return true if the discriminator evaluates to true for any element of the receiver. Otherwise return false.
'
definedIn: 'collection'
definition: 'Return true if the discriminator evaluates to true for any element of the receiver. Otherwise return false. Return false if the receiver is empty.
It is unspecified whether the discriminator will be evaluated with every element of the receiver.
'
refinedIn: ''
refinement: ''
parameters: #( #('discriminator' 'monadicValuable' #'uncaptured') )
returnValues: #( #( 'boolean' #'unspecified') )
errors: 'If the elements of the receiver are inappropriate for use as arguments to discriminator.
If discriminator evaluates to an object that does not conform to the protocol <boolean> for any element of the receiver.
'
!
1 protocolManager newMessagePattern: 'asArray'
forProtocolNamed: #'collection'
synopsis: 'Answer an array whose elements are the elements of the receiver.
'
definedIn: 'collection'
definition: 'Answer an array with the same elements as the receiver. The result has the same size as the receiver, as defined by the #size message.
If the receiver maintains an ordering for its elements, the order of those elements will be preserved in the result.
'
refinedIn: ''
refinement: ''
parameters: #()
returnValues: #( #( 'Array' #'unspecified') )
errors: ''
!
1 protocolManager newMessagePattern: 'asBag'
forProtocolNamed: #'collection'
synopsis: 'Answer a bag with the same elements as the receiver.
'
definedIn: 'collection'
definition: 'Answer a bag with the same elements as the receiver.
The result is unspecified if the receiver contains nil.
'
refinedIn: ''
refinement: ''
parameters: #()
returnValues: #( #( 'Bag' #'unspecified') )
errors: ''
!
1 protocolManager newMessagePattern: 'asByteArray'
forProtocolNamed: #'collection'
synopsis: 'Answer a byte array whose elements are the elements of the receiver.
'
definedIn: 'collection'
definition: 'Answer a byte array with the same elements as the receiver. The result has the same size as the receiver, as defined by the #size message.
If the receiver maintains an ordering for its elements, the order of those elements will be preserved in the result.
'
refinedIn: ''
refinement: ''
parameters: #()
returnValues: #( #( 'ByteArray' #'unspecified') )
errors: 'If any elements in the receiver are not integers with values between 0 and 255.
'
!
1 protocolManager newMessagePattern: 'asOrderedCollection'
forProtocolNamed: #'collection'
synopsis: 'Answer an ordered collection whose elements are the elements of the receiver.
'
definedIn: 'collection'
definition: 'Answer a ordered collection with the same elements as the receiver. The result has the same size as the receiver, as defined by the #size message.
If the receiver maintains an ordering for its elements, the order of those elements will be preserved in the result.
'
refinedIn: ''
refinement: ''
parameters: #()
returnValues: #( #( 'OrderedCollection' #'unspecified') )
errors: ''
!
1 protocolManager newMessagePattern: 'asSet'
forProtocolNamed: #'collection'
synopsis: 'Answer a set with the same elements as the receiver.
'
definedIn: 'collection'
definition: 'Answer a set with the same elements as the receiver. Since sets do not store duplicate elements, the result may have fewer elements than the receiver.
The result is undefined if the receiver contains nil.
'
refinedIn: ''
refinement: ''
parameters: #()
returnValues: #( #( 'Set' #'unspecified') )
errors: ''
!
1 protocolManager newMessagePattern: 'asSortedCollection'
forProtocolNamed: #'collection'
synopsis: 'Answer a sorted collection with the same elements as the receiver.
'
definedIn: 'collection'
definition: 'Answer a sorted collection with the same elements as the receiver. The default sort block is used.
'
refinedIn: ''
refinement: ''
parameters: #()
returnValues: #( #( 'SortedCollection' #'unspecified') )
errors: 'If any element of the receiver is not appropriate as a parameter to the default sort block.
'
!
1 protocolManager newMessagePattern: 'asSortedCollection: sortBlock'
forProtocolNamed: #'collection'
synopsis: 'Answer a sorted collection with the same elements as the receiver. The parameter sortBlock is used as the sort block.
'
definedIn: 'collection'
definition: 'Answer a sorted collection with the same elements as the receiver. The parameter sortBlock is used as the sort block and must meet the requirements of a sort block as specified by <SortedCollection>.
'
refinedIn: ''
refinement: ''
parameters: #( #('sortBlock' 'dyadicValuable' #'captured') )
returnValues: #( #( 'SortedCollection' #'unspecified') )
errors: 'If sortBlock does not meet the requirements for a sort block as specified by <SortedCollection>.
If any element of the receiver is not appropriate as a parameter to the sortBlock.
'
!
1 protocolManager newMessagePattern: 'collect: transformer'
forProtocolNamed: #'collection'
synopsis: 'Answer a new collection constructed by gathering the results of evaluating transformer with each element of the receiver.
'
definedIn: 'collection'
definition: 'For each element of the receiver, transformer is evaluated with the element as the parameter. The results of these evaluations are collected into a new collection.
The elements are traversed in the same order as they would be if the message #do: had been sent to the receiver.
Unless specifically refined, this message is defined to answer an object conforming to the same protocol as the receiver.
'
refinedIn: ''
refinement: ''
parameters: #( #('transformer' 'monadicValuable' #'uncaptured') )
returnValues: #( #( 'collection' #'new') )
errors: 'If any element of the receiver is inappropriate for use as arguments to transformer.
If the result of evaluating the transformer does not conform to any element type restrictions of the collection to be returned.
'
!
1 protocolManager newMessagePattern: 'detect: discriminator'
forProtocolNamed: #'collection'
synopsis: 'Return the first element of the receiver which causes discriminator to evaluate to true when the element is used as the argument.
'
definedIn: 'collection'
definition: 'Return the first element of the receiver for which the discriminator evaluates to true when given that element as an argument. The discriminator will only be evaluated until such an object is found or until all of the elements of the collection have been used as arguments. That is, there may be elements of the receiver that are never used as arguments to the discriminator.
The elements are traversed in the same order as they would be if the message #do: had been sent to the receiver.
The result is undefined if discriminator does not evaluate to true for any element.
'
refinedIn: ''
refinement: ''
parameters: #( #('discriminator' 'monadicValuable' #'uncaptured') )
returnValues: #( #( 'Object' #'state') )
errors: 'If the elements of the receiver are inappropriate for use as arguments to discriminator.
If discriminator evaluates to an object that does not conform to the protocol <boolean> for any element of the receiver.
'
!
1 protocolManager newMessagePattern: 'detect: discriminator ifNone: exceptionHandler'
forProtocolNamed: #'collection'
synopsis: 'Return the first element of the receiver which causes discriminator to evaluate to true when used as the argument to the evaluation. Answer the result of evaluating exceptionHandler if no such element is found.
'
definedIn: 'collection'
definition: 'Return the first element of the receiver for which the discriminator evaluates to true when given that element as an argument. The discriminator will only be evaluated until such an object is found or until all of the elements of the collection have been used as arguments. That is, there may be elements of the receiver that are never used as arguments to the discriminator.
The elements are traversed in the same order as they would be if the message #do: had been sent to the receiver.
If no element causes discriminator to evaluate to true, answer the result of exceptionHandler value.
'
refinedIn: ''
refinement: ''
parameters: #( #('exceptionHandler' 'niladicValuable' #'uncaptured') #('discriminator' 'monadicValuable' #'uncaptured') )
returnValues: #( #( 'Object' #'state') #( 'Object' #'unspecified') )
errors: 'If the elements of the receiver are inappropriate for use as arguments to discriminator.
If discriminator evaluates to an object that does not conform to the protocol <boolean> for any element of the receiver.
'
!
1 protocolManager newMessagePattern: 'do: operation'
forProtocolNamed: #'collection'
synopsis: 'Evaluate operation with each element of the receiver.
'
definedIn: 'collection'
definition: 'For each element of the receiver, operation is evaluated with the element as the parameter.
Unless specifically refined, the elements are not traversed in a particular order. Each element is visited exactly once. Conformant protocols may refine this message to specify a particular ordering.
'
refinedIn: ''
refinement: ''
parameters: #( #('operation' 'monadicValuable' #'uncaptured') )
returnValues: #()
errors: 'If the elements of the receiver are inappropriate for use as arguments to operation.
'
!
1 protocolManager newMessagePattern: 'do: separator separatedBy: operation'
forProtocolNamed: #'collection'
synopsis: 'Evaluate operation with each element of the receiver interspersed by evaluation of separator.
'
definedIn: 'collection'
definition: 'For each element of the receiver, operation is evaluated with the element as the parameter. Before evaluating operation the second and subsequent times evaluate separator. Separator is not evaluated if there are less than two elements nor after the last element.
'
refinedIn: ''
refinement: ''
parameters: #( #('separator' 'niladicValuable' #'uncaptured') #('operation' 'monadicValuable' #'uncaptured') )
returnValues: #()
errors: ''
!
1 protocolManager newMessagePattern: 'includes: target'
forProtocolNamed: #'collection'
synopsis: 'Answer true if an element of the receiver is equivalent to target. Answer false otherwise.
'
definedIn: 'collection'
definition: 'This message is used to test an object for inclusion among the receiver''s elements. Answer true if at least one of the receiver''s elements is equivalent to target. Answer false otherwise.
'
refinedIn: ''
refinement: ''
parameters: #( #('target' 'Object' #'uncaptured') )
returnValues: #( #( 'boolean' #'unspecified') )
errors: ''
!
1 protocolManager newMessagePattern: 'inject: operation into: initialValue'
forProtocolNamed: #'collection'
synopsis: 'Answer the final result of evaluating operation using each element of the receiver and the previous evaluation result as the parameters.
'
definedIn: 'collection'
definition: 'The first evaluation of operation is performed with initialValue as the first parameter, and the first element of the receiver as the second parameter. Subsequent evaluations are done with the result of the previous evaluation as the first parameter, and the next element as the second parameter. The result of the last evaluation is answered.
The elements are traversed in the same order as they would be if the message #do: had been sent to the receiver.
'
refinedIn: ''
refinement: ''
parameters: #( #('initialValue' 'Object' #'uncaptured') #('operation' 'dyadicValuable' #'uncaptured') )
returnValues: #( #( 'Object' #'unspecified') )
errors: ''
!
1 protocolManager newMessagePattern: 'isEmpty'
forProtocolNamed: #'collection'
synopsis: 'Return true if the receiver contains no elements. Return false otherwise.
'
definedIn: 'collection'
definition: 'Return true if and only if
receiver size = 0
is true. Otherwise return false.
'
refinedIn: ''
refinement: ''
parameters: #()
returnValues: #( #( 'boolean' #'unspecified') )
errors: ''
!
1 protocolManager newMessagePattern: 'notEmpty'
forProtocolNamed: #'collection'
synopsis: 'Return true if the receiver contains elements. Return false otherwise.
'
definedIn: 'collection'
definition: 'Return true if the receiver contains elements. Return false otherwise. This is equivalent to
receiver isEmpty not
'
refinedIn: ''
refinement: ''
parameters: #()
returnValues: #( #( 'boolean' #'unspecified') )
errors: ''
!
1 protocolManager newMessagePattern: 'occurrencesOf: target'
forProtocolNamed: #'collection'
synopsis: 'Answer the number of elements of the receiver which are equivalent to target.
'
definedIn: 'collection'
definition: 'Answer the number of elements of the receiver which are equivalent to target.
'
refinedIn: ''
refinement: ''
parameters: #( #('target' 'Object' #'uncaptured') )
returnValues: #( #( 'integer' #'unspecified') )
errors: ''
!
1 protocolManager newMessagePattern: 'rehash'
forProtocolNamed: #'collection'
synopsis: 'Re-establish hash invariants, if any.
'
definedIn: 'collection'
definition: 'Re-establish any hash invariants of the receiver.
'
refinedIn: ''
refinement: ''
parameters: #()
returnValues: #()
errors: ''
!
1 protocolManager newMessagePattern: 'reject: discriminator'
forProtocolNamed: #'collection'
synopsis: 'Answer a new collection which includes only the elements in the receiver which cause discriminator to evaluate to false.
'
definedIn: 'collection'
definition: 'For each element of the receiver, discriminator is evaluated with the element as the parameter. Each element which causes discriminator to evaluate to false is included in the new collection.
The elements are traversed in the same order as they would be if the message #do: had been sent to the receiver.
Unless specifically refined, this message is defined to answer an object conforming to the same protocol as the receiver. If both the receiver and the result maintain an ordering of their elements, the elements of the result will be in the same relative order as the elements of the receiver.
'
refinedIn: ''
refinement: ''
parameters: #( #('discriminator' 'monadicValuable' #'uncaptured') )
returnValues: #( #( 'collection' #'new') )
errors: 'If the elements of the receiver are inappropriate for use as arguments to discriminator.
If discriminator evaluates to an object that does not conform to the protocol <boolean> for any element of the receiver.
'
!
1 protocolManager newMessagePattern: 'select: discriminator'
forProtocolNamed: #'collection'
synopsis: 'Answer a new collection which contains only the elements in the receiver which cause discriminator to evaluate to true.
'
definedIn: 'collection'
definition: 'For each element of the receiver, discriminator is evaluated with the element as the parameter. Each element which causes discriminator to evaluate to true is included in the new collection.
The elements are traversed in the same order as they would be if the message #do: had been sent to the receiver.
Unless specifically refined, this message is defined to answer an object conforming to the same protocol as the receiver. If both the receiver and the result maintain an ordering of their elements, the elements of the result will be in the same relative order as the elements of the receiver.
'
refinedIn: ''
refinement: ''
parameters: #( #('discriminator' 'monadicValuable' #'uncaptured') )
returnValues: #( #( 'collection' #'new') )
errors: 'If the elements of the receiver are inappropriate for use as arguments to discriminator.
If discriminator evaluates to an object that does not conform to the protocol <boolean> for any element of the receiver.
'
!
1 protocolManager newMessagePattern: 'size'
forProtocolNamed: #'collection'
synopsis: 'Answer the number of elements in the receiver.
'
definedIn: 'collection'
definition: 'Answer the number of elements in the receiver.
'
refinedIn: ''
refinement: ''
parameters: #()
returnValues: #( #( 'integer' #'unspecified') )
errors: ''
!
(1 protocolManager newProtocolNamed: #'collection factory'
conformsToProtocolNames: #(#'instantiator')
) protocolDescription: '
Provides protocol for creating a collection of objects. A collection can be fixed or variable sized, ordered or unordered, and its elements may or may not be accessible by external keys.
'
!
1 protocolManager newMessagePattern: 'new'
forProtocolNamed: #'collection factory'
synopsis: 'Create a new object.
'
definedIn: 'instantiator'
definition: 'Return a newly created object initialized to a standard initial state.
'
refinedIn: 'collection factory'
refinement: 'This message has the same effect as sending the message #new: with the argument 0.
'
parameters: #()
returnValues: #( #( 'collection' #'new') )
errors: ''
!
1 protocolManager newMessagePattern: 'new: count'
forProtocolNamed: #'collection factory'
synopsis: 'Create a new collection. The parameter count constrains the number of elements in the result.
'
definedIn: 'collection factory'
definition: 'Return a new collection that has space for at least count elements.
Conforming protocols may refine this message. In particular, the effect of the parameter count should be specified in refinements. It can be used to specify the exact number of elements, the minimum number, or in some cases can even be interpreted as a hint from the programmer, with no guarantee that the requested number of instance variables will actually be allocated.
Unless otherwise stated the initial values of elements, if any, of the new collection are unspecified.
'
refinedIn: ''
refinement: ''
parameters: #( #('count' 'integer' #'unspecified') )
returnValues: #( #( 'collection' #'new') )
errors: ''
!
(1 protocolManager newProtocolNamed: #'collectionStream'
conformsToProtocolNames: #(#'sequencedStream')
) protocolDescription: '
An object conforming to <collectionStream> has a <sequencedReadableCollection> as its stream backing store.
'
!
1 protocolManager newMessagePattern: 'contents'
forProtocolNamed: #'collectionStream'
synopsis: 'Returns a collection containing the complete contents of the stream.
'
definedIn: 'sequencedStream'
definition: 'Returns a collection that contains the receiver''s past and future sequence values, in order. The size of the collection is the sum of the sizes of the past and future sequence values.
'
refinedIn: 'collectionStream'
refinement: 'It is unspecified whether or not the returned collection is the same object as the backing store collection. However, if the returned collection is not the same object as the stream backing store collection then the class of the returned collection is the same class as would be returned if the message #select: was sent to the backing store collection.
'
parameters: #()
returnValues: #( #( 'sequencedReadableCollection' #'unspecified') )
errors: ''
!
(1 protocolManager newProtocolNamed: #'DateAndTime'
conformsToProtocolNames: #(#'magnitude')
) protocolDescription: '
This protocol describes the behavior that is common to date time objects. Date time objects represent individual points in Coordinated Universal Time (UTC) as represented in an implementation defined local time.
The exact properties of local times are unspecified. Local times may differ in their offset from UTC. A given local time may have different offsets from UTC at different points in time.
All dates and times in the UTC local time are in the Gregorian calendar. Date times prior to the adoption of the Gregorian calendar are given in the retrospective astronomical Gregorian calendar. The year 1 B.C. is astronomical Gregorian year 0. The year 2 B.C. is astronomical Gregorian year -1. The year 1 A.D. is astronomical Gregorian year 1. The offset of the UTC local time is zero.
'
!
1 protocolManager newMessagePattern: '+ operand'
forProtocolNamed: #'DateAndTime'
synopsis: 'Answer the result of adding operand to the receiver.
'
definedIn: 'DateAndTime'
definition: 'Answer a <DateAndTime> that represents the UTC time that is operand after the receiver and whose local time is the same as the receiver''s. If operand is less than <Duration factory> #zero, the result is the <DateAndTime> that is that is the absolute value of operand before the receiver.
'
refinedIn: ''
refinement: ''
parameters: #( #('operand' 'Duration' #'uncaptured') )
returnValues: #( #( 'DateAndTime' #'new') )
errors: ''
!
1 protocolManager newMessagePattern: '- operand'
forProtocolNamed: #'DateAndTime'
synopsis: 'Answer the result of adding operand to the receiver.
'
definedIn: 'DateAndTime'
definition: 'If operand is a <DateAndTime>, answer a <Duration> whose value is the period of time between the operand and the receiver. If operand is a <DateAndTime> prior to the receiver then the result is a <Duration> less than <Duration factory> #zero.
If operand is a <Duration>, answer a new <DateAndTime> which represents the UTC time that is operand before the receiver and whose local time is the same as the receiver''s. If operand is a duration less than <Duration factory> #zero then the result is a <DateAndTime> that is the absolute value of operand after the receiver.
'
refinedIn: ''
refinement: ''
parameters: #( #('operand' 'Duration DateAndTime' #'uncaptured') )
returnValues: #( #( 'Duration' #'unspecified') #( 'DateAndTime' #'unspecified') )
errors: 'none.
'
!
1 protocolManager newMessagePattern: '< operand'
forProtocolNamed: #'DateAndTime'
synopsis: 'Answer true if the receiver is less than operand. Answer false otherwise.
'
definedIn: 'magnitude'
definition: 'Answer true if the receiver is less than operand with respect to the ordering defined for them. Answer false otherwise.
It is erroneous if the receiver and operand are not comparable.
The semantics of the natural ordering must be defined by refinement, which may also restrict the type of operand.
'
refinedIn: 'DateAndTime'
refinement: 'Answer true if the UTC time represented by operand follows the UTC time represented by the receiver. Answer false otherwise.
If the offsets of the receiver and operand are the same then their order is determined by their lexical order in the sequence #year, #month, #day, #hour24, #minute, #second. If their offsets differ then result is the same as if receiver asUTC < operand asUTC were evaluated.
'
parameters: #( #('operand' 'DateAndTime' #'uncaptured') )
returnValues: #( #( 'boolean' #'unspecified') )
errors: ''
!
1 protocolManager newMessagePattern: '= comparand'
forProtocolNamed: #'DateAndTime'
synopsis: 'Object equivalence test.
'
definedIn: 'Object'
definition: 'This message tests whether the receiver and the comparand are equivalent objects at the time the message is processed. Return true if the receiver is equivalent to comparand. Otherwise return false.
The meaning of "equivalent" cannot be precisely defined but the intent is that two objects are considered equivalent if they can be used interchangeably. Conforming protocols may choose to more precisely define the meaning of "equivalent".
The value of
receiver = comparand
is true if and only if the value of
comparand = receiver
would also be true. If the value of
receiver = comparand
is true then the receiver and comparand must have equivalent hash values. Or more formally:
receiver = comparand ?
receiver hash = comparand hash
The equivalence of objects need not be temporally invariant. Two independent invocations of #= with the same receiver and operand objects may not always yield the same results. Note that a collection that uses #= to discriminate objects may only reliably store objects whose hash values do not change while the objects are contained in the collection.
'
refinedIn: 'DateAndTime'
refinement: 'Answer true if the comparand conforms to <DateAndTime> and if it represents the same UTC time as the receiver. Answer false otherwise. The local times of the receiver and operand are ignored.
'
parameters: #( #('comparand' 'Object' #'uncaptured') )
returnValues: #( #( 'boolean' #'unspecified') )
errors: ''
!
1 protocolManager newMessagePattern: '> operand'
forProtocolNamed: #'DateAndTime'
synopsis: 'Answer true if the receiver is greater than operand. Answer false otherwise.
'
definedIn: 'magnitude'
definition: 'Answer true if the receiver is greater than operand with respect to the natural ordering. Answer false otherwise.
It is erroneous if the receiver and operand are not comparable.
The semantics of the natural ordering must be defined by refinement, which may also restrict the type of operand.
'
refinedIn: 'DateAndTime'
refinement: 'Answer true if the UTC time represented by operand precedes the UTC time represented by the receiver. Answer false otherwise.
If the offsets of the receiver and operand are the same then their order is determined by their lexical order in the sequence #year, #month, #day, #hour24, #minute, #second. If their offsets differ then result is the same as if receiver asUTC > operand asUTC were evaluated.
'
parameters: #( #('operand' 'DateAndTime' #'uncaptured') )
returnValues: #( #( 'boolean' #'unspecified') )
errors: ''
!
1 protocolManager newMessagePattern: 'asLocal'
forProtocolNamed: #'DateAndTime'
synopsis: 'Answer a <DateAndTime> that represents the same UTC time as the receiver but in the local time specified by the implementation.
'
definedIn: 'DateAndTime'
definition: 'Answer a <DateAndTime> that represents the same UTC time as the receiver but in the local time specified by the implementation.
'
refinedIn: ''
refinement: ''
parameters: #()
returnValues: #( #( 'DateAndTime' #'unspecified') )
errors: ''
!
1 protocolManager newMessagePattern: 'asUTC'
forProtocolNamed: #'DateAndTime'
synopsis: 'Answer a <DateAndTime> that represents the same absolute time as the receiver but in the local time UTC.
'
definedIn: 'DateAndTime'
definition: 'Answer a <DateAndTime> that represents the same absolute time as the receiver but in the local time UTC. The exact meaning of UTC local time is specified by the implementation. The UTC local time must use the Gregorian calendar. <DateAndTimes> representing UTC times prior to the adoption of the Gregorian calendar must use the retrospective astronomical Gregorian calendar. It is an invariant that
<DateAndTime> asUTC offset = Duration zero.
'
refinedIn: ''
refinement: ''
parameters: #()
returnValues: #( #( 'DateAndTime' #'unspecified') )
errors: ''
!
1 protocolManager newMessagePattern: 'dayOfMonth'
forProtocolNamed: #'DateAndTime'
synopsis: 'Answer the number of the day in the month in the local time of the receiver which includes the receiver.
'
definedIn: 'DateAndTime'
definition: 'Answer an <integer> between 1 and 31 inclusive representing the number of the day in the month, in the local time of the receiver, which includes the receiver.
'
refinedIn: ''
refinement: ''
parameters: #()
returnValues: #( #( 'integer' #'unspecified') )
errors: ''
!
1 protocolManager newMessagePattern: 'dayOfWeek'
forProtocolNamed: #'DateAndTime'
synopsis: 'Answer the number of the day in the week, in the local time of the receiver, which includes the receiver.
'
definedIn: 'DateAndTime'
definition: 'Answer an <integer> between 1 and 7 inclusive representing the number of the day in the week, in the local time of the receiver, which includes the receiver. Sunday is 1, Monday is 2, and so on.
'
refinedIn: ''
refinement: ''
parameters: #()
returnValues: #( #( 'integer' #'unspecified') )
errors: ''
!
1 protocolManager newMessagePattern: 'dayOfWeekAbbreviation'
forProtocolNamed: #'DateAndTime'
synopsis: 'Answer the abbreviation of the name, in the local time of the receiver, of the day of the week which includes the receiver.
'
definedIn: 'DateAndTime'
definition: 'Answer an <readableString> which is the abbreviation of the name, in the local time of the receiver, of the day of the week which includes the receiver.
'
refinedIn: ''
refinement: ''
parameters: #()
returnValues: #( #( 'readableString' #'unspecified') )
errors: ''
!
1 protocolManager newMessagePattern: 'dayOfWeekName'
forProtocolNamed: #'DateAndTime'
synopsis: 'Answer the name, in the local time of the receiver, of the day of the week which includes the receiver.
'
definedIn: 'DateAndTime'
definition: 'Answer an <readableString> which is the name, in the local time of the receiver, of the day of the week which includes the receiver.
'
refinedIn: ''
refinement: ''
parameters: #()
returnValues: #( #( 'readableString' #'unspecified') )
errors: ''
!
1 protocolManager newMessagePattern: 'dayOfYear'
forProtocolNamed: #'DateAndTime'
synopsis: 'Answer the number of the day in the year, in the local time of the receiver, which includes the receiver.
'
definedIn: 'DateAndTime'
definition: 'Answer an <integer> between 1 and 366 inclusive representing the number of the day in the year, in the local time of the receiver, which includes the receiver.
'
refinedIn: ''
refinement: ''
parameters: #()
returnValues: #( #( 'integer' #'unspecified') )
errors: ''
!
1 protocolManager newMessagePattern: 'hour'
forProtocolNamed: #'DateAndTime'
synopsis: 'Answer the number of the hour in the day, in the local time of the receiver, which includes the receiver.
'
definedIn: 'DateAndTime'
definition: 'Answer an <integer> between 0 and 23 inclusive representing the number of the hour in the day, in the local time of the receiver, which includes the receiver. It is implementation defined whether a given local time uses the 12-hour clock or the 24-hour clock, except that the UTC local time must use the 24-hour clock.
'
refinedIn: ''
refinement: ''
parameters: #()
returnValues: #( #( 'integer' #'unspecified') )
errors: ''
!
1 protocolManager newMessagePattern: 'hour12'
forProtocolNamed: #'DateAndTime'
synopsis: 'Answer the hour in the day in the 12-hour clock of the local time of the receiver.
'
definedIn: 'DateAndTime'
definition: 'Answer an <integer> between 1 and 12 inclusive representing the hour in the day in the 12-hour clock of the local time of the receiver.
'
refinedIn: ''
refinement: ''
parameters: #()
returnValues: #( #( 'integer' #'unspecified') )
errors: ''
!
1 protocolManager newMessagePattern: 'hour24'
forProtocolNamed: #'DateAndTime'
synopsis: 'Answer the hour in the day in the 24-hour clock of the local time of the receiver.
'
definedIn: 'DateAndTime'
definition: 'Answer an <integer> between 0 and 23 inclusive representing the hour in the day in the 24-hour clock of the local time of the receiver.
'
refinedIn: ''
refinement: ''
parameters: #()
returnValues: #( #( 'integer' #'unspecified') )
errors: ''
!
1 protocolManager newMessagePattern: 'isLeapYear'
forProtocolNamed: #'DateAndTime'
synopsis: 'Test for leap year.
'
definedIn: 'DateAndTime'
definition: 'Answer true if the year, which includes the receiver, in the local time of the receiver is a leap year, false otherwise.
Two <DateAndTime> objects that are equal can give different results for #isLeapYear. Equality depends on their UTC time whereas #isLeapYear depends on their local time.
'
refinedIn: ''
refinement: ''
parameters: #()
returnValues: #( #( 'boolean' #'unspecified') )
errors: ''
!
1 protocolManager newMessagePattern: 'meridianAbbreviation'
forProtocolNamed: #'DateAndTime'
synopsis: 'Answer the abbreviation, in the local time of the receiver, of the name of the half of the day, which includes the receiver.
'
definedIn: 'DateAndTime'
definition: 'Answer a <readableString> that is the abbreviation, in the local time of the receiver, of the name of the half of the day, which includes the receiver.
'
refinedIn: ''
refinement: ''
parameters: #()
returnValues: #( #( 'readableString' #'unspecified') )
errors: ''
!
1 protocolManager newMessagePattern: 'minute'
forProtocolNamed: #'DateAndTime'
synopsis: 'Answer the minute of the hour in the local time of the receiver.
'
definedIn: 'DateAndTime'
definition: 'Answer an <integer> between 0 and 59 inclusive representing the minute of hour in the local time of the receiver.
'
refinedIn: ''
refinement: ''
parameters: #()
returnValues: #( #( 'integer' #'unspecified') )
errors: ''
!
1 protocolManager newMessagePattern: 'month'
forProtocolNamed: #'DateAndTime'
synopsis: 'Answer the number of the month in the year, in the local time of the receiver, which includes the receiver.
'
definedIn: 'DateAndTime'
definition: 'Answer an <integer> between 1 and 12 inclusive representing the number of the month in the year, in the local time of the receiver, which includes the receiver.
'
refinedIn: ''
refinement: ''
parameters: #()
returnValues: #( #( 'integer' #'unspecified') )
errors: ''
!
1 protocolManager newMessagePattern: 'monthAbbreviation'
forProtocolNamed: #'DateAndTime'
synopsis: 'Answer the abbreviation of the name of the month, in the local time of the receiver, which includes the receiver.
'
definedIn: 'DateAndTime'
definition: 'Answer a <readableString> that is the abbreviation of the name of the month, in the local time of the receiver, which includes the receiver.
'
refinedIn: ''
refinement: ''
parameters: #()
returnValues: #( #( 'readableString' #'unspecified') )
errors: ''
!
1 protocolManager newMessagePattern: 'monthName'
forProtocolNamed: #'DateAndTime'
synopsis: 'Answer the name of the month, in the local time of the receiver, which includes the receiver.
'
definedIn: 'DateAndTime'
definition: 'Answer a <readableString> that is the name of the month, in the local time of the receiver, which includes the receiver.
'
refinedIn: ''
refinement: ''
parameters: #()
returnValues: #( #( 'readableString' #'unspecified') )
errors: ''
!
1 protocolManager newMessagePattern: 'offset'
forProtocolNamed: #'DateAndTime'
synopsis: 'Answer the difference between the local time of the receiver and UTC at the time of the receiver.
'
definedIn: 'DateAndTime'
definition: 'Answer a <Duration> representing the difference between the local time of the receiver and UTC at the time of the receiver.
'
refinedIn: ''
refinement: ''
parameters: #()
returnValues: #( #( 'Duration' #'unspecified') )
errors: ''
!
1 protocolManager newMessagePattern: 'offset: offset'
forProtocolNamed: #'DateAndTime'
synopsis: 'Answer a <DateAndTime> equivalent to the receiver but with its local time being offset from UTC by offset.
'
definedIn: 'DateAndTime'
definition: 'Answer a <DateAndTime> equivalent to the receiver but with its local time being offset from UTC by offset. The impact of this on any other local time property is unspecified.
Implementations may define a limit to the range of offset, but it must be at least
-12:00:00 to 12:00:00 inclusive.
It is an invariant that if x is a <Duration> in range then
(<DateAndTime> offset: x) offset = x
'
refinedIn: ''
refinement: ''
parameters: #( #('offset' 'Duration' #'unspecified') )
returnValues: #( #( 'DateAndTime' #'unspecified') )
errors: 'offset out of range
'
!
1 protocolManager newMessagePattern: 'printString'
forProtocolNamed: #'DateAndTime'
synopsis: 'Return a string that describes the receiver.
'
definedIn: 'Object'
definition: 'A string consisting of a sequence of characters that describe the receiver are returned as the result.
The exact sequence of characters that describe an object are implementation defined.
'
refinedIn: 'DateAndTime'
refinement: 'The returned string will represent the UTC time of the receiver offset from UTC by the offset of the receiver. All dates are in the astronomical Gregorian calendar. The result will be formatted as
-YYYY-MM-DDThh:mm:ss.s+ZZ:zz:z where
- is the <Character> $- if the year is less than 0 otherwise it is the <Character> that is returned from the message #space sent to the standard global Character,
YYYY is the year left zero filled to four places,
- is the <Character> $-,
MM is the month of the year left zero filled to two places,
- is the <Character> $-,
DD is the day of the month left zero filled to two places,
T is the <Character> $T,
hh is the hour in the 24-hour clock left zero filled to two places,
: is the <Character> $:,
mm is the minute left zero filled to two places,
: is the <Character> $:,
ss is the second left zero filled to two places,
. is the <Character> $. and is present only if the fraction of a second is non-zero,
s is the fraction of a second and is present only if non-zero,
+ is the <Character> $+ if the offset is greater than or equal to <Duration factory> #zero and the <Character> $- if it is less,
ZZ is the hours of the offset left zero filled to two places, and
: is the <Character> $:,
zz is the minutes of the offset left zero filled to two places,
: is the <Character> $: and is present only if the seconds of the offset is non-zero,
z is the seconds of the offset including any fractional part and is present only if non-zero.
This format is based on ISO 8601 sections 5.3.3 and 5.4.1.
Example: 8:33:14.321 PM EST January 5, 1200 B.C.
''-1199-01-05T20:33:14.321-05:00''
Example: 12 midnight UTC January 1, 2001 A.D.
'' 2001-01-01T00:00:00+00:00''
'
parameters: #()
returnValues: #( #( 'readableString' #'unspecified') )
errors: ''
!
1 protocolManager newMessagePattern: 'second'
forProtocolNamed: #'DateAndTime'
synopsis: 'Answer the second of the minute of the local time of the receiver.
'
definedIn: 'DateAndTime'
definition: 'Answer a <number> greater than or equal to 0 and strictly less than 60 representing the second of the minute of the local time of the receiver.
'
refinedIn: ''
refinement: ''
parameters: #()
returnValues: #( #( 'number' #'unspecified') )
errors: ''
!
1 protocolManager newMessagePattern: 'timeZoneAbbreviation'
forProtocolNamed: #'DateAndTime'
synopsis: 'Answer the abbreviation of the name, in the local time of the receiver, of the time zone of the receiver.
'
definedIn: 'DateAndTime'
definition: 'Answer a <readableString> that is the abbreviation of the name, in the local time of the receiver, of the time zone of the receiver.
'
refinedIn: ''
refinement: ''
parameters: #()
returnValues: #( #( 'readableString' #'unspecified') )
errors: ''
!
1 protocolManager newMessagePattern: 'timeZoneName'
forProtocolNamed: #'DateAndTime'
synopsis: 'Answer the name in the local time of the receiver of the time zone of the receiver.
'
definedIn: 'DateAndTime'
definition: 'Answer a <readableString> that is the name in the local time of the receiver of the time zone of the receiver.
'
refinedIn: ''
refinement: ''
parameters: #()
returnValues: #( #( 'readableString' #'unspecified') )
errors: ''
!
1 protocolManager newMessagePattern: 'year'
forProtocolNamed: #'DateAndTime'
synopsis: 'Answer the number of the year in the local time of the receiver which includes the receiver.
'
definedIn: 'DateAndTime'
definition: 'Answer an<integer> the number of the year which includes the receiver.
'
refinedIn: ''
refinement: ''
parameters: #()
returnValues: #( #( 'integer' #'unspecified') )
errors: ''
!
(1 protocolManager newProtocolNamed: #'DateAndTime factory'
conformsToProtocolNames: #(#'Object')
) protocolDescription: '
Represents protocol for creating an abstraction for a particular day of the year.
Standard Globals
DateTime Conforms to the protocol <DateAndTime factory>. Its language element type is unspecified.
'
!
1 protocolManager newMessagePattern: 'clockPrecision'
forProtocolNamed: #'DateAndTime factory'
synopsis: 'Answer a <Duration> such that after that period of time passes, #now is guaranteed to give a different result.
'
definedIn: 'DateAndTime factory'
definition: 'Answer a <Duration> such that after that period of time passes, #now is guaranteed to give a different result. Ideally implementations should answer the least such duration.
Return Value:
<Duration> unspecified
'
refinedIn: ''
refinement: ''
parameters: #()
returnValues: #()
errors: ''
!
1 protocolManager newMessagePattern: 'now'
forProtocolNamed: #'DateAndTime factory'
synopsis: 'Answer a <DateAndTime> representing the current date and time.
'
definedIn: 'DateAndTime factory'
definition: 'Answer a <DateAndTime> representing the current date and time in the local time specified by the implementation.
'
refinedIn: ''
refinement: ''
parameters: #()
returnValues: #( #( 'DateAndTime' #'unspecified') )
errors: ''
!
1 protocolManager newMessagePattern: 'year: hour day: dayOfYear hour: minute minute: second second: year'
forProtocolNamed: #'DateAndTime factory'
synopsis: 'Answer a <DateAndTime> which is the second second of the minute minute of the hour hour of the day dayOfYear of the year year of the astronomical Gregorian calendar in local time.
'
definedIn: 'DateAndTime factory'
definition: 'Answer the least <DateAndTime> which is the second second of the minute minute of the hour hour of the day dayOfYear of the year year of the astronomical Gregorian calendar in the local time specified by the implementation. The second must be a <number> greater than or equal to 0 and strictly less than 60. The minute must be an <integer> between 0 and 59 inclusive. The hour must be an <integer> between 0 and 23 inclusive. The day must be an <integer> between 1 and 366 inclusive. An implementation may not impose any limits on the year other than those imposed on <integer> constants.
It is possible that the time specified does not exist in the local time specified by the implementation. If there is a time change such that the local time is set forward and the time specified is in the interregnum, then that time does not exist in the local time. For example if at 02:00 in California on April 26, 1997 there is a time change that sets local time forward one hour, then the local time 02:30 in California does not exist. Conversely if there is a time change that sets the locale time back there are times which are ambiguous. For example if instead of setting the local time forward from 02:00 to 03:00 it is set back to 01:00 the the local time 01:30 in California is ambiguious. The result is the least <DateAndTime> that conforms to the given parameters.
It is worth noting that the year 1 B.C. is year 0 in the astronomical Gregorian calendar. Similarly the year 2 B.C. is year -1 in the astronomical Gregorian calendar and so on. The year 1 A.D. is year 1 in the astronomical Gregorian calendar.
'
refinedIn: ''
refinement: ''
parameters: #( #('year' 'integer' #'unspecified') #('dayOfYear' 'integer' #'unspecified') #('hour' 'integer' #'unspecified') #('minute' 'integer' #'unspecified') #('second' 'number' #'unspecified') )
returnValues: #( #( 'DateAndTime' #'new') )
errors: 'month is not between 1 and 12 inclusive.
dayOfYear greater than the number of days in the year year of the astronomical Gregorian calendar.
hour is not between 0 and 23 inclusive.
minute is not between 0 and 59 inclusive.
second is not greater than or equal to 0 and strictly less than 60.
the time specified does not exist.
'
!
1 protocolManager newMessagePattern: 'year: minute day: hour hour: second minute: dayOfYear second: year offset: offset'
forProtocolNamed: #'DateAndTime factory'
synopsis: 'Answer a <DateAndTime> which is the second second of the minute minute of the hour hour of the day dayOfYear of the year year of the astronomical Gregorian calendar offset from UTC by offset.
'
definedIn: 'DateAndTime factory'
definition: 'Answer the least <DateAndTime> which is the second second of the minute minute of the hour hour of the day dayOfYear of the year year of the astronomical Gregorian calendar in the local time of the locale locale. The second must be a <number> greater than or equal to 0 and strictly less than 60. The minute must be an <integer> between 0 and 59 inclusive. The hour must be an <integer> between 0 and 23 inclusive. The day must be an <integer> between 1 and 366 inclusive. An implementation may not impose any limits on the year other than those imposed on <integer> constants.
It is possible that the time specified does not exist in the local time defined by the implementation. If there is a time change such that the local time is set forward and the time specified is in the interregnum, then that time does not exist in the local time. For example if at 02:00 in California on April 26, 1997 there is a time change that sets local time forward one hour, then the local time 02:30 in California does not exist. Conversely if there is a time change that sets the locale time back there are times which are ambiguous. For example if instead of setting the local time forward from 02:00 to 03:00 it is set back to 01:00 the the local time 01:30 in California is ambiguious. The result is the least <DateAndTime> that conforms to the given parameters.
'
refinedIn: ''
refinement: ''
parameters: #( #('second' 'number' #'unspecified') #('hour' 'integer' #'unspecified') #('offset' 'Duration' #'unspecified') #('year' 'integer' #'unspecified') #('dayOfYear' 'integer' #'unspecified') #('minute' 'integer' #'unspecified') )
returnValues: #( #( 'DateAndTime' #'new') )
errors: 'month is not between 1 and 12 inclusive.
dayOfYear greater than the number of days in the year year of the astronomical Gregorian calendar.
hour is not between 0 and 23 inclusive.
minute is not between 0 and 59 inclusive.
second is not greater than or equal to 0 and strictly less than the number of seconds in the minute specified.
'
!
1 protocolManager newMessagePattern: 'year: hour month: second day: dayOfMonth hour: year minute: month second: minute'
forProtocolNamed: #'DateAndTime factory'
synopsis: 'Answer a <DateAndTime> which is the second second of the minute minute of the hour hour of the day dayOfMonth of the month month of the year year of the astronomical Gregorian calendar in local time.
'
definedIn: 'DateAndTime factory'
definition: 'Answer the least <DateAndTime> which is the second second of the minute minute of the hour hour of the day dayOfMonth of the month month of the year year of the astronomical Gregorian calendar in the local time specified by the implementation. The second must be a <number> greater than or equal to 0 and strictly less than 60. The minute must be an <integer> between 0 and 59 inclusive. The hour must be an <integer> between 0 and 23 inclusive. The day must be an <integer> between 1 and 31 inclusive. The month must be an <integer> between 1 and 12 inclusive. An implementation may not impose any limits on the year other than those imposed on <integer> constants.
It is possible that the time specified does not exist in the local time defined by the implementation. If there is a time change such that the local time is set forward and the time specified is in the interregnum, then that time does not exist in the local time. For example if at 02:00 in California on April 26, 1997 there is a time change that sets local time forward one hour, then the local time 02:30 in California does not exist. Conversely if there is a time change that sets the locale time back there are times which are ambiguous. For example if instead of setting the local time forward from 02:00 to 03:00 it is set back to 01:00 the the local time 01:30 in California is ambiguious. The result is the least <DateAndTime> that conforms to the given parameters.
'
refinedIn: ''
refinement: ''
parameters: #( #('hour' 'integer' #'unspecified') #('second' 'number' #'unspecified') #('minute' 'integer' #'unspecified') #('month' 'integer' #'unspecified') #('dayOfMonth' 'integer' #'unspecified') #('year' 'integer' #'unspecified') )
returnValues: #( #( 'DateAndTime' #'new') )
errors: 'month is not between 1 and 12 inclusive.
dayOfMonth greater than the number of days in the month month of year year of the astronomical Gregorian calendar.
hour is not between 0 and 23 inclusive.
minute is not between 0 and 59 inclusive.
second is not greater than or equal to 0 and strictly less than 60.
the time specified does not exist.
'
!
1 protocolManager newMessagePattern: 'year: hour month: minute day: month hour: second minute: offset second: dayOfMonth offset: year'
forProtocolNamed: #'DateAndTime factory'
synopsis: 'Answer a <DateAndTime> which is the second second of the minute minute of the hour hour of the day dayOfMonth of the month month of the year year of the astronomical Gregorian calendar offset from UTC by offset.
'
definedIn: 'DateAndTime factory'
definition: 'Answer the least <DateAndTime> which is the second second of the minute minute of the hour hour of the day dayOfMonth of the month month of the year year of the astronomical Gregorian calendar offset from UTC by offset. The second must be a <number> greater than or equal to 0 and strictly less than 60. The minute must be an <integer> between 0 and 59 inclusive. The hour must be an <integer> between 0 and 23 inclusive. The day must be an <integer> between 1 and 31 inclusive. The month must be an <integer> between 1 and 12 inclusive. An implementation may not impose any limits on the year other than those imposed on <integer> constants.
It is possible that the time specified does not exist in the local time defined by the implementation. If there is a time change such that the local time is set forward and the time specified is in the interregnum, then that time does not exist in the local time. For example if at 02:00 in California on April 26, 1997 there is a time change that sets local time forward one hour, then the local time 02:30 in California does not exist. Conversely if there is a time change that sets the locale time back there are times which are ambiguous. For example if instead of setting the local time forward from 02:00 to 03:00 it is set back to 01:00 the the local time 01:30 in California is ambiguious. The result is the least <DateAndTime> that conforms to the given parameters.
'
refinedIn: ''
refinement: ''
parameters: #( #('minute' 'integer' #'unspecified') #('hour' 'integer' #'unspecified') #('month' 'integer' #'unspecified') #('second' 'number' #'unspecified') #('offset' 'Duration' #'unspecified') #('dayOfMonth' 'integer' #'unspecified') #('year' 'integer' #'unspecified') )
returnValues: #( #( 'DateAndTime' #'new') )
errors: 'month is not between 1 and 12 inclusive.
dayOfMonth greater than the number of days in the month month of year year of the astronomical Gregorian calendar.
hour is not between 0 and 23 inclusive.
minute is not between 0 and 59 inclusive.
second is not greater than or equal to 0 and strictly less than 60.
'
!
(1 protocolManager newProtocolNamed: #'Dictionary'
conformsToProtocolNames: #(#'abstractDictionary')
) protocolDescription: '
Represents an unordered collection whose elements can be accessed using an explicitly assigned external key. Key equivalence is defined as sending the #= message.
'
!
(1 protocolManager newProtocolNamed: #'Dictionary factory'
conformsToProtocolNames: #(#'collection factory')
) protocolDescription: '
This protocol defines the behavior of objects that can be used to create objects that conform to the protocol <Dictionary>.
Standard Globals
Dictionary Conforms to the protocol <Dictionary factory>. Its language element type is unspecified. This is a factory and discriminator for collections that conform to <Dictionary>.
'
!
1 protocolManager newMessagePattern: 'new'
forProtocolNamed: #'Dictionary factory'
synopsis: 'Create a new object.
'
definedIn: 'instantiator'
definition: 'Return a newly created object initialized to a standard initial state.
'
refinedIn: 'Dictionary factory'
refinement: 'Return a new <Dictionary> that is optimized to store an implementation defined number of elements. The new collection initially contains no elements.
'
parameters: #()
returnValues: #( #( 'Dictionary' #'new') )
errors: ''
!
1 protocolManager newMessagePattern: 'new: count'
forProtocolNamed: #'Dictionary factory'
synopsis: 'Create a new collection. The parameter count constrains the number of elements in the result.
'
definedIn: 'collection factory'
definition: 'Return a new collection that has space for at least count elements.
Conforming protocols may refine this message. In particular, the effect of the parameter count should be specified in refinements. It can be used to specify the exact number of elements, the minimum number, or in some cases can even be interpreted as a hint from the programmer, with no guarantee that the requested number of instance variables will actually be allocated.
Unless otherwise stated the initial values of elements of the new instance of the receiver are unspecified.
'
refinedIn: 'Dictionary factory'
refinement: 'The parameter count represents a hint for space allocation. The new collection is to optimized to contain count elements. The new collection initially contains no elements.
The new collection conforms to the protocol <Dictionary>.
'
parameters: #( #('count' 'integer' #'unspecified') )
returnValues: #( #( 'Dictionary' #'new') )
errors: ''
!
1 protocolManager newMessagePattern: 'withAll: newElements'
forProtocolNamed: #'Dictionary factory'
synopsis: 'Create a collection containing all the elements of newElements.
'
definedIn: 'Dictionary factory'
definition: 'Return a new collection whose elements are the elements of newElements. The effect is the same as evaluating Dictionary new addAll: newElements; yourself.
'
refinedIn: ''
refinement: ''
parameters: #( #('newElements' 'abstractDictionary' #'unspecified') )
returnValues: #( #( 'Dictionary' #'new') )
errors: ''
!
(1 protocolManager newProtocolNamed: #'Duration'
conformsToProtocolNames: #(#'magnitude')
) protocolDescription: '
Represents a length of time.
'
!
1 protocolManager newMessagePattern: '* operand'
forProtocolNamed: #'Duration'
synopsis: 'Answer the result of multiplying the receiver by operand.
'
definedIn: 'Duration'
definition: 'Answer a <Duration> that is the result of multiplying the receiver by operand.
'
refinedIn: ''
refinement: ''
parameters: #( #('operand' 'number' #'unspecified') )
returnValues: #( #( 'Duration' #'new') )
errors: ''
!
1 protocolManager newMessagePattern: '+ operand'
forProtocolNamed: #'Duration'
synopsis: 'Answer the result of adding operand to the receiver.
'
definedIn: 'Duration'
definition: 'Answer a <Duration> whose value is the result of adding the receiver and operand.
'
refinedIn: ''
refinement: ''
parameters: #( #('operand' 'Duration' #'unspecified') )
returnValues: #( #( 'Duration' #'new') )
errors: ''
!
1 protocolManager newMessagePattern: '- operand'
forProtocolNamed: #'Duration'
synopsis: 'Answer the result of subtracting the operand from the receiver.
'
definedIn: 'Duration'
definition: 'Answer a <Duration> whose value is the result of subtracting operand from the receiver.
'
refinedIn: ''
refinement: ''
parameters: #( #('operand' 'Duration' #'unspecified') )
returnValues: #( #( 'Duration' #'new') )
errors: ''
!
1 protocolManager newMessagePattern: '/ operand'
forProtocolNamed: #'Duration'
synopsis: 'Answer the result of dividing the receiver by operand.
'
definedIn: 'Duration'
definition: 'If operand is a <number> answer a new <Duration> whose value is the result of dividing the receiver by operand. If operand equals zero the ZeroDivide exception is signaled.
If operand is a <Duration> answer a <number> whose value is the result of dividing the receiver by operand. If operand is <Duration factory> #zero the ZeroDivide exception is signaled.
'
refinedIn: ''
refinement: ''
parameters: #( #('operand' 'Duration number' #'unspecified') )
returnValues: #( #( 'number' #'unspecified') #( 'Duration' #'unspecified') )
errors: ''
!
1 protocolManager newMessagePattern: '< operand'
forProtocolNamed: #'Duration'
synopsis: 'Answer true if the receiver is less than operand. Answer false otherwise.
'
definedIn: 'magnitude'
definition: 'Answer true if the receiver is less than operand with respect to the ordering defined for them. Answer false otherwise.
It is erroneous if the receiver and operand are not comparable.
The semantics of the natural ordering must be defined by refinement, which may also restrict the type of operand.
'
refinedIn: 'Duration'
refinement: 'Answer true if operand represents a <Duration> that is larger than the receiver. Answer false otherwise.
'
parameters: #( #('operand' 'Duration' #'unspecified') )
returnValues: #( #( 'boolean' #'unspecified') )
errors: ''
!
1 protocolManager newMessagePattern: '= comparand'
forProtocolNamed: #'Duration'
synopsis: 'Object equivalence test.
'
definedIn: 'Object'
definition: 'This message tests whether the receiver and the comparand are equivalent objects at the time the message is processed. Return true if the receiver is equivalent to comparand. Otherwise return false.
The meaning of "equivalent" cannot be precisely defined but the intent is that two objects are considered equivalent if they can be used interchangeably. Conforming protocols may choose to more precisely define the meaning of "equivalent".
The value of
receiver = comparand
is true if and only if the value of
comparand = receiver
would also be true. If the value of
receiver = comparand
is true then the receiver and comparand must have equivalent hash values. Or more formally:
receiver = comparand ?
receiver hash = comparand hash
The equivalence of objects need not be temporally invariant. Two independent invocations of #= with the same receiver and operand objects may not always yield the same results. Note that a collection that uses #= to discriminate objects may only reliably store objects whose hash values do not change while the objects are contained in the collection.
'
refinedIn: 'Duration'
refinement: 'Answer true if the comparand is a <Duration> representing the same length of time as the receiver. Answer false otherwise.
'
parameters: #( #('comparand' 'Object' #'uncaptured') )
returnValues: #( #( 'boolean' #'unspecified') )
errors: ''
!
1 protocolManager newMessagePattern: '> operand'
forProtocolNamed: #'Duration'
synopsis: 'Answer true if the receiver is greater than operand. Answer false otherwise.
'
definedIn: 'magnitude'
definition: 'Answer true if the receiver is greater than operand with respect to the natural ordering. Answer false otherwise.
It is erroneous if the receiver and operand are not comparable.
The semantics of the natural ordering must be defined by refinement, which may also restrict the type of operand.
'
refinedIn: 'Duration'
refinement: 'Answer true if operand represents a <Duration> which is smaller than the receiver. Answer false otherwise.
'
parameters: #( #('operand' 'Duration' #'unspecified') )
returnValues: #( #( 'boolean' #'unspecified') )
errors: ''
!
1 protocolManager newMessagePattern: 'abs'
forProtocolNamed: #'Duration'
synopsis: 'Answer the absolute value of the receiver.
'
definedIn: 'Duration'
definition: 'If the receiver is greater than or equal to <Duration Factory> #zero answer a <Duration> which is equal to the receiver. Otherwise answer a <Duration> which has the same magnitude as the receiver but the opposite sign.
'
refinedIn: ''
refinement: ''
parameters: #()
returnValues: #( #( 'Duration' #'unspecified') )
errors: ''
!
1 protocolManager newMessagePattern: 'asSeconds'
forProtocolNamed: #'Duration'
synopsis: 'Answer the total number of seconds in the length of time represented by the receiver.
'
definedIn: 'Duration'
definition: 'Answer the total number of seconds in the length of time represented by the receiver including any fractional part of a second. If the receiver is less than <Duration factory> #zero then the result will be less than 0.
'
refinedIn: ''
refinement: ''
parameters: #()
returnValues: #( #( 'number' #'unspecified') )
errors: ''
!
1 protocolManager newMessagePattern: 'days'
forProtocolNamed: #'Duration'
synopsis: 'Answer the number of complete days in the receiver.
'
definedIn: 'Duration'
definition: 'Answer the number of complete days in the receiver. If the receiver is less than <Duration factory> #zero then the result will be less than or equal to 0.
'
refinedIn: ''
refinement: ''
parameters: #()
returnValues: #( #( 'integer' #'unspecified') )
errors: ''
!
1 protocolManager newMessagePattern: 'hours'
forProtocolNamed: #'Duration'
synopsis: 'Answer the number of complete hours in the receiver.
'
definedIn: 'Duration'
definition: 'Answer an <integer> between -23 and 23 inclusive that represents the number of complete hours in the receiver, after the number of complete days has been removed. If the receiver is less than <Duration factory> #zero then the result will be less than or equal to 0.
'
refinedIn: ''
refinement: ''
parameters: #()
returnValues: #( #( 'integer' #'unspecified') )
errors: ''
!
1 protocolManager newMessagePattern: 'minutes'
forProtocolNamed: #'Duration'
synopsis: 'Answer the number of complete minutes in the receiver.
'
definedIn: 'Duration'
definition: 'Answer an <integer> between -59 and 59 inclusive that represents the number of complete minutes in the receiver, after the number of complete days and hours have been removed. If the receiver is less than <Duration factory> #zero then the result will be less than or equal to 0.
'
refinedIn: ''
refinement: ''
parameters: #()
returnValues: #( #( 'integer' #'unspecified') )
errors: ''
!
1 protocolManager newMessagePattern: 'negated'
forProtocolNamed: #'Duration'
synopsis: 'Answer the negation of the receiver.
'
definedIn: 'Duration'
definition: 'Answer a <Duration> which is of the same magnitude but opposite sign as the receiver.
'
refinedIn: ''
refinement: ''
parameters: #()
returnValues: #( #( 'Duration' #'unspecified') )
errors: ''
!
1 protocolManager newMessagePattern: 'negative'
forProtocolNamed: #'Duration'
synopsis: 'Answer true if the receiver is less than <Duration factory> #zero.
'
definedIn: 'Duration'
definition: 'Answer true if the receiver is less than <Duration factory> #zero, false otherwise.
'
refinedIn: ''
refinement: ''
parameters: #()
returnValues: #( #( 'boolean' #'unspecified') )
errors: ''
!
1 protocolManager newMessagePattern: 'positive'
forProtocolNamed: #'Duration'
synopsis: 'Answer true if the receiver is greater than or equal to <Duration factory> #zero.
'
definedIn: 'Duration'
definition: 'Answer true if the receiver is greater than or equal to the <Duration factory> #zero, false otherwise.
'
refinedIn: ''
refinement: ''
parameters: #()
returnValues: #( #( 'boolean' #'unspecified') )
errors: ''
!
1 protocolManager newMessagePattern: 'printString'
forProtocolNamed: #'Duration'
synopsis: 'Return a string that describes the receiver.
'
definedIn: 'Object'
definition: 'A string consisting of a sequence of characters that describe the receiver are returned as the result.
The exact sequence of characters that describe an object is implementation defined.
'
refinedIn: 'Duration'
refinement: 'Answer a description of the receiver that is formatted as
[-]D:HH:MM:SS[.S] where
- is a minus sign if the receiver represents a length of time going from the future into the past,
D is the number of complete days with leading zeros to fill one place,
HH is the number of complete hours with leading zeros to fill two places,
MM is the number of complete minutes with leading zeros to fill two places,
SS is. the number of complete seconds with leading zeros to fill two places, and
.S is the fractional part of the number of seconds, if any.
'
parameters: #()
returnValues: #( #( 'readableString' #'unspecified') )
errors: ''
!
1 protocolManager newMessagePattern: 'seconds'
forProtocolNamed: #'Duration'
synopsis: 'Answer the number of seconds in the receiver.
'
definedIn: 'Duration'
definition: 'Answer a <number> strictly greater than -60 and strictly less than 60 that represents the number of seconds in the receiver, after the complete days, hours, and minutes have been removed. If the receiver is less than <Duration factory> #zero then the result will be less than or equal to 0.
'
refinedIn: ''
refinement: ''
parameters: #()
returnValues: #( #( 'number' #'unspecified') )
errors: ''
!
(1 protocolManager newProtocolNamed: #'Duration factory'
conformsToProtocolNames: #(#'Object')
) protocolDescription: '
Represents protocol for creating a particular length of time.
Standard Globals
Duration Conforms to the protocol <Duration factory>. Its language element type is unspecified.
'
!
1 protocolManager newMessagePattern: 'days: seconds hours: hours minutes: minutes seconds: days'
forProtocolNamed: #'Duration factory'
synopsis: 'Answer a <Duration> of the number of days, hours, minutes, and seconds.
'
definedIn: 'Duration factory'
definition: 'Answer a <Duration> of the number of days, hours, minutes, and seconds. If any of the operands are negative, the result is smaller by that number of days, hours, minutes, or seconds as appropriate.
'
refinedIn: ''
refinement: ''
parameters: #( #('days' 'integer' #'unspecified') #('seconds' 'number' #'unspecified') #('hours' 'integer' #'unspecified') #('minutes' 'integer' #'unspecified') )
returnValues: #( #( 'Duration' #'new') )
errors: ''
!
1 protocolManager newMessagePattern: 'seconds: seconds'
forProtocolNamed: #'Duration factory'
synopsis: 'Answer a <Duration> which is seconds in length
'
definedIn: 'Duration factory'
definition: 'If seconds is negative, answer a <Duration> that is abs (seconds) less than <Duration factory> #zero.
'
refinedIn: ''
refinement: ''
parameters: #( #('seconds' 'number' #'unspecified') )
returnValues: #( #( 'Duration' #'new') )
errors: ''
!
1 protocolManager newMessagePattern: 'zero'
forProtocolNamed: #'Duration factory'
synopsis: 'Answer a <Duration> of zero length.
'
definedIn: 'Duration factory'
definition: 'Answer a <Duration> representing a length of no time.
'
refinedIn: ''
refinement: ''
parameters: #()
returnValues: #( #( 'Duration' #'unspecified') )
errors: ''
!
(1 protocolManager newProtocolNamed: #'dyadicValuable'
conformsToProtocolNames: #(#'valuable')
) protocolDescription: '
This protocol describes the behavior for objects supporting the #value:value: selector.
'
!
1 protocolManager newMessagePattern: 'argumentCount'
forProtocolNamed: #'dyadicValuable'
synopsis: 'Answers the number of arguments needed to evaluate the receiver.
'
definedIn: 'valuable'
definition: 'The number of arguments needed to evaluate the receiver is returned.
'
refinedIn: 'dyadicValuable'
refinement: 'Returns 2.
'
parameters: #()
returnValues: #( #( 'integer' #'unspecified') )
errors: ''
!
1 protocolManager newMessagePattern: 'value: argument1 value: argument2'
forProtocolNamed: #'dyadicValuable'
synopsis: 'Answers the value of the receiver when applied to the arguments.
'
definedIn: 'dyadicValuable'
definition: 'The receiver is evaluated as defined by the receiver.
Note that in the case that the receiver is a block, that the evaluation is defined by the language with argument1 bound to the block''s first argument, and argument2 bound to the block''s second argument.
The result is as defined by the receiver.
'
refinedIn: ''
refinement: ''
parameters: #( #('argument1' 'ANY' #'unspecified') #('argument2' 'ANY' #'unspecified') )
returnValues: #( #( 'ANY' #'unspecified') )
errors: ''
!
(1 protocolManager newProtocolNamed: #'Error'
conformsToProtocolNames: #(#'Exception')
) protocolDescription: '
This protocol describes the behavior of instances of class Error. These are used to represent error conditions that prevent the normal continuation of processing. Actual error exceptions used by an application may be subclasses of this class.
As Error is explicitly specified to be subclassable, conforming implementations must implement its behavior in a non-fragile manner.
'
!
1 protocolManager newMessagePattern: 'defaultAction'
forProtocolNamed: #'Error'
synopsis: ''
definedIn: 'exceptionDescription'
definition: 'If the exception described by the receiver is signaled and the current exception environment does not contain a handler for the exception this method will be executed.
The exact behavior and result of this method is implementation defined.
'
refinedIn: 'Error'
refinement: 'The current computation is terminated. The cause of the error should be logged or reported to the user. If the program is operating in an interactive debugging environment the computation should be suspended and the debugger activated.
'
parameters: #()
returnValues: #()
errors: ''
!
1 protocolManager newMessagePattern: 'isResumable'
forProtocolNamed: #'Error'
synopsis: 'Determine whether an exception is resumable.
'
definedIn: 'exceptionDescription'
definition: 'This message is used to determine whether the receiver is a resumable exception. Answer true if the receiver is resumable. Answer false if the receiver is not resumable.
'
refinedIn: 'Error'
refinement: 'Answer false. Error exceptions by default are assumed to not be resumable. Subclasses may over-ride this definition for situations where it is appropriate for an error to be resumable.
'
parameters: #()
returnValues: #( #( 'boolean' #'unspecified') )
errors: ''
!
(1 protocolManager newProtocolNamed: #'Error class'
conformsToProtocolNames: #(#'Exception class')
) protocolDescription: '
This protocol describe the behavior of the global Error. The value of the standard global Error is a class object that conforms to this protocol. The class Error is explicitly specified to be subclassable in a standard conforming program. Conforming implementations must implement its behaviors in a non-fragile manner.
The signaled exceptions generated by this type of object conform to the protocol <Error>.
Standard Globals
Error A class name. Conforms to the protocol <Error class>. Error must inherit (possibly indirectly) from the class Exception. Instances of this class conform to the protocol <Error>.
'
!
1 protocolManager newMessagePattern: 'new'
forProtocolNamed: #'Error class'
synopsis: ''
definedIn: 'instantiator'
definition: 'Return a newly created object initialized to a standard initial state.
'
refinedIn: 'Error class'
refinement: 'The object returned conforms to <Error>
'
parameters: #()
returnValues: #( #( 'Error' #'new') )
errors: ''
!
(1 protocolManager newProtocolNamed: #'Exception'
conformsToProtocolNames: #(#'exceptionBuilder' #'signaledException')
) protocolDescription: '
This protocol describes the behavior of instances of class Exception. Typically, actual exceptions used by an application will be either direct or indirect subclasses of this class. Exception combines the behavior of <exceptionBuilder> and <signaledException>. Instances are used to both supplied inform before an exception is signaled and to pass the information to an exception handler.
As Exception is explicitly specified to be subclassable, conforming implementations must implement its behavior in a non-fragile manner.
Rationale
Exception is an abstract class. It is the only true abstract class specified by the standard. It is included so as to provide a mechanism for the protable definition of new exception. Exceptions defined as subclasses of Exception will be portable to any conforming implementation..
'
!
(1 protocolManager newProtocolNamed: #'Exception class'
conformsToProtocolNames: #(#'exceptionInstantiator' #'classDescription')
) protocolDescription: '
This protocol describe the behavior of class objects that are used to create, signal, and select exceptions that exist within a specialization hierarchy.
The value of the standard global Exception is a class object that conforms to this protocol. The class Exception is explicitly specified to be subclassable. Conforming implementations must implement its behaviors in a non-fragile manner.
Standard Globals
Exception A class name. Conforms to the protocol <Exception class>. Instances of this class conform to the protocol <Exception>.
'
!
1 protocolManager newMessagePattern: 'handles: exception'
forProtocolNamed: #'Exception class'
synopsis: ''
definedIn: 'exceptionSelector'
definition: 'This message determines whether the exception handler associated with the receiver may be used to process the argument. Answer true if an associated handler should be used to process exception. Answer false if an associated handler may not be used to process the exception.
'
refinedIn: 'Exception class'
refinement: 'Return true if the class of exception is the receiver or a general subclass of the receiver.
This definition implies that subclasses of an exception class are considered to be subexceptions of the type of exception defined by their superclass. An exception handler that handles an exception class will also handle any exceptions that are instances of the exception class''s subclasses.
'
parameters: #( #('exception' 'exceptionDescription' #'unspecified') )
returnValues: #( #( 'boolean' #'unspecified') )
errors: ''
!
1 protocolManager newMessagePattern: 'new'
forProtocolNamed: #'Exception class'
synopsis: ''
definedIn: 'instantiator'
definition: 'Return a newly created object initialized to a standard initial state.
'
refinedIn: 'Exception class'
refinement: 'The object returned conforms to <Exception>
'
parameters: #()
returnValues: #( #( 'Exception' #'new') )
errors: ''
!
1 protocolManager newMessagePattern: 'signal'
forProtocolNamed: #'Exception class'
synopsis: ''
definedIn: 'exceptionSignaler'
definition: 'Associated with the receiver is an <exceptionDescription> called the signaled exception. The current exception environment is searched for an exception handler whose exception selector matches the signaled exception. The search proceeds from the most recently created exception handler to the oldest exception handler.
A matching handler is defined to be one which would return true if the message #handles: was sent to its exception selector with the signaled exception as the argument.
If a matching handler is found, the exception action of the handler is evaluated in the exception environment that was current when the handler was created and the state of the current exception environment is preserved as the signaling environment.
The exception action is evaluated as if the message #value: were sent to it with a <signaledException> passed as its argument. The <signaledException> is derived from the signaled exception in an implementation dependent manner.
If the evaluation of the exception action returns normally (as if it had returned from the #value: message), the handler environment is restored and the value returned from the exception action is returned as the value of the #on:do: message that created the handler. Before returning, any active #ensure: or #ifCurtailed: termination blocks created during evaluation of the receiver of the #on:do: message are evaluated.
If a matching handler is not found when the exception environment is searched, the default action for the signaled exception is performed. This is accomplished as if the message #defaultAction were sent to the <signaledException> object derived from the signaled exception. The #defaultAction method is executed in the context of the signaling environment. If the signaled exception is resumable the value returned from the #defaultAction method is returned as the value of the #signal message. If the signaled exception is not resumable the action taken upon completion of the #defaultAction method is implementation defined.
'
refinedIn: 'Exception class'
refinement: 'The exception signaled conforms to <Exception> with all of its <exceptionDescription> attributes set to their default values.
'
parameters: #()
returnValues: #( #( 'Object' #'unspecified') )
errors: ''
!
(1 protocolManager newProtocolNamed: #'exceptionBuilder'
conformsToProtocolNames: #(#'exceptionDescription' #'exceptionSignaler')
) protocolDescription: '
This protocol describes the messages that may be used to set the information about an occurrence of an exception. This information may be retrieved using <exceptionDescription> protocol. If an object conforming to this protocol is signaled as an exception, any information set in that object using this protocol''s messages will also be available for retrival from the signaled exception that is passed to a handler block.
'
!
1 protocolManager newMessagePattern: 'messageText: signalerText'
forProtocolNamed: #'exceptionBuilder'
synopsis: 'Set an exception''s message text.
'
definedIn: 'exceptionBuilder'
definition: 'Set the signaler message text of the receiver. Subsequent sends of the message #messgeText to the receiver will return this value. Subseqent sends of of the message #messgeText to a signaled exception generated by sending the message #signal to the receiver of this message will also return this value.
Return the receiver as the result of the message.
'
refinedIn: ''
refinement: ''
parameters: #( #('signalerText' 'readableString' #'captured') )
returnValues: #( #( 'exceptionBuilder' #'unspecified') )
errors: ''
!
(1 protocolManager newProtocolNamed: #'exceptionDescription'
conformsToProtocolNames: #(#'Object')
) protocolDescription: '
This protocol describe the messages that may be used to obtain information about an occurrence of an exception.
'
!
1 protocolManager newMessagePattern: 'defaultAction'
forProtocolNamed: #'exceptionDescription'
synopsis: 'The default action taken if the exception is signaled.
'
definedIn: 'exceptionDescription'
definition: 'If the exception described by the receiver is signaled and the current exception environment does not contain a handler for the exception this method will be executed.
The exact behavior and result of this method is implementation defined.
'
refinedIn: ''
refinement: ''
parameters: #()
returnValues: #( #( 'Object' #'unspecified') )
errors: ''
!
1 protocolManager newMessagePattern: 'description'
forProtocolNamed: #'exceptionDescription'
synopsis: 'Return a textual description of the exception.
'
definedIn: 'exceptionDescription'
definition: 'Return text that describes in a human readable form an occurrence of an exception. If an explicit message text was provided by the signaler of the exception, that text should be incorporated into the description.
'
refinedIn: ''
refinement: ''
parameters: #()
returnValues: #( #( 'readableString' #'unspecified') )
errors: ''
!
1 protocolManager newMessagePattern: 'isResumable'
forProtocolNamed: #'exceptionDescription'
synopsis: 'Determine whether an exception is resumable.
'
definedIn: 'exceptionDescription'
definition: 'This message is used to determine whether the receiver is a resumable exception. Answer true if the receiver is resumable. Answer false if the receiver is not resumable.
'
refinedIn: ''
refinement: ''
parameters: #()
returnValues: #( #( 'boolean' #'unspecified') )
errors: ''
!
1 protocolManager newMessagePattern: 'messageText'
forProtocolNamed: #'exceptionDescription'
synopsis: 'Return an exception''s message text.
'
definedIn: 'exceptionDescription'
definition: 'Return the signaler message text of the receiver. If the signaler has not provided any message text, return nil.
'
refinedIn: ''
refinement: ''
parameters: #()
returnValues: #( #( 'readableString' #'unspecified') #( 'nil' #'unspecified') )
errors: ''
!
1 protocolManager newMessagePattern: 'tag'
forProtocolNamed: #'exceptionDescription'
synopsis: 'Return an exception''s tag value.
'
definedIn: 'exceptionDescription'
definition: 'Return the tag value provided by the signaler of the receiver. If the signaler has not provided a tag value, return the same value was would be returned as if #message Text was sent to the receiver of this message. If the signaler has provided neither a tag value nor a message text, return nil.
Exception tags are intended for use in situations where a particular occurrence of an exception needs to be identified and a textual description is not appropriate. For example, the message text might vary according to the locale and thus could not be used to identify the exception.
'
refinedIn: ''
refinement: ''
parameters: #()
returnValues: #( #( 'nil' #'unspecified') #( 'Object' #'unspecified') )
errors: ''
!
(1 protocolManager newProtocolNamed: #'exceptionInstantiator'
conformsToProtocolNames: #(#'exceptionSignaler' #'exceptionSelector' #'instantiator')
) protocolDescription: '
This protocol describes the instantiation behavior of objects that can create exceptions.
'
!
1 protocolManager newMessagePattern: 'new'
forProtocolNamed: #'exceptionInstantiator'
synopsis: 'Create a new object.
'
definedIn: 'instantiator'
definition: 'Return a newly created object initialized to a standard initial state.
'
refinedIn: 'exceptionInstantiator'
refinement: 'The object returned is an <exceptionBuilder> that may be used to signal an exception of the same type that would be signaled if the message #signal is sent to the receiver.
'
parameters: #()
returnValues: #( #( 'exceptionBuilder' #'new') )
errors: ''
!
1 protocolManager newMessagePattern: 'signal'
forProtocolNamed: #'exceptionInstantiator'
synopsis: 'Signal the occurrence on an exceptional condition.
'
definedIn: 'exceptionSignaler'
definition: 'Associated with the receiver is an <exceptionDescription> called the signaled exception. The current exception environment is searched for an exception handler whose exception selector matches the signaled exception. The search proceeds from the most recently created exception handler to the oldest exception handler.
A matching handler is defined to be one which would return true if the message #handles: was sent to its exception selector with the signaled exception as the argument.
If a matching handler is found, the exception action of the handler is evaluated in the exception environment that was current when the handler was created and the state of the current exception environment is preserved as the signaling environment.
The exception action is evaluated as if the message #value: were sent to it with a <signaledException> passed as its argument. The <signaledException> is derived from the signaled exception in an implementation dependent manner.
If the evaluation of the exception action returns normally (as if it had returned from the #value: message), the handler environment is restored and the value returned from the exception action is returned as the value of the #on:do: message that created the handler. Before returning, any active #ensure: or #ifCurtailed: termination blocks created during evaluation of the receiver of the #on:do: message are evaluated.
If a matching handler is not found when the exception environment is searched, the default action for the signaled exception is performed. This is accomplished as if the message #defaultAction were sent to the <signaledException> object derived from the signaled exception. The #defaultAction method is executed in the context of the signaling environment. If the signaled exception is resumable the value returned from the #defaultAction method is returned as the value of the #signal message. If the signaled exception is not resumable the action taken upon completion of the #defaultAction method is implementation defined.
'
refinedIn: 'exceptionInstantiator'
refinement: 'An exception of the type associated with the receiver is signaled. The <signaledException> is initialized to its default state.
'
parameters: #()
returnValues: #( #( 'Object' #'unspecified') )
errors: ''
!
(1 protocolManager newProtocolNamed: #'exceptionSelector'
conformsToProtocolNames: #(#'Object')
) protocolDescription: '
This protocol describe the behavior of objects that are used to select an exception handler. In particular, objects that conform to this protocol may occur as the first argument to #on:do: message sent to blocks.
'
!
1 protocolManager newMessagePattern: ', anotherException'
forProtocolNamed: #'exceptionSelector'
synopsis: 'Create an exception set.
'
definedIn: 'exceptionSelector'
definition: 'Return an exception set that contains the receiver and the argument exception. This is commonly used to specify a set of exception selectors for an exception handler.
'
refinedIn: ''
refinement: ''
parameters: #( #('anotherException' 'exceptionSelector' #'captured') )
returnValues: #( #( 'exceptionSet' #'new') )
errors: ''
!
1 protocolManager newMessagePattern: 'handles: exception'
forProtocolNamed: #'exceptionSelector'
synopsis: 'Determine whether an exception handler will accept a signaled exception.
'
definedIn: 'exceptionSelector'
definition: 'This message determines whether the exception handler associated with the receiver may be used to process the argument. Answer true if an associated handler should be used to process exception. Answer false if an associated handler may not be used to process the exception.
'
refinedIn: ''
refinement: ''
parameters: #( #('exception' 'exceptionDescription' #'unspecified') )
returnValues: #( #( 'boolean' #'unspecified') )
errors: ''
!
(1 protocolManager newProtocolNamed: #'exceptionSet'
conformsToProtocolNames: #(#'exceptionSelector')
) protocolDescription: '
This protocol describes the behavior of objects that may be used to group a set of <exceptionSelector> objects into a single <exceptionSelector>. This is useful for establishing a single exception handler that may deal with several different types of exceptions.
'
!
1 protocolManager newMessagePattern: ', anotherException'
forProtocolNamed: #'exceptionSet'
synopsis: ''
definedIn: 'exceptionSelector'
definition: 'Return an exception set that contains the receiver and the argument exception. This is commonly used to specify a set of exception selectors for an exception handler.
'
refinedIn: 'exceptionSet'
refinement: 'In addition to anotherException the exception set that is returned contains all of theexception selectors contained in the receiver.
The returned object may or may not be the same object as the receiver.
'
parameters: #( #('anotherException' 'exceptionSelector' #'captured') )
returnValues: #( #( 'exceptionSet' #'unspecified') )
errors: ''
!
(1 protocolManager newProtocolNamed: #'exceptionSignaler'
conformsToProtocolNames: #(#'Object')
) protocolDescription: '
This protocol describes the behavior of signaling an exceptional condition, locating an exception handler, and executing an exception action.
'
!
1 protocolManager newMessagePattern: 'signal'
forProtocolNamed: #'exceptionSignaler'
synopsis: 'Signal the occurrence of an exceptional condition.
'
definedIn: 'exceptionSignaler'
definition: 'Associated with the receiver is an <exceptionDescription> called the signaled exception. The current exception environment is searched for an exception handler whose exception selector matches the signaled exception. The search proceeds from the most recently created exception handler to the oldest exception handler.
A matching handler is defined to be one which would return true if the message #handles: was sent to its exception selector with the signaled exception as the argument.
If a matching handler is found, the exception action of the handler is evaluated in the exception environment that was current when the handler was created and the state of the current exception environment is preserved as the signaling environment.
The exception action is evaluated as if the message #value: were sent to it with a <signaledException> passed as its argument. The <signaledException> is derived from the signaled exception in an implementation dependent manner.
If the evaluation of the exception action returns normally (as if it had returned from the #value: message), the handler environment is restored and the value returned from the exception action is returned as the value of the #on:do: message that created the handler. Before returning, any active #ensure: or #ifCurtailed: termination blocks created during evaluation of the receiver of the #on:do: message are evaluated.
If a matching handler is not found when the exception environment is searched, the default action for the signaled exception is performed. This is accomplished as if the message #defaultAction were sent to the <signaledException> object derived from the signaled exception. The #defaultAction method is executed in the context of the signaling environment. If the signaled exception is resumable the value returned from the #defaultAction method is returned as the value of the #signal message. If the signaled exception is not resumable the action taken upon completion of the #defaultAction method is implementation defined.
'
refinedIn: ''
refinement: ''
parameters: #()
returnValues: #( #( 'Object' #'unspecified') )
errors: ''
!
1 protocolManager newMessagePattern: 'signal: signalerText'
forProtocolNamed: #'exceptionSignaler'
synopsis: 'Signal the occurrence of an exceptional condition with a specified textual description.
'
definedIn: 'exceptionSignaler'
definition: 'Associated with the receiver is an <exceptionDescription> called the signaled exception. The message text of the signaled exception is set to the value of signalerText, and then the exception is signaled in the same manner as if the message #signal had been sent to the receiver.
Note that this message does not return in some circumstances. The situations in which it does return and the returned value, if any, are the same as specified for the #signal message.
'
refinedIn: ''
refinement: ''
parameters: #( #('signalerText' 'readableString' #'unspecified') )
returnValues: #( #( 'Object' #'unspecified') )
errors: ''
!
(1 protocolManager newProtocolNamed: #'extensibleCollection'
conformsToProtocolNames: #(#'collection')
) protocolDescription: '
Provides protocol for adding elements to and removing elements from a variable sized collection.
'
!
1 protocolManager newMessagePattern: 'add: newElement'
forProtocolNamed: #'extensibleCollection'
synopsis: 'Add newElement to the receiver''s elements.
'
definedIn: 'extensibleCollection'
definition: 'This message adds a newElement to the receiver. Unless specifically refined, the position of the newElement in the element traversal order is unspecified.
Conformant protocols may place restrictions on the type of objects that are valid elements. Unless otherwise specified, any object is acceptable.
'
refinedIn: ''
refinement: ''
parameters: #( #('newElement' 'Object' #'captured') )
returnValues: #()
errors: ''
!
1 protocolManager newMessagePattern: 'addAll: newElements'
forProtocolNamed: #'extensibleCollection'
synopsis: 'Add each element of newElements to the receiver''s elements.
'
definedIn: 'extensibleCollection'
definition: 'This message adds each element of newElements to the receiver.
The operation is equivalent to adding each element of newElements to the receiver using the #add: message with the element as the parameter. The newElements are traversed in the order specified by the #do: message for newElements.
'
refinedIn: ''
refinement: ''
parameters: #( #('newElements' 'collection' #'unspecified') )
returnValues: #()
errors: ''
!
1 protocolManager newMessagePattern: 'remove: oldElement'
forProtocolNamed: #'extensibleCollection'
synopsis: 'Remove the first element of the receiver which is equivalent to oldElement and return the removed element.
'
definedIn: 'extensibleCollection'
definition: 'Remove the first element of the receiver which is equivalent to oldElement and return the removed element.
The elements are tested in the same order in which they would be enumerated by the message #do: for this receiver.
The behavior is undefined if an object equivalent to oldElement is not found.
'
refinedIn: ''
refinement: ''
parameters: #( #('oldElement' 'Object' #'uncaptured') )
returnValues: #( #( 'Object' #'state') )
errors: ''
!
1 protocolManager newMessagePattern: 'remove: oldElement ifAbsent: exceptionHandler'
forProtocolNamed: #'extensibleCollection'
synopsis: 'Remove the first element of the receiver which is equivalent to oldElement. If it is not found, answer the result of evaluating exceptionHandler.
'
definedIn: 'extensibleCollection'
definition: 'The first element of the receiver which is equivalent to oldElement is removed from the receiver''s elements. If no such element is found, answer the result of evaluating exceptionHandler with no parameters.
The elements are tested in the same order in which they would be enumerated by the message #do: for this receiver.
'
refinedIn: ''
refinement: ''
parameters: #( #('oldElement' 'Object' #'uncaptured') #('exceptionHandler' 'niladicValuable' #'uncaptured') )
returnValues: #( #( 'Object' #'state') #( 'Object' #'unspecified') )
errors: ''
!
1 protocolManager newMessagePattern: 'removeAll: oldElements'
forProtocolNamed: #'extensibleCollection'
synopsis: 'For each element in oldElements, remove the first element from the receiver which is equivalent to this element.
'
definedIn: 'extensibleCollection'
definition: 'This message is used to remove each element of a given collection from the receiver''s elements. The operation is defined to be equivalent to removing each element of oldElements from the receiver using the #remove: message with the element as the parameter.
The behavior is undefined if any element of oldElements is not found.
'
refinedIn: ''
refinement: ''
parameters: #( #('oldElements' 'collection' #'uncaptured') )
returnValues: #()
errors: ''
!
(1 protocolManager newProtocolNamed: #'failedMessage'
conformsToProtocolNames: #(#'Object')
) protocolDescription: '
This protocol describes the behavior of objects that represent a message that was sent to an object, but was not understood by that object.
'
!
1 protocolManager newMessagePattern: 'arguments'
forProtocolNamed: #'failedMessage'
synopsis: 'Answer the arguments of the message that could not be sent.
'
definedIn: 'failedMessage'
definition: 'Return a collection containing the arguments of the message that could not be sent. The elements of the collection are ordered, from the first element to the last element, in the same order as the arguments of the message, from left to right. If the message had no arguments, the collection will be empty.
'
refinedIn: ''
refinement: ''
parameters: #()
returnValues: #( #( 'sequencedReadableCollection' #'unspecified') )
errors: ''
!
1 protocolManager newMessagePattern: 'selector'
forProtocolNamed: #'failedMessage'
synopsis: 'Answer the selector of the message that could not be sent.
'
definedIn: 'failedMessage'
definition: 'Answer the selector of the message that could not be sent.
'
refinedIn: ''
refinement: ''
parameters: #()
returnValues: #( #( 'selector' #'unspecified') )
errors: ''
!
(1 protocolManager newProtocolNamed: #'FileStream'
conformsToProtocolNames: #(#'sequencedStream')
) protocolDescription: '
Provides protocol for streams over external files. The external file serves as the stream backing store. When objects are read or written from a file stream they must be translated from or two an external data representation. File streams have an external stream type that is specified when the stream is created. The external stream type defines the data translation and the sequence value type for the stream. External stream types are specified using <symbol> objects. The standard defines the following external stream types:
#''binary'' The external data is treated as sequence of 8-bit bytes. The sequence value type is <integer> with values restricted to the range 0 to 255.
#''text'' The external data is treated as a sequenced of 8-bit characters encoded using an implementation defined external character set. The sequence value type is <Character> restricted to those specific characters that may be represented in the external character set.
Implementations may define other external stream types.
Rational
The file stream capability specified in the standard was motivated by the desire to support a useful, yet minimal set of functionality and to take as a guide (i.e. subset) the Posix standard.
There is specification only for the creation and use of readable and writeable file streams. There is not support for read/write file streams. Nor is there any specification of file or directory manipulation, as these facilities are considered by the Committee to be too platform-dependent and too implementation-dependent to standardize at this time, and it is felt that streaming is adequate.
In addition, we only support the most common subset of the Posix file stream creation modes, rather than the full set.
We also considered the tradeoffs of specifying a wide range of creation messages, but decided that one fully-functional message and one most-typical creation message for each of read and write file streams would be adequate. Implementations are not prohibited from providing more options.
'
!
1 protocolManager newMessagePattern: 'contents'
forProtocolNamed: #'FileStream'
synopsis: 'Returns a collection containing the complete contents of the stream.
'
definedIn: 'sequencedStream'
definition: 'Returns a collection that contains the receiver''s past and future sequence values, in order. The size of the collection is the sum of the sizes of the past and future sequence values.
'
refinedIn: 'FileStream'
refinement: 'If the external stream type is #''binary'' the returned collection conforms to <ByteArray>. If the external stream type is #''text'' the returned collection conforms to <String>.
'
parameters: #()
returnValues: #( #( 'String' #'new') #( 'ByteArray' #'new') )
errors: ''
!
1 protocolManager newMessagePattern: 'externalType'
forProtocolNamed: #'FileStream'
synopsis: 'Returns a symbol that identifies the external stream type of the receiver.
'
definedIn: 'FileStream'
definition: 'Return the symbol that identifies the external stream type of the receiver.
'
refinedIn: ''
refinement: ''
parameters: #()
returnValues: #( #( 'symbol' #'unspecified') )
errors: ''
!
1 protocolManager newMessagePattern: 'isBinary'
forProtocolNamed: #'FileStream'
synopsis: 'Answer wthether the receiver''s data is binary.
'
definedIn: 'FileStream'
definition: 'Answer true if the sequence value type conforms to <integer>. Otherwise answer false.
'
refinedIn: ''
refinement: ''
parameters: #()
returnValues: #( #( 'boolean' #'unspecified') )
errors: ''
!
1 protocolManager newMessagePattern: 'isText'
forProtocolNamed: #'FileStream'
synopsis: 'Answer whether the receiver''s data is characters.
'
definedIn: 'FileStream'
definition: 'Answer true if the sequence value type conforms to <Character>. Otherwise answer false.
'
refinedIn: ''
refinement: ''
parameters: #()
returnValues: #( #( 'boolean' #'unspecified') )
errors: ''
!
(1 protocolManager newProtocolNamed: #'FileStream factory'
conformsToProtocolNames: #(#'Object')
) protocolDescription: '
<FileStream factory> provides for the creation of objects conforming to the <readFileStream> or <writeFileStream> protocols.
Standard Globals
FileStream Conforms to the protocol <FileStream factory>. Its program element type is unspecified. This is a factory for collections that conform to <readFileStream> and <writeFileStream>.
'
!
1 protocolManager newMessagePattern: 'read: aString'
forProtocolNamed: #'FileStream factory'
synopsis: 'Returns a read file stream that reads text from the file with the given name.
'
definedIn: 'FileStream factory'
definition: 'The result is the same as if the message #read:type: was sent to the receiver with fileId as the first argument and the symbol #''text'' as the second argument.
'
refinedIn: ''
refinement: ''
parameters: #( #('aString' 'String' #'unspecified') )
returnValues: #( #( 'readFileStream' #'new') )
errors: 'As defined by <FileStream factory> #read:type:
'
!
1 protocolManager newMessagePattern: 'read: fileType type: fileId'
forProtocolNamed: #'FileStream factory'
synopsis: 'Returns a read file stream that reads from the file with the given name.
'
definedIn: 'FileStream factory'
definition: 'Locate an external file that is identified by the value of fileID. The syntax of the fileID string is implementation defined.
Return an object conforming to <readFileStream> whose future sequence values initially consist of the elements of the external file and which initially has no past sequence values. The ordering of the sequence values is the same as the ordering within the external file. The external file serves as the stream backing store of the returned object. The value of fileType determines the external stream type and sequence value type of the result object.
'
refinedIn: ''
refinement: ''
parameters: #( #('fileId' 'readableString' #'unspecified') #('fileType' 'symbol' #'unspecified') )
returnValues: #( #( 'readFileStream' #'new') )
errors: 'It is an error if the file does not exist, or if the user does not have read access to the file.
'
!
1 protocolManager newMessagePattern: 'write: fileId'
forProtocolNamed: #'FileStream factory'
synopsis: 'Returns a write file stream that writes text to the file with the given name.
'
definedIn: 'FileStream factory'
definition: 'The result is the same as if the message #write:mode:check:type: was sent to the receiver with fileId as the first argument, #''create'' as the second argument, false as the third argument, and the symbol #''text'' as the fourth argument.
'
refinedIn: ''
refinement: ''
parameters: #( #('fileId' 'readableString' #'unspecified') )
returnValues: #( #( 'writeFileStream' #'new') )
errors: 'As defined by <FileStream factory> #write:mode:check:type:
'
!
1 protocolManager newMessagePattern: 'write: mode mode: fileId'
forProtocolNamed: #'FileStream factory'
synopsis: 'Returns a write file stream that writes text to the file with the given name.
'
definedIn: 'FileStream factory'
definition: 'The result is the same as if the message #write:mode:check:type: was sent to the receiver with fileId as the first argument, mode as the second argument, false as the third argument, and the symbol #''text'' as the fourth argument.
'
refinedIn: ''
refinement: ''