<div id="__MailbirdStyleContent" style="font-size: 10pt;font-family: Arial;color: #000000">
                                        
                                        
                                            
                                        
                                        
                                        Hi Subbu.<div><br></div><div><span style="font-family: Arial, Helvetica, sans-serif;font-size: 13px">> Why should the parser treat primitive keywords differently from other</span><br style="font-family: Arial, Helvetica, sans-serif;font-size: 13px"><span style="font-family: Arial, Helvetica, sans-serif;font-size: 13px">> keywords? Why not let primitives also be handled like any other pragma</span><br style="font-family: Arial, Helvetica, sans-serif;font-size: 13px"><span style="font-family: Arial, Helvetica, sans-serif;font-size: 13px">> and have the handler return a flag to let the parser treat the pragma as</span><br style="font-family: Arial, Helvetica, sans-serif;font-size: 13px"><span style="font-family: Arial, Helvetica, sans-serif;font-size: 13px">> a primitive/nonprimitive?</span><br></div><div><span style="font-size: 10pt"><br></span></div><div>From this point in #primitive, you can emit whatever you like while parsing the pragma that started with <primitive...>. If you parse <primitive: 42> as <primitive: 'prim42' module: 'primitivePlugin'>, then the callback will go to #primitive:module:. :-)</div><div><br></div><div><span style="font-family: Arial, Helvetica, sans-serif;font-size: 13px">> It will allow us to switch primitive tables at run time without </span><span style="font-family: Arial, Helvetica, sans-serif;font-size: 13px">recompiling the VM.</span><br></div><div><span style="font-family: Arial, Helvetica, sans-serif;font-size: 13px"><br></span></div><div><span style="font-family: Arial, Helvetica, sans-serif;font-size: 13px">That's unrelated. You can point to another primitive just by recompiling methods. No need to recompile the VM. ;-)</span></div><div><span style="font-family: Arial, Helvetica, sans-serif;font-size: 13px"><br></span></div><div><span style="font-family: Arial, Helvetica, sans-serif;font-size: 13px">Best,</span></div><div><span style="font-family: Arial, Helvetica, sans-serif;font-size: 13px">Marcel</span></div><div class="mb_sig"></div>
                                        
                                        <blockquote class="history_container" type="cite" style="border-left-style: solid;border-width: 1px;margin-top: 20px;margin-left: 0px;padding-left: 10px;min-width: 500px">
                        <p style="color: #AAAAAA; margin-top: 10px;">Am 12.06.2020 13:23:05 schrieb K K Subbu <kksubbu.ml@gmail.com>:</p><div style="font-family:Arial,Helvetica,sans-serif">On 12/06/20 7:44 am, commits@source.squeak.org wrote:<br>> + ----- Method: Parser>>primitive (in category 'primitives') -----<br>> + primitive<br>> +         "Pragmas that encode primitive calls are parsed as normal keyword pragmas. This hook exists so that packages do not break primitive-pragma parsing by accident. Instead, this method needs to be replaced intentionally.<br>> +   <br>> +        Note that primitive pragmas are special because they will be called back from the parser into the parser. See #pragmaPrimitives.<br>> +        <br>> +        Examples:<br>> +               <primitive: 42=""><br>> +              <primitive: 'primitivedirectorycreate'="" module:="" 'fileplugin'=""><br>> +               <primitive: 'primitiveregisterexternalfill'="" module:="" 'b2dplugin'="" error:="" errorcode="">"<br>> +<br>> +  <pragmaparser><br>Marcel,<br><br>Why should the parser treat primitive keywords differently from other <br>keywords? Why not let primitives also be handled like any other pragma <br>and have the handler return a flag to let the parser treat the pragma as <br>a primitive/nonprimitive?<br><br>It just occurred to me (strawman alert!) that the parser could parse<br>    <primitive: 42=""><br>as<br>    <primitive: 'prim42'="" module:="" 'primitiveplugin'=""><br><br>It will allow us to switch primitive tables at run time without <br>recompiling the VM.<br><br>Regards .. Subbu<br><br></primitive:></primitive:></pragmaparser></primitive:></primitive:></primitive:></div></blockquote></div>