Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

LISP ZIPPERS

Name: Anonymous 2013-01-17 2:23

Integrating zippers into the very core of Lisp as a replacement/enhancement of cons lists.

Discuss.

Name: Anonymous 2013-01-17 3:38

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512

>>2
It is a purely functional transformation of a data structure that allows easy and efficient navigation.

For example, a (cons) list zipper of the list (0 1 2 3 4) focused at position 3 could be represented as ((2 1 0) . (3 4)). As you can see, you can travel both forwards and backwards in the list in O(1), e.g. to travel backwards, you would remove the 2 in the first position of the first list and insert it as the first element of the second list.

You can also have tree zippers (which would have an 'up' navigation function instead of just 'left-child' and 'right-child'), as well as for pretty much any kind of data structure.

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.12 (GNU/Linux)

iF4EAREKAAYFAlD3uGkACgkQGRQwWY30ng2pAQD/d0Fb7+RUV17mqLxrrnBjI9JO
4Jzde7lUDstEGYoJaW0A/i9R7oJ326vqyCzRrinM6DNtKcYZz+BBii2Xi4xwQ59z
=t48V
-----END PGP SIGNATURE-----

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List