[squeak-dev] Symbol class>>findInterned: deprecated???
Marcel Taeumel
marcel.taeumel at hpi.de
Wed Jun 15 06:58:49 UTC 2022
Hi Eliot --
> But lookup: *always* interns:
No, it does not. You should use #lookup: instead. It has the very same semantics as #findInterned:.
In any case, I will re-load 60Deprecated again into Trunk so that you can keep your code unchanged. We can then discuss the benefit of having two identical methods for the same thing.
#lookup: has the better wording and hides implementation details.
#findInterned: leaks the implementation detail of "internalization"
#asSymbol always interns. #lookup: does not.
Best,
Marcel
Am 15.06.2022 00:27:54 schrieb Eliot Miranda <eliot.miranda at gmail.com>:
Hi All,
I've just run into what I think is a bad mistake. My understanding of Symbol class>>findInterned: is that it answers a Symbol if its (string) argument already exists as a Symbol, and answers nil otherwise. Indeed looking at Collections-mt.935, 13 April 2021, this is the case:
Symbol class>>findInterned:aString
self hasInterned:aString ifTrue:[:symbol| ^symbol].
^nil.
In Collections-nice.936,13 April 2021 it was deprecated, but the new method in 60Deprecated-nice.95, 13 April 2021 reads:
Symbol class>>findInterned:aString
self flag: #deprecated. "use lookup: instead, they are synonym"
^self lookup: aString
But lookup: *always* interns:
Symbol intern: 'union {
sqIntptr_t valword;
struct { int low, high; } valleint64;
struct { int high, low; } valbeint64;
double valflt64;
struct { void *addr; sqIntptr_t size; } valstruct;
}' #'union {
sqIntptr_t valword;
struct { int low, high; } valleint64;
struct { int high, low; } valbeint64;
double valflt64;
struct { void *addr; sqIntptr_t size; } valstruct;
}'
So I think it is *urgent* that we undeprecate findInterne3d: and restore its old meaning. I apologixze for not finding this earlier. i just ran VMMaker today after an update and that triggered the bug for the first time. I'm guessing the update flushed symbols.
I'm going to make this change now.
_,,,^..^,,,_
best, Eliot
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20220615/95be990e/attachment.html>
More information about the Squeak-dev
mailing list
|