<div>Ok. I ask you becouse GRSmallDictionary have method with js concern.</div><div><br></div><div>Now, in my image Pharo 1.3, the class comment on SmallDictionary is same to RBSmallDictionary, but last class is smaller even. But, with neither of those classes the code of example works fine.</div>
<div><br></div><div>|dict array value1 value2|<br> value1 := &#39;abcd&#39;.<br> value2 := 12345.<br> dict:= <font color="#ff0000">SmallDictionary</font> new.<br> dict at: &#39;subop1&#39; put: value1.<br> dict at: &#39;subop2&#39; put: value2.<br>
 array:=Array with: dict.<br> array asJson =&gt; <font color="#009900"> &#39;[[&quot;abcd&quot;,12345]]&#39;</font></div><div><br></div><div>and this one throw a exception</div><div><br></div><div>|dict array value1 value2|<br>
 value1 := &#39;abcd&#39;.<br> value2 := 12345.<br> dict:= <font color="#ff0000">RBSmallDictionary</font> new.<br> dict at: &#39;subop1&#39; put: value1.<br> dict at: &#39;subop2&#39; put: value2.<br> array:=Array with: dict.<br>
array asJson  =&gt; <font color="#009900">&#39;Override #jsonOn: to make the receiver serializeable as JSON&#39;</font></div><div><br></div><div><br></div><div>Finally, I will use the Dictionary class, and I go on coding my widget :)</div>
<div><br></div><div>Thanks Paul.</div><div><br></div><div><br></div><div class="gmail_quote">2011/9/1 Paul DeBruicker <span dir="ltr">&lt;<a href="mailto:pdebruic@gmail.com">pdebruic@gmail.com</a>&gt;</span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
I don&#39;t know when it would matter or when users would notice a difference, performance wise.  See the class comment on SmallDictionary and see if that is better suited to your plugin&#39;s use case than just a regular Dictionary.  The GRSmallDictionary is a cross platform compatible implementation of the SmallDictionary.<br>

<br>
I&#39;m sure both would be fine for most use cases.<div class="im"><br>
<br>
<br>
<br>
<br>
On 09/01/2011 05:12 PM, Gastón Dall&#39; Oglio wrote:<br>
</div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">
I see in the JQPluing class<br>
<br>
optionAt: aKey put: aValue<br>
  ^ self options at: aKey put: aValue<br>
<br>
and<br>
<br>
options<br>
^ options ifNil: [ options := GRSmallDictionary new ]<br>
<br>
Then, is better use GRSmallDictionary for the subops pairs? Like this:<br>
<br>
|dict array value1 value2|<br>
value1 := &#39;abcd&#39;.<br>
value2 := 12345.<br>
dict:= GRSmallDictionary new.<br>
dict at: &#39;subop1&#39; put: value1.<br>
dict at: &#39;subop2&#39; put: value2.<br>
array:=Array with: dict.<br>
array asJson<br>
<br>
<br>
2011/9/1 Gastón Dall&#39; Oglio &lt;<a href="mailto:gaston.dalloglio@gmail.com" target="_blank">gaston.dalloglio@gmail.com</a><br></div>
&lt;mailto:<a href="mailto:gaston.dalloglio@gmail.com" target="_blank">gaston.dalloglio@gmail.com</a>&gt;&gt;<div class="im"><br>
<br>
    Ohhhhh of course, a Array with a Dictionary!!! This was so obvious<br>
    (but not for me jeje).<br>
    When I complete my first JQWidget, I share it with you.<br>
    Thanks.<br>
<br>
    2011/9/1 Paul DeBruicker &lt;<a href="mailto:pdebruic@gmail.com" target="_blank">pdebruic@gmail.com</a><br></div>
    &lt;mailto:<a href="mailto:pdebruic@gmail.com" target="_blank">pdebruic@gmail.com</a>&gt;&gt;<div><div class="h5"><br>
<br>
        You need to create a Dictionary and then put that in your array<br>
<br>
        You can test it in a workplace like this:<br>
<br>
        |dict array  value1 value2|<br>
        value1 := &#39;abcd&#39;.<br>
        value2 := 12345.<br>
        dict:=Dictionary new.<br>
        dict at: &#39;subop1&#39; put: value1.<br>
        dict at: &#39;subop2&#39; put: value2.<br>
        array:=Array with: dict.<br>
        array asJson<br>
<br>
<br>
<br>
<br>
<br>
        so your code should become<br>
<br>
        self optionAt: &#39;op1&#39; put (Array with: aDictionary).<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
        On 09/01/2011 10:40 AM, Gastón Dall&#39; Oglio wrote:<br>
<br>
            Hello.<br>
<br>
            I&#39;m writing a new JQWidget component and I need generate js<br>
            code like<br>
            this for correctly load of the wrapped plugin:<br>
            $(&quot;#id&quot;).funcname({&quot;op1&quot;:[{&quot;subop1&quot;:&quot;value1&quot;,&quot;subop2&quot;:&quot;value2&quot;,...}],...});<br>
<br>
<br>
            I don&#39;t know how do it. I have a method<br>
            JQMyWidget&gt;&gt;subop1:value, where<br>
            I write some [stupid] implementation:<br>
<br>
            1) self optionAt: &#39;op1&#39; put: (Array with: &#39;subop1&#39; with:<br>
            value)     =&gt;<br>
                $(&quot;#id&quot;).funcname({&quot;op1&quot;:[&quot;subop1&quot;,&quot;value&quot;]})<br>
<br>
            2) self optionAt: &#39;op1&#39; put: (&#39;subop1&#39; -&gt; value)     =&gt;<br>
            $(&quot;#id&quot;).funcname({&quot;op1&quot;:&#39;subop1&#39;-&gt;&#39;value&#39;})<br>
<br>
            3) self optionAt: &#39;op1&#39; put: (self optionAt: &#39;subop1&#39; put:<br>
            value)     =&gt;<br>
                $(&quot;#id&quot;).funcname({&quot;op1&quot;:&quot;value&quot;,&quot;subop1&quot;:&quot;value&quot;})<br>
<br>
            Any idea? Thanks in advance.<br>
<br>
<br>
            _______________________________________________<br>
            seaside mailing list<br>
            <a href="mailto:seaside@lists.squeakfoundation.org" target="_blank">seaside@lists.squeakfoundation.org</a><br></div></div>
            &lt;mailto:<a href="mailto:seaside@lists.squeakfoundation.org" target="_blank">seaside@lists.squeakfoundation.org</a>&gt;<div class="im"><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>
<br>
        _______________________________________________<br>
        seaside mailing list<br>
        <a href="mailto:seaside@lists.squeakfoundation.org" target="_blank">seaside@lists.squeakfoundation.org</a><br></div>
        &lt;mailto:<a href="mailto:seaside@lists.squeakfoundation.org" target="_blank">seaside@lists.squeakfoundation.org</a>&gt;<div class="im"><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>
<br>
<br>
<br>
<br>
_______________________________________________<br>
seaside mailing list<br>
<a href="mailto:seaside@lists.squeakfoundation.org" target="_blank">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>
</div></blockquote><div><div class="h5">
<br>
_______________________________________________<br>
seaside mailing list<br>
<a href="mailto:seaside@lists.squeakfoundation.org" target="_blank">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>
</div></div></blockquote></div><br>