[ANSI-Smalltalk] Writing the standard in Smalltalk [long]
Paolo Bonzini
paolo.bonzini at lu.unisi.ch
Mon Nov 26 07:33:08 GMT 2007
Martin McClure wrote:
> Hi all,
>
> When I started the "Editing and executable specification" thread on Nov.
> 15, I had only a vague idea of what I wanted. After reading the comments
> on that thread, and thinking about it some more, I wrote up an initial
> framework this weekend.
Very nice.
I attach the ANSI standard protocol database as used in GNU Smalltalk's
test cases (code originally by Richard A. Harmon).
As complicated as it might look, the idea is pretty simple. It has only
five methods:
- #protocolManager
Weirdly enough, "1 protocolManager" is what everybody else would have
written "ProtocolManager uniqueInstance".
- #newProtocolNamed:conformsToProtocolNames:
A note: in a couple of cases the standard used multiple protocol
inheritance:
'Exception' -> 'exceptionBuilder' 'signaledException'
'Exception class' -> 'exceptionInstantiator' 'classDescription'
'exceptionBuilder' -> 'exceptionDescription' 'exceptionSignaler'
'exceptionInstantiator' -> 'exceptionSignaler' 'exceptionSelector'
'instantiator'
'Object class' -> 'instantiator' 'classDescription'
'OrderedCollection' -> 'sequencedCollection' 'extensibleCollection'
'sequencedContractibleCollection'
'readableString' -> 'sequencedReadableCollection' 'magnitude'
etc.
- #protocolDescription:
Easy enough.
- and the two big ones
#newMessagePattern:forProtocolNamed:synopsis:definedIn:definition:refinedIn:refinement:parameters:returnRule:errors:
#newMessagePattern:forProtocolNamed:synopsis:definedIn:definition:refinedIn:refinement:parameters:returnValues:errors:
where the former is only used for arithmetic operations, more or less.
Paolo
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ansidb.st.gz
Type: application/x-gzip
Size: 59884 bytes
Desc: not available
Url : http://lists.openskills.org/pipermail/ansi-smalltalk/attachments/20071126/c28208c1/ansidb.st-0001.bin
More information about the ANSI-Smalltalk
mailing list