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.7 Tail Recursion

13.7.1 Recursive Control Behavior

Thus far in our presentation of recursive, functional programming, we have primarily used recursive control behavior, where the definition of a recursive function naturally reflects the recursive specification of the function. For instance, consider the following definition of a factorial function in Scheme, which naturally mirrors the mathematical definition of a factorial n factorial minus n asterisk, left parenthesis, n minus 1, right parenthesis, factorial sign, colon.

A set of five code lines in Scheme with the definition of the function factorial.
Description

Each call to factorial is made with a promise to multiply the value returned by n at the time of the call. ...

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