The "move-to-front" heuristic is equivalent to the LRU caching policy.
The "move-up-by-one" heuristic converges to LFU (least frequently used) caching policy. Perhaps LFU is what you really want? BTW, "move-up-by-one" has a side-effect on every invocation, as does "move-to-front". However, you can do "move-up-by-one" only every 1/N times, and still converge to LFU. At 12:55 PM 4/27/2020, Wilhelm Fitzpatrick wrote: >I've been digging down to really understand the symbol implementation in >Picolisp, since symbols are used for so many purposes within the language. > >One surprising thing I learned last night is that (get ...) has a side effect! >It moves the key that was accessed to the head of the symbol "tail". I assume >this is a performance optimization to cause recently accessed properties to >"bubble up" to the front of the list in case they are re-accessed soon. > >A few questions: > >1. I understand why (cdr) doesn't function on a symbol (semantically it's not >a pair) but I'm curious why (car) is allowed to work (returning the VAL)? > >2. Is there anyway within the REPL to inspect the tail structure of the symbol >directly? This is mostly from curiosity. > >3. Again from curiosity, I'm wondering why the bytes of the name are seemingly >stored "backwards"? I'm assuming this also provides some performance >optimization. > >-wilhelm > >-- >UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe -- UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe