<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head><body dir="auto"><div>Hi Clément,<br><br></div><div><br>On Feb 21, 2018, at 4:01 AM, Clément Bera <<a href="mailto:bera.clement@gmail.com">bera.clement@gmail.com</a>> wrote:<br><br></div><blockquote type="cite"><div><span></span></div></blockquote><blockquote type="cite"><div><div dir="ltr"><div class="gmail_quote"><br><div dir="ltr">Hi all,<div><br></div><div>I'm trying to set literals as read-only in Pharo. I've got this problem with this Misc primitive:</div><div><br></div><div><div>translate: aString from: start  to: stop  table: table</div><div><span style="white-space:pre-wrap">       </span>"translate the characters in the string by the given table, in place"</div><div><span style="white-space:pre-wrap">  </span><primitive: '<wbr>primitiveTranslateStringWithTa<wbr>ble' module: 'MiscPrimitivePlugin'></div><div><span style="white-space:pre-wrap">       </span><var: #table  declareC: 'unsigned char *table'></div><div><span style="white-space:pre-wrap">       </span><var: #aString  declareC: 'unsigned char *aString'></div><div><br></div><div><span style="white-space:pre-wrap">  </span>start to: stop do: [ :i |</div><div><span style="white-space:pre-wrap">                </span>aString at: i put: (table at: (aString basicAt: i) + 1) ]</div></div><div><div><br></div><div>The primitive mutates aString without checking if it's read-only.</div><div><br></div><div>What is the right way in Smart syntax plugin to add the read-only check ?</div></div></div></div></div></div></blockquote><div><br></div>I think the right way is to rewrite the primitive as a SmartSyntaxPlugin.  I will do this today.  These translated primitives are a cute idea but fundamentally problematic.<div><br><blockquote type="cite"><div><div dir="ltr"><div class="gmail_quote"><div dir="ltr"><div><div><br></div><div>Best,</div><div><br></div>-- <br><div class="m_2857662832551527577gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div>Clément Béra<div><span style="font-size:12.8px"><a href="https://clementbera.github.io/" target="_blank">https://clementbera.github.io/</a></span><br></div><div><a href="https://clementbera.wordpress.com/" target="_blank">https://clementbera.wordpress.<wbr>com/</a><br></div><div><span style="color:rgb(34,34,34);font-family:arial,sans-serif;line-height:16px;background-color:rgb(255,255,255)">Bâtiment B 40, avenue Halley 59650 </span><em style="font-weight:bold;font-style:normal;font-family:arial,sans-serif;line-height:16px;background-color:rgb(255,255,255)">Villeneuve d'Ascq</em></div></div></div></div></div></div></div></div></div></div></div></div></div></div></div>
</div>
</div></blockquote></div></body></html>