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
Callback (computer programming)
(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!
{{Short description|A function passed as data to and to be called by another function}} {{For|a discussion of callback with computer [[modem]]s|Callback (telecommunications)}} {{More references|date=September 2015}} [[File:Callback-notitle.svg|thumb|370px|A callback is often back on the level of the original caller.]] In [[computer programming]], a '''callback''' is a [[Function (computer programming)|function]] that is stored as data (a [[Reference (computer science)|reference]]) and designed to be called by another function {{endash}} often ''back'' to the original [[Abstraction (computer science)|abstraction layer]]. A function that accepts a callback [[Parameter (computer programming)|parameter]] may be designed to call back before [[Return statement|returning]] to its caller which is known as ''[[Synchronization (computer science)|synchronous]]'' or ''blocking''. The function that accepts a callback may be designed to store the callback so that it can be called back after returning which is known as ''asynchronous'', ''[[Non-blocking algorithm|non-blocking]]'' or ''deferred''. [[Programming languages]] support callbacks in different ways such as [[function pointers]], [[Lambda (programming)|lambda expressions]] and [[block (programming)|blocks]]. A callback can be likened to leaving instructions with a tailor for what to do when a suit is ready, such as calling a specific phone number or delivering it to a given address. These instructions represent a callback: a function provided in advance to be executed later, often by a different part of the system and not necessarily by the one that received it. The term ''callback'' can be misleading, as it does not necessarily imply a return to the original caller, unlike a [[callback (telecommunications)|telephone callback]]. Mesa programming language formalised the callback mechanism used in Programming Languages. By passing a procedure as a parameter, Mesa essentially delegated the execution of that procedure to a later point in time when a specific event occurred, similar to how callbacks are implemented in modern programming languages.<ref>{{Cite journal |last=E. Sweet |first=Richard |title=The Mesa Programming Environment |url=https://dl.acm.org/doi/pdf/10.1145/17919.806843 |journal=ACM |issue=ACM 0-89791-165-2/85/006/0216}}</ref>
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)