Design issues of subprogram

DESIGN ISSUES OF SUBPROGRAM

Subprogram: A subprogram means a function or procedure.

Some of the design issues of subprogram are:
  • Are local variables static or dynamic?
  • Can subprogram definitions appear in other subprogram definitions?
  • What parameter-passing method or methods are used?
  • Are the types of the actual parameters checked against the types of the formal parameters?
  • If subprograms can be passed as parameters and subprograms can be nested, 
  • what is the referencing environment of a passed subprogram?
  • Can subprograms be overloaded?
  • Can subprograms be generic?
  • If the language allows nested subprograms, are closures supported?
Some definitions to be know:

An overloaded subprogram is one that has the same name as another subprogram in the same referencing environment. 

A generic subprogram is one whose computation can be done on data of different types in different
calls. 

A closure is a nested subprogram and its referencing environment, which together allow the subprogram to be called from anywhere in a program.


Principles of Programming Languages:

EasyExamNotes.com covered following topics in these notes.

Practicals:
Previous years solved papers:
A list of Video lectures
References:
  1. Sebesta,”Concept of programming Language”, Pearson Edu 
  2. Louden, “Programming Languages: Principles & Practices” , Cengage Learning 
  3. Tucker, “Programming Languages: Principles and paradigms “, Tata McGraw –Hill. 
  4. E Horowitz, "Programming Languages", 2nd Edition, Addison Wesley 

Share: