Smalltalk Interchange Format

glenn krasner at objectshare.com
Fri Feb 6 22:56:58 UTC 1998


If you want to take a possibly easier way out, the interchange format is
intended to be implementable with essentially the same mechanism that
file-ins use. It should even be simpler, since it doesn't use the prepended
$! trick to avoid identifying each method separately. (It requires a few
methods in a few classes to be 'reserved', which would be non-Standard
compliant, but would still be effective >99% of the time.)

So with a handful of methods defined in a handful of places (like
#named:superclass... in Class and #method in ClassDefinition) and two new
globals "Pool" and "Annotation", it shouldn't be much more than a loop of
	grab and evaluate chunk
	if result is something that needs another chunk (like #method) grab and
evaluate the next chunk and give it back to the result
	if the result is an Annotation, give it to the last result

I don't know of anyone yet who has implemented it this way, so I'd like to
see the first.

For that matter, I don't know of anyone yet who has any implementation, so
I'd like to see the first implementation of any sort, including syntactic.

I believe you've accurately captured the syntax of Annotations.

glenn


At 04:17 PM 2/6/98 -0600, R. A. Harmon wrote:
>I think the Smalltalk Interchange Format (SIF) stuff in the NCITS J20 DRAFT
>of ANSI Smalltalk Standard looks very useful to Smalltalkers of any dialect.
>I plan on implementing it for Smalltalk Express (SE) as I'm using SE in my
>current project, but plan on porting the project to Squeak and/or Dolphin.
>If someone is interested in implementing SIF for Squeak, I'd like to work
>with them, share notes about it, and maybe work together on T-Gen sytax and
>token specification.  Email me directly, if interested.
>
>I can't understand the format of an annotation (a method category) to a
>interchangeElement (a method).  The draft describes the format as follows in
>BNF:
>
><interchangeFile> ::=
>        <interchangeVersionIdentifier>
>        ( <interchangeUnit> ) +
><elementSeparator> ::= '!'
><interchangeUnit> ::= <interchangeElement> <annotation>*
><interchangeElement> ::=
>        <classDefinition> |
>        . . . {snipped]
>        <methodDefinition> |
>        <classMethodDefinition> |
>        <programInitialization> |
>        comment <elementSeparator>
><annotation> ::=
>        'Annotation' 'key:' quotedString
>                'value:' quotedString <elementSeparator>
>    . . . {snipped]
><methodDefinition> ::=
>        <className> 'method' <elementSeparator>
>                <method definition> <elementSeparator>
>
>
>Does the following conform to the spec.?
>
>Class named: 'MyClass' superclass: 'Object'
>    indexedInstanceVariables: #'none'
>    instanceVariableNames:'myVar'
>    classVariableNames: 'MyVar'
>    sharedPools: 'MyPool'
>    classInstanceVariableNames: ''myClassInstVar''!
>    Annotation
>        key: 'comment'
>        value: 'Does gunk farbling'!
>
>MyClass method!
>farbleGunk 
>    "Private - repeatedly farble the gunk object."
>    #toDo."Implement this"!
>Annotation
>        key: 'category'
>        value: 'Farblers'!
>
>Any help would be appreciated.
>
>--
>Richard A. Harmon          "The only good zombie is a dead zombie"
>harmonra at webname.com           E. G. McCarthy
>





More information about the Squeak-dev mailing list