Skip to Content
Programming Languages: Concepts and Implementation
book

Programming Languages: Concepts and Implementation

by Saverio Perugini
December 2021
Beginner
840 pages
47h 29m
English
Jones & Bartlett Learning
Content preview from Programming Languages: Concepts and Implementation

13.9 Callbacks

A callback is simply a reference to a function, which is typically used to return control flow back to another part of the program. The concept of a callback is related to continuation-passing style. Consider the following Scheme program in direct style:

A set of 10 code lines in Scheme that is in direct style.
Description

The main program (lines 6–8) calls addWord (to add a word to the dictionary; line 7), followed by getDictionnaire (to get the dictionary; line 8). The following is the rendering of this program in CPS using a callback:

A set of nine code lines in Scheme with the function let asterisk.
Description

This expression uses CPS without ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Concepts and Semantics of Programming Languages 1

Concepts and Semantics of Programming Languages 1

Therese Hardin, Mathieu Jaume, Francois Pessaux, Veronique Viguie Donzeau-Gouge
Programming C# 10

Programming C# 10

Ian Griffiths

Publisher Resources

ISBN: 9781284222739