090_Type_Checking

090_Type_Checking - TypeChecking Announcements Programming...

Info icon This preview shows pages 1–13. Sign up to view the full content.

View Full Document Right Arrow Icon
Type- Checking
Image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Announcements Programming Project 2 due tonight at 11:59PM. Office hours from 1:00PM – 3:00PM in Gates 160. Programming Project 3 out. Scope checkpoint due Saturday, July 23 at 11:59PM . This is a hard deadline , no late days allowed. Final submission due Wednesday, July 27 at 11:59PM . Start early ; this assignment is significantly larger than the previous two assignments.
Image of page 2
More Announcements Programming Assignment 1 graded and returned on paperless.stanford.edu. Mean: 52.9 / 60 Stdev: 8 Written Assignment 1 graded. Hard copies returned after class, electronic copies will be emailed later today. Mean: 20.2 / 24 Stdev: 3 Let us know ASAP if you haven't heard back from us by tomorrow morning.
Image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Where We Are Lexical Analysis Semantic Analysis Syntax Analysis IR Generation IR Optimization Code Generation Optimization Source Code Machine Code
Image of page 4
Review from Last Time class MyClass implements MyInterface { string myInteger; void doSomething() { int[] x; x = new string; x[5] = myInteger * y; } void doSomething() { } int fibonacci(int n) { return doSomething() + fibonacci(n – 1); } }
Image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Review from Last Time class MyClass implements MyInterface { string myInteger; void doSomething() { int[] x; x = new string ; x[5] = myInteger * y ; } void doSomething() { } int fibonacci(int n) { return doSomething() + fibonacci(n – 1); } } Interface not declared Wrong type Variable not declared Can't multiply strings Can't redefine functions Can't add void No main function
Image of page 6
Review from Last Time class MyClass implements MyInterface { string myInteger; void doSomething() { int[] x; x = new string ; x[5] = myInteger * y ; } void doSomething() { } int fibonacci(int n) { return doSomething() + fibonacci(n – 1); } } Wrong type Variable not declared Can't multiply strings Can't redefine functions Can't add void No main function
Image of page 7

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Review from Last Time class MyClass implements MyInterface { string myInteger; void doSomething() { int[] x; x = new string ; x[5] = myInteger * y ; } void doSomething() { } int fibonacci(int n) { return doSomething() + fibonacci(n – 1); } } Wrong type Variable not declared Can't multiply strings Can't add void No main function
Image of page 8
Review from Last Time class MyClass implements MyInterface { string myInteger; void doSomething() { int[] x; x = new string ; x[5] = myInteger * y ; } void doSomething() { } int fibonacci(int n) { return doSomething() + fibonacci(n – 1); } } Wrong type Can't multiply strings Can't add void No main function
Image of page 9

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Review from Last Time class MyClass implements MyInterface { string myInteger; void doSomething() { int[] x; x = new string ; x[5] = myInteger * y ; } void doSomething() { } int fibonacci(int n) { return doSomething() + fibonacci(n – 1); } } Wrong type Can't multiply strings Can't add void
Image of page 10
What Remains to Check? Type errors . Today: What are types? What is type-checking? A type system for Decaf.
Image of page 11

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
What is a Type? This is the subject of some debate.
Image of page 12
Image of page 13
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern