<div>Hi Nick,</div><div><br></div><div>You are right about your change. Its the same kind of issue. I can include your changes as well.</div><div><br></div><div>The only thing dangerous about this is that it can create an endless loop (the recursive json: calls I mean - also applies to my fixes). But I consider it the responsibility of the developer to avoid having this. After all, the resulting Json should also not have loops in it ... </div>
<div><br></div><div>Regards,</div><div><br></div><div>Bart</div><div><br></div><br><div class="gmail_quote">On Mon, Feb 1, 2010 at 10:22 PM, Nick Ager <span dir="ltr">&lt;<a href="mailto:nick.ager@gmail.com">nick.ager@gmail.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div class="gmail_quote"><div>Hi Bart,</div><div class="im"><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div><div class="gmail_quote"><div>I&#39;ve also noticed this. There is no implementation of jsonOn: aStream on Object class right now. <br>
Your implementation seems like a sensible default thing to do.</div>
<div>Its actually highly related to <a href="http://code.google.com/p/seaside/issues/detail?id=449" target="_blank">http://code.google.com/p/seaside/issues/detail?id=449</a> (<font face="arial, helvetica, sans-serif">Generating JSON is difficult</font>) bug.</div>

</div></div></blockquote><div><br></div></div><div>I&#39;ve just discovered that the code I posted previously for a default implementation of Object&gt;&gt;jsonOn: aStream suffered from a similar problem to the one&#39;s you&#39;ve found. Assuming your refactoring the last line should read: </div>

<div><br></div><div>    aStream json: <span style="font-family:arial, sans-serif;font-size:13px;border-collapse:collapse;color:rgb(80, 0, 80)">attributes</span></div><div><span style="font-family:arial, sans-serif;font-size:13px;border-collapse:collapse;color:rgb(80, 0, 80)"><br>

</span></div><div><font color="#500050" face="arial, sans-serif"><span style="border-collapse:collapse"><span style="border-collapse:separate;color:rgb(0, 0, 0);font-family:arial"><div>
so the whole code reads: </div><div><br></div><div><span style="font-family:arial, sans-serif;font-size:13px;border-collapse:collapse;color:rgb(80, 0, 80)"><div class="im"><div>Object&gt;&gt;jsonOn: aStream</div>
<div><span style="white-space:pre">        </span>| attributes |</div><div><span style="white-space:pre">        </span>attributes := Dictionary new.</div><div><span style="white-space:pre">        </span>self class instVarNames do:</div>
<div><span style="white-space:pre">                </span>[ :ivarName | </div><div><span style="white-space:pre">                </span>attributes </div><div><span style="white-space:pre">                        </span>at: ivarName</div><div><span style="white-space:pre">                        </span>put: (self instVarNamed: ivarName) ].</div>

</div><div><span style="white-space:pre">        aStream json: attributes</span></div><div><span style="white-space:pre"><br></span></div><div><span style="white-space:pre"><span style="border-collapse:separate;color:rgb(0, 0, 0);font-family:arial;white-space:normal;font-size:small"><div>

perhaps this could be included with your changes? Comments?</div><div><br></div><div>Nick </div><div><br></div></span></span></div></span></div></span></span></font></div></div>
<br>_______________________________________________<br>
seaside mailing list<br>
<a href="mailto:seaside@lists.squeakfoundation.org">seaside@lists.squeakfoundation.org</a><br>
<a href="http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside" target="_blank">http://lists.squeakfoundation.org/cgi-bin/mailman/listinfo/seaside</a><br>
<br></blockquote></div><br><br clear="all"><br>-- <br>imagination is more important than knowledge - Albert Einstein<br>Logic will get you from A to B. Imagination will take you everywhere - Albert Einstein<br>Learn from yesterday, live for today, hope for tomorrow. The important thing is not to stop questioning. - Albert Einstein<br>
The true sign of intelligence is not knowledge but imagination. - Albert Einstein<br>However beautiful the strategy, you should occasionally look at the results. - Sir Winston Churchill<br>It&#39;s not enough that we do our best; sometimes we have to do what&#39;s required. - Sir Winston Churchill<br>