Hi Clément,
Hi all,
I'm trying to set literals as read-only in Pharo. I've got this problem with this Misc primitive:
translate: aString from: start to: stop table: table
"translate the characters in the string by the given table, in place"
<primitive: 'primitiveTranslateStringWithTable' module: 'MiscPrimitivePlugin'>
<var: #table declareC: 'unsigned char *table'>
<var: #aString declareC: 'unsigned char *aString'>
start to: stop do: [ :i |
aString at: i put: (table at: (aString basicAt: i) + 1) ]
The primitive mutates aString without checking if it's read-only.
What is the right way in Smart syntax plugin to add the read-only check ?
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.
Best,
--
Clément Béra
Bâtiment B 40, avenue Halley 59650 Villeneuve d'Ascq