Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Association list
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
==Applications and software libraries== In the early development of Lisp, association lists were used to resolve references to [[Free variables and bound variables|free variables]] in procedures.<ref name="mccarthy_lisp_1.5">{{cite book | url = https://archive.org/details/lisp15programmer00john | title = LISP 1.5 Programmer's Manual | publisher = [[MIT Press]] | first1 = John | last1 = McCarthy | first2 = Paul W. | last2 = Abrahams | first3 = Daniel J. | last3 = Edwards | first4 = Timothy P. | last4 = Hart | first5 = Michael I. | last5 = Levin | isbn = 0-262-13011-4 | year = 1985 | url-access = registration }} See in particular p. 12 for functions that search an association list and use it to substitute symbols in another expression, and p. 103 for the application of association lists in maintaining variable bindings.</ref><ref>{{cite book|title=What Computing Is All About|series=Monographs in Computer Science|first=Jan L. A.|last=van de Snepscheut|publisher=Springer|year=1993|isbn=9781461227106|page=201|url=https://books.google.com/books?id=VXPrBwAAQBAJ&pg=PA201}}</ref> In this application, it is convenient to augment association lists with an additional operation, that reverses the addition of a key–value pair without scanning the list for other copies of the same key. In this way, the association list can function as a [[Stack (abstract data type)|stack]], allowing [[local variables]] to temporarily [[Variable shadowing|shadow]] other variables with the same names, without destroying the values of those other variables.<ref>{{cite book|title=Programming Language Pragmatics|first=Michael Lee|last=Scott|publisher=Morgan Kaufmann|year=2000|isbn=9781558604421|page=137|contribution-url=https://books.google.com/books?id=To3xpkvkPvMC&pg=PA137|contribution=3.3.4 Association Lists and Central Reference Tables}}</ref> Many programming languages, including Lisp,<ref name="mccarthy_lisp_1.5"/> [[Scheme (programming language)|Scheme]],<ref>{{cite book|title=Programming and Meta-Programming in Scheme|series=Undergraduate Texts in Computer Science|first=Jon|last=Pearce|publisher=Springer|year=2012|isbn=9781461216827|page=214|url=https://books.google.com/books?id=uDzaBwAAQBAJ&pg=PA214}}</ref> [[OCaml]],<ref>{{cite book|title=Real World OCaml: Functional Programming for the Masses|first1=Yaron|last1=Minsky|first2=Anil|last2=Madhavapeddy|first3=Jason|last3=Hickey|publisher=O'Reilly Media|year=2013|isbn=9781449324766|page=253|url=https://books.google.com/books?id=nabtAQAAQBAJ&pg=PA253}}</ref> and [[Haskell (programming language)|Haskell]]<ref>{{cite book|title=Real World Haskell: Code You Can Believe In|first1=Bryan|last1=O'Sullivan|first2=John|last2=Goerzen|first3=Donald Bruce|last3=Stewart|publisher=O'Reilly Media|year=2008|isbn=9780596554309|page=299|url=https://books.google.com/books?id=nh0okI1a1sQC&pg=PA299}}</ref> have functions for handling association lists in their [[standard library|standard libraries]].
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)