In most Lisp languages, you only can "append" to a list, never "prepend".

Python, e.g., has such structures:
https://www.geeksforgeeks.org/deque-in-python/

The "*d*ouble *e*nded *queue*". Appending, prepending, Python simply lets
you do, what you want! ;-)

Mighty, mighty stuff, highly efficient!

Have fun!

Am Montag, 27. April 2020 schrieb Wilhelm Fitzpatrick <raf...@well.com>:
> 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
>

Reply via email to