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

Lisp memory leaks

Name: Anonymous 2015-08-30 2:04

Pushing a new location for an object onto our *object-locations* alist does seem a bit odd.
Since we’re never removing old locations for objects, just pushing new ones, it means that *object-locations* may contain multiple entries for a single object, and that this list now has two stored locations for the object in question.
Fortunately, the assoc command, which we use to find objects in a given location (within the objects-at command), always returns the first item it finds in a list. Therefore, using the push command makes the assoc command behave as if the value in the list for a given key has been replaced altogether.

Using the push and assoc commands together in this way allows us to pretend that values in an alist are changing, while still preserving old values.
Old values are simply suppressed by newer values, thus preserving a history of all old values.
The push/assoc idiom is a common technique used by Lispers.
-Land of Lisp, Chapter 5, Picking Up Objects

Memory leaks are a common technique used by Lispers?

Name: Anonymous 2015-08-30 9:41

>>4
Why on earth would you use Chinese?

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