1 / 10

Understanding Type Checking, Overloading, and Polymorphism in Programming Languages

This document dives into type checking, conversion, coercion, and method overloading in various programming languages. It highlights how overloaded identifiers can link to multiple semantic entities within the same scope, using examples from Pascal, Fortran, PL/I, and Ada. The challenges of implementing overloaded identifiers are discussed, including the need for unique meanings through context and operator handling. Additionally, the concepts of polymorphism and overriding in Java are explored, culminating with a summary of key issues necessary for implementing a type checker.

asasia
Télécharger la présentation

Understanding Type Checking, Overloading, and Polymorphism in Programming Languages

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. More on Type Checking

  2. Conversion and Coercion Int C; A = 1.5 + C;

  3. Overloading An id binds to >1 semantic entity in same scope Pascal: f = f + 1 Fortran/PL1: + int or real addition Ada: A(i) Many languages: function decls with different parameter numbers/types Why? What are the challenges in implementing overloaded id’s?

  4. Resolving overloaded symbols • Determine unique meaning – use context • Operators (non-ids) • Ids

  5. Another example

  6. Overriding in Java

  7. Polymorphic Call Sites

  8. Polymorphic Functions:one function decl, multiple type args

  9. Polymorphism, Overloading, Overriding

  10. Type Checking Summary Exercise: With a partner, Outline the main issues you need to know to implement a type checker.

More Related