<div dir="ltr"><div>Jaromir, thanks so much for explaining that! Makes sense now.</div><div dir="ltr"><br></div><div dir="ltr">On Sun, Jul 7, 2024 at 4:46 PM Jaromir Matas <<a href="mailto:mail@jaromir.net">mail@jaromir.net</a>> wrote:<br></div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"><div class="msg-1394676150074971697"><div><div><br></div>
<div>
<div>On 07-Jul-24 11:06:12 PM, "Mark Volkmann via Cuis-dev" <<a href="mailto:cuis-dev@lists.cuis.st" target="_blank">cuis-dev@lists.cuis.st</a>> wrote:</div></div><div><br></div>
<div id="m_-1394676150074971697xf0bfde3fcf75410"><blockquote cite="http://CAFfRWnXvy=shJu6-seHC7Nv2cgfai6Z_vF16pGQ=hWG+h3C1iQ@mail.gmail.com" type="cite" class="m_-1394676150074971697cite2">
<div dir="ltr">It seems that `Dictionary newFrom:` works with a run-time literal Array of Association objects and does not work with a compile-time literal Array or Association objects. For example, this works:<div><br><div><font face="monospace">as := {#a -> 'apple'. #b -> 'banana'. #c -> 'cherry'}.<br>d2 := Dictionary newFrom: as.</font><br><br></div><div>but this gives the error "MessageNotUnderstood: Symbol>>key".<br></div><div><br></div><div><div><div><font face="monospace">as := #(#a -> 'apple' #b -> 'banana' #c -> 'cherry').</font></div></div></div></div></div></blockquote><font face="monospace"><div id="m_-1394676150074971697xf0bfde3fcf75410"><br></div><div id="m_-1394676150074971697xf0bfde3fcf75410">as = #(#a #-> 'apple' #b #-> 'banana' #c #-> 'cherry')</div><div id="m_-1394676150074971697xf0bfde3fcf75410"><br></div></font><div id="m_-1394676150074971697xf0bfde3fcf75410"><font face="monospace">i.e. `as` is not an array of associations :) Literal array won't create the association objects, or better to say the compiler doesn't do compile time evaluation. Check </font><a href="https://github.com/Cuis-Smalltalk/Cuis-Smalltalk-Dev/blob/master/Documentation/Technical/HitchHikersCompiler.md" target="_blank">https://github.com/Cuis-Smalltalk/Cuis-Smalltalk-Dev/blob/master/Documentation/Technical/HitchHikersCompiler.md</a><font face="monospace"> and scroll to `Compile Time Evaluation` section.</font></div><font face="monospace"><br></font><blockquote cite="http://CAFfRWnXvy=shJu6-seHC7Nv2cgfai6Z_vF16pGQ=hWG+h3C1iQ@mail.gmail.com" type="cite" class="m_-1394676150074971697cite2"><div dir="ltr"><div><div><div><div><font face="monospace"><br>d2 := Dictionary newFrom: as.</font></div><div><br></div></div><div>Can someone explain why?</div><div><br></div><span class="gmail_signature_prefix">-- </span><br><div dir="ltr" class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div dir="ltr"><div><font face="arial, helvetica, sans-serif">R. Mark Volkmann</font></div><div><span style="font-size:12.8px"><font face="arial, helvetica, sans-serif">Object Computing, Inc.</font></span></div></div></div></div></div></div></div></div></div></div></div>
</blockquote></div>
</div></div></blockquote></div><br clear="all"><div><br></div><span class="gmail_signature_prefix">-- </span><br><div dir="ltr" class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div dir="ltr"><div><font face="arial, helvetica, sans-serif">R. Mark Volkmann</font></div><div><span style="font-size:12.8px"><font face="arial, helvetica, sans-serif">Object Computing, Inc.</font></span></div></div></div></div></div></div></div></div></div>