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
POP-2
(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!
===Arrays and doublet functions=== There are no special language constructs to create arrays or record structures as they are commonly understood: instead, these are created with the aid of special builtin functions, e.g., {{code|newarray}}<ref>{{Cite web |url=http://www.cs.bham.ac.uk/research/projects/poplog/doc/pophelp/newarray |title=Help Newarray |last1=Rubinstein |first1=Mark |last2=Sloman |first2=A. |date=October 1985 β April 1989 |website=University of Birmingham |access-date=22 March 2024}}</ref> (for arrays that can contain any type of item) and {{code|newanyarray}}<ref>{{Cite web |url=http://www.cs.bham.ac.uk/research/projects/poplog/doc/pophelp/newanyarray |title=Help Newanyarray |last1=Hardy |first1=Steven |last2=Williams |first2=John |last3=Sloman |first3=A. |date=January 1978 β April 1986 |website=University of Birmingham |access-date=22 March 2024}}</ref> to create restricted types of items. Thus, array element and record field accessors are simply special cases of a ''doublet function'': this is a function that had another function attached as its ''updater'',<ref>{{Cite web |url=http://www.cs.bham.ac.uk/research/projects/poplog/doc/pophelp/updater |title=Help Updater |last=Sloman |first=A. |date=April 1985 |website=University of Birmingham |access-date=21 March 2024}}</ref> which is called on the receiving side of an assignment. Thus, if the variable {{code|a}} contains an array, then 3 -> a(4); is equivalent to updater(a)(3, 4); the builtin function {{code|updater}} returning the updater of the doublet. Of course, {{code|updater}} is a doublet and can be used to change the updater component of a doublet.
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)