SMIX was: (Re: [ANN][Goodies] Dandelion 0.4 SP2)

Masashi Umezawa umejava at mars.dti.ne.jp
Thu Aug 10 14:46:23 UTC 2000


Hi Lex,

Sorry for the late response.

Lex Spoon wrote:
> 
> You know, a really XML-friendly code system would encode methods like
> this:
> 
>         <method>
>         <comment>Add the receiver to aNumber and return the result</comment>
>         <message>
>                 <keyword>+</keyword>
>                 <argument>aNumber</argument>
>         </message>
>         <primitive>8</primitive>
>         <methodbody>
>                 (... insert commands here, in XML...)
>         </methodbody>
> 

SMIX is based on a minimum set approach. It deliberately defines very
small set of tags.
In SMIX, additional information ( for instance - Smalltalk dialect
specific features
- package, namespace, etc.) could be inserted by using annotation tags.

So your example would be like this: 

<interchangeUnit>
 <methodDefinition className="Float" selector="&#43;"><![CDATA[+ aNumber 
	"Primitive. Answer the sum of the receiver and aNumber. Essential.
	Fail if the argument is not a Float. See Object documentation
	whatIsAPrimitive."

	<primitive: 41>
	^ aNumber adaptToFloat: self andSend: #+]]>
	</methodDefinition>
 <annotation key="argumentName" value="aNumber"/>
 <annotation key="primitive" value="41"/>
 <annotation key="category" value="arithmetic"/>
 <annotation key="comment" value="Primitive. Answer the sum of ....."/>
</interchangeUnit>

(I admit that the features like comment, primitive, and argumentName are
all supported
in any Smalltalk dialects. So my notion of what is minimum in Smalltalk
may be wrong). 

Anyway, the merits are:
 -stabilized DTD
  -small implementation (generator, parser).

Demerits are:
  - lengthy and redundant XML
  - ambiguity of annotations (no semantic definitions of key-value
pairs)

The other approach is to define maximum set of tags for any Smalltalk
dialects.
(The format could be named SMAX ;->).
I suppose many people prefer this approach now.

For further discussion, please see the CampSmalltalk site:
http://wiki.cs.uiuc.edu/CampSmalltalk/ASCII+standard+for+code+interchange+(XML)

Cheers,

---
[:masashi|^umezawa]





More information about the Squeak-dev mailing list