{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

Examples from Class - 3 Global[CL[AL[foo3->[< Global | impl...

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

View Full Document Right Arrow Icon
3. Global [CL] [AL] [foo3:]-----> [< Global | impl of foo3] [foo5:] foo(5): [CL: Global]-----> [CL of Global ] [AL: Global] [RA | line 10] [RRA: Global : foo(5)]-----> [foo5] of Global parameters : 5 inLine 1: [CL: foo3(5)] [AL: foo3(5)] [Local Variables: foo1:------------------------->[<inLine2 | impl of foo1] foo2:]------------------------->[<inLine1 | impl of foo2] [foo2(foo1, 5)] foo2(foo1, 5): [CL: inLine1] [AL: inLine1] [RA: Line 7] [RRA:inLine1.foo2(foo1, 5)]---->[foo2(foo1, 5)] of inLine1 [f:]------------------------------------>[inLine1.impl of foo1] foo1(5): [CL: foo2(foo1, 5)]------------>[CL: inLine1] of foo2(foo1, 5) [AL: inLine1]-------------------->[CL: foo3(5)] of inLine1 [RA: Line 6]--------------------->[f:] of foo2(foo1, 5) [RRA: foo2(foo1, 5). f(x)] [y: 5] Key differences from ML and Scheme: ML is compiled and Scheme is interpreted. Type checking is different because of compiled and interpreted. ML supports loops and Scheme doesn’t. Scheme is dynamically typed and ML is statically typed. ML has struct and Scheme doesn’t.
Image of page 1

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

View Full Document Right Arrow Icon
Compare ML and C variables: Regular Variables in ML cannot be changed and in C they can. Difference between ML reference cells and C pointers. ML references addresses cannot be modified and in C they can. Pass by reference, the address and the binding cannot be modified where pointers they both can. Type: A collection of of computable values that share some structural property. Types are used for: Organization of concepts. Identify and prevent errors. Support translation.(Compiler) To prevent errors. Compiler translation. Organization of concepts. Optimizations. Basic Type: Type of atomic values-> ints Compound Types: Arrays, list, pointers Type Declaration: Declaring and value. Declare a new Type. Transparent give a name to an existing Type. Type System: Everything in a language that works and declares Types. All of the com- ponents. Type Error: When a value is misinterpreted or misused with unintended smeantics. Type-Safe: Can avoid all Type Errors. Catch errors caught at Compile-Time. Garbage collection is necessary. Polymorphism: A function is polymorphic if it can run on many different Types. Types of Polymorphism: Parametric polymorphism: A single implementation is used for all different types.
Image of page 2
Image of page 3
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