O'Reilly logo

Compilers: Principles and Practice by Himanshu B. Dave, Parag H. Dave

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

9.5 Procedures and Function Calls

Functions are an important and widespread abstraction mechanism in many different programming languages. A function is a first step to reusable code. A function name carries its returned value. A procedure is a function that does not return any useful value via its name, and it is used for its side effects only. We now discuss the implementation of functions and the kind of data structures we require to implement them.

There are a wide range of different design choices:

  • What are the types of arguments that can be passed as parameters or returned as results?
  • Do we allow variable number of arguments?
  • Do we allow recursion in functions?
  • Do we allow nested functions?
  • Can functions have side effects?

Various languages ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required