Lecture 20 Spring 2003 Department of Computer Science Lecture 20 Spring 2003 Department of Computer Science CS603 Programming Language Organization.

Slides:



Advertisements
Similar presentations
Arthurian Legend Jill Ash Jane Clayton Linda Cotten Debbie Thompson Priscilla Sewell.
Advertisements

Lecture Computer Science I - Martin Hardwick Strings #include using namespace std; int main () { string word; cout
1 Languages and Compilers (SProg og Oversættere) Lecture 13 (2) Bent Thomsen Department of Computer Science Aalborg University With acknowledgement to.
Lords and Vassals. Vassal – a lesser lord who has been granted a fief by a greater lord.
ML Exceptions.1 Standard ML Exceptions. ML Exceptions.2 Exceptions – The Need  An extensive part of the code is error handling  A function can return.
Georgia Department of Education. Information Technology Pathways.
Disjoint Unions (quick review)
ML: a quasi-functional language with strong typing Conventional syntax: - val x = 5; (*user input *) val x = 5: int (*system response*) - fun len lis =
Types A type consists of –a set of values –a set of operations on those values Types can be –primitive (atomic, non-decomposable) –composite (includes.
CS 106 Introduction to Computer Science I 02 / 20 / 2008 Instructor: Michael Eckmann.
Section 2.6 Question 1. Section 2.6 Answer 1 Section 2.6 Question 2.
Sir Gawain and the Green Knight Do now: Why do you think things are repeated in threes in the story?
10/18-10/19 Bellwork. Literary Present "Use the present tense when discussing a literary work, since the author of the work is communicating to the reader.
Sir Gawain and the Green Knight British Literature October 28, 2014.
CS 424/524: Introduction to Java Programming Lecture 25 Spring 2002 Department of Computer Science University of Alabama Joel Jones.
February 14, 2005 Characters, Strings and the String Class.
The string data type String. String (in general) A string is a sequence of characters enclosed between the double quotes "..." Example: Each character.
Mr. Verlin South Philadelphia High School January 22 and 23, 2015.
The CYK Algorithm Presented by Aalapee Patel Tyler Ondracek CS6800 Spring 2014.
CS 403: Programming Languages Lecture 6 Fall 2003 Department of Computer Science University of Alabama Joel Jones.
CS 403: Programming Languages Lecture 1 Fall 2003 Department of Computer Science University of Alabama Joel Jones.
Chapter 9: Functional Programming in a Typed Language.
Riyadh Philanthropic Society For Science Prince Sultan College For Woman Dept. of Computer & Information Sciences CS 251 Introduction to Computer Organization.
CS 603: Programming Language Organization Lecture 7 Spring 2003 Department of Computer Science University of Alabama Joel Jones.
THE UNITED KINGDOM OF GREAT BRITAIN AND NORTHERN IRELAND.
CS 603: Programming Language Organization Lecture 10 Spring 2004 Department of Computer Science University of Alabama Joel Jones.
CS 614: Theory and Construction of Compilers Lecture 7 Fall 2002 Department of Computer Science University of Alabama Joel Jones.
CS 614: Theory and Construction of Compilers Lecture 8 Fall 2003 Department of Computer Science University of Alabama Joel Jones.
CS 614: Theory and Construction of Compilers Lecture 17 Fall 2003 Department of Computer Science University of Alabama Joel Jones.
1 CS161 Introduction to Computer Science Topic #17.
Homogeneous tuples What are they? –S 2 = S x S –S n = S x S x … x S Cardinalities –#(S 2 )= (#S) 2 –#(S n )= (#S) n –#(S 0 )= (#S) 0 =1 What is S 0 ? –It.
Learning Objective To view and participate in a discussion of "Finding Forrester" and to write a follow-up essay that is a comprehensive and persuasive.
CS 603: Programming Language Organization Lecture 8 Spring 2004 Department of Computer Science University of Alabama Joel Jones.
Her Majesty Queen Elisabeth II Her Majesty’s full titles, which were accorded her at her coronation in Westminster Abbey on 2 June1953, are: Elizabeth.
CS 403: Programming Languages Lecture 12 Fall 2003 Department of Computer Science University of Alabama Joel Jones.
CS 603: Programming Language Organization Lecture 9 Spring 2003 Department of Computer Science University of Alabama Joel Jones.
CS 614: Theory and Construction of Compilers Lecture 15 Fall 2003 Department of Computer Science University of Alabama Joel Jones.
Copyright © 2011 Pearson, Inc. 3.6 Mathematics of Finance.
CS 614: Theory and Construction of Compilers Lecture 5 Fall 2003 Department of Computer Science University of Alabama Joel Jones.
LE MORTE DARTHUR. BOOK 1  Tells the story of Arthur’s birth and his rise to power.  Tells of Arthur’s many battles, the story of his son / nephew’s.
M M M M 5. Not Listed
CS 603: Programming Language Organization Lecture 1 Spring 2003 Department of Computer Science University of Alabama Joel Jones.
David Evans CS150: Computer Science University of Virginia Computer Science Lecture 4: Programming with Data.
CS 614: Theory and Construction of Compilers Lecture 10 Fall 2003 Department of Computer Science University of Alabama Joel Jones.
CS 614: Theory and Construction of Compilers Lecture 8 Fall 2002 Department of Computer Science University of Alabama Joel Jones.

CS 603: Programming Language Organization Lecture 6 Spring 2003 Department of Computer Science University of Alabama Joel Jones.
CS 614: Theory and Construction of Compilers Lecture 4 Fall 2002 Department of Computer Science University of Alabama Joel Jones.
CS 603: Programming Language Organization Lecture 3 Spring 2002 Department of Computer Science University of Alabama Joel Jones.
CS 614: Theory and Construction of Compilers
CS 403: Programming Languages
CS 603: Programming Language Organization
The fattest knight at King Arthur's round table was Sir Cumference
Welcome to CS140 Assembly Language and Computer Organization
Feudalism Definition of Feudalism: “A social system that existed in Europe during the Middle Ages in which people worked and fought for nobles who gave.
CS216: Program and Data Representation
Lecture 6: Programming with Data CS150: Computer Science
Review for Test1.
Thinking about Strings
CS-401 Computer Architecture & Assembly Language Programming
FLIPPED CLASSROOM ACTIVITY CONSTRUCTOR – USING EXISTING CONTENT
Department of Computer Science & Engineering, HITEC University, Taxila
Lecture 3 Finishing SQL
CS148 Introduction to Programming II
Programming Languages Dan Grossman 2013
CS 403: Programming Languages
CS148 Introduction to Programming II
CS 403: Programming Languages
CS148 Introduction to Programming II
Quick Quiz 1) Where was William Duke of?
Presentation transcript:

