[squeak-dev] The Trunk: Collections-ul.564.mcz

Frank Shearar frank.shearar at gmail.com
Tue Feb 4 07:48:18 UTC 2014


On 3 February 2014 20:48, Chris Muller <asqueaker at gmail.com> wrote:
> On Mon, Feb 3, 2014 at 12:19 PM, Frank Shearar <frank.shearar at gmail.com> wrote:
>> On 3 February 2014 16:58, Chris Muller <asqueaker at gmail.com> wrote:
>>> Well, I don't much like it.  Remember our discussion a couple of
>>> months ago, we were wondering whether LRUCache was even useful at all?
>>>  Granted, Levente said the prior _implementation_ was not useful,
>>> which he addressed with this new one.
>>>
>>> But now what was once a simple and fast check in Array>>#isLiteral now
>>> allocates an IdentityDictionary every time, just to accomodate this
>>> strange implementation of LRUCache.
>>
>> You mean "just to fix broken behaviour which relied on certain
>> unstated assumptions being true to avoid crashing horribly" :)
>> #isLiteral was a bit naive, but I suppose it's not so obvious a danger
>> as a cons cell.
>>
>> But anyway, this is why I wondered about writing a more general
>> solution. For instance, writing a DepthFirstfTraversal that explicitly
>> was safe against cyclic structures.
>
> Right now I'm just interested in getting the release done.

Oh, for sure! Sorry, I didn't mean to give the impression we ought to
do anything else than the minimal necessary for 4.5!

>>> And still leaves open other potential infinite-recursions.
>>
>> Like? It remembers which nodes it's visited.
>
> Only #isLiteral remembers that.  Printing doesn't / didn't.  Anything
> else that doesn't assume cycles will have the same issue.  Did someone
> check every method to make sure not?

Indeed! I thought you meant other potential infinite-recursions _in
that method_. The general fix, I reckon, is to write a general
traversal strategy. Hand-rolling the traversal's a bit rude: poking
around the collection's innards and stuff.

frank


More information about the Squeak-dev mailing list