<div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div><span style="font-family:&#39;Times New Roman&#39;;font-size:medium"><table><tbody><tr><td style="background-repeat:no-repeat no-repeat">
<br></td><td style="background-color:white">Is the behaviour I&#39;m experiencing a known issue? Or is there a reason it is designed this way? I&#39;ve searched the mailing/bug list but could not find anything.<br>
<font class="Apple-style-span" face="arial"><span class="Apple-style-span" style="-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; font-size: small;"><font class="Apple-style-span" face="&#39;Times New Roman&#39;"><span class="Apple-style-span" style="-webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px; font-size: medium;"><br>
</span></font></span></font></td></tr></tbody></table></span></div></blockquote><div><br></div><div>Hi Bart,</div><div>I&#39;ve just come across the same issue with Json encoded arrays - but when I searched I came across your helpful mail. Are you planning to submit your fix?</div>
<div><br></div><div>On a related Json issue, I found that code I was writing for Json encoding my classes followed a similar pattern - I&#39;d encode all the instance variables in a Dictionary. I extracted this code and made it generic as:</div>
<div><br></div><div>Object&gt;&gt;jsonOn: aStream</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>| attributes |</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>attributes := Dictionary new.</div>
<div><span class="Apple-tab-span" style="white-space:pre">        </span>self class instVarNames do:</div><div><span class="Apple-tab-span" style="white-space:pre">                </span>[ :ivarName | </div><div><span class="Apple-tab-span" style="white-space:pre">                </span>attributes </div>
<div><span class="Apple-tab-span" style="white-space:pre">                        </span>at: ivarName</div><div><span class="Apple-tab-span" style="white-space:pre">                        </span>put: (self instVarNamed: ivarName) ].</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>JSStream encodeDictionary: attributes on: aStream.</div>
<div><br></div><div>I wonder if this would be sufficiently generally applicable to appear in the default distribution? Classes can always override the default for custom Json encoding.</div><div><br></div><div>Thoughts?</div>
<div><br></div><div>Nick</div></div>