Lecture 20 Spring 2003 Department of Computer Science Lecture 20 Spring 2003 Department of Computer Science CS603 Programming Language Organization

©2003 Joel Jones Questions Answers from last time Programming Questions Answers from last time Programming Overview

©2003 Joel Jones See Handout null, hd, tl, prod (2 ways), length (2 ways) See Handout null, hd, tl, prod (2 ways), length (2 ways) Programs from last time

©2003 Joel Jones Suppose we want to represent all inhabitants of a kingdom by their class: King – simply himself Peer – has a degree, territory and number ex.: “the 7th Earl of Carlisle” Knight or Peasant – has a name Suppose we want to represent all inhabitants of a kingdom by their class: King – simply himself Peer – has a degree, territory and number ex.: “the 7th Earl of Carlisle” Knight or Peasant – has a name Welcome to the ML Realm How might we represent this in µ-Scheme?

©2003 Joel Jones “king” (”Earl” “Carlisle” 7) (”Duke” “Norfolk” 9) (”Knight” “Gawain”) (”Knight” “Galahad”) (”Peasant” “Jack Cade”) (”Peasant” “Wat Tyler”) But this doesn’t work in ML! “king” (”Earl” “Carlisle” 7) (”Duke” “Norfolk” 9) (”Knight” “Gawain”) (”Knight” “Galahad”) (”Peasant” “Jack Cade”) (”Peasant” “Wat Tyler”) But this doesn’t work in ML! The Realm in µ-Scheme Why?

©2003 Joel Jones Write a datatype for representing a person datatype person = King | Peer of... | Knight of... | Peasant of... ; Write a datatype for representing a person datatype person = King | Peer of... | Knight of... | Peasant of... ; Programs

©2003 Joel Jones Write a function title that behaves as follows: title King yields “His Majesty the King” title Peer(”Earl”, “Carlisle”,7) yields “The Earl of Carlisle” title (Knight “Gawain”) yields “Sir Gawain” title (Peasant “Joel”) yields “Joel” Write a function sirs that returns the name of all Knights in a list of persons, as a list of strings: sirs [King, Peasant(”Joel”), Knight(”Gawain”)] yields [“Gawain”] Write a function title that behaves as follows: title King yields “His Majesty the King” title Peer(”Earl”, “Carlisle”,7) yields “The Earl of Carlisle” title (Knight “Gawain”) yields “Sir Gawain” title (Peasant “Joel”) yields “Joel” Write a function sirs that returns the name of all Knights in a list of persons, as a list of strings: sirs [King, Peasant(”Joel”), Knight(”Gawain”)] yields [“Gawain”] Programs (cont.)

©2003 Joel Jones “Programming in Standard ML” Source code from above book Moscow ML Web-based impcore, µ-scheme, Moscow-ML interpreters atic/ “Programming in Standard ML” Source code from above book Moscow ML Web-based impcore, µ-scheme, Moscow-ML interpreters atic/ Resources