[OpenSmalltalk/opensmalltalk-vm] primitiveTranslateStringWithTable modifies symbols in place, it should be reserved for non-literal strings only (#561)

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[OpenSmalltalk/opensmalltalk-vm] primitiveTranslateStringWithTable modifies symbols in place, it should be reserved for non-literal strings only (#561)

David T Lewis
 

After making sure a string was not interned, ( "Symbol findInterned: 'test123'" returned nil ), I did

| s | s := #TEST123.
s translateToLowercase.
s -> (Symbol findInterned: s)

and the resulting s is a Symbol and it is not interned.
To make sure that the primitive is invoked (and not its fallback code), put a halt in ByteString class >> #translate:from:to:table:


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or unsubscribe.

<script type="application/ld+json">[ { "@context": "http://schema.org", "@type": "EmailMessage", "potentialAction": { "@type": "ViewAction", "target": "https://github.com/OpenSmalltalk/opensmalltalk-vm/issues/561", "url": "https://github.com/OpenSmalltalk/opensmalltalk-vm/issues/561", "name": "View Issue" }, "description": "View this Issue on GitHub", "publisher": { "@type": "Organization", "name": "GitHub", "url": "https://github.com" } } ]</script>