CS 403: Programming Languages Lecture 5 Fall 2003 Department of Computer Science University of Alabama Joel Jones.

Slides:



Advertisements
Similar presentations
Introduction to Java 2 Programming Lecture 5 Array and Collections.
Advertisements

CPSC 388 – Compiler Design and Construction
10. Smalltalk and Closures Programmierung 2, SS 2007 Adrian Kuhn, PhD candidate Software Composition Group University of Bern.
Client Side Programming Using Java Applet Outcomes: You will be expected to know: – Java Applets and HTML file; –bytecode and platform independent programs;
Principles of Object-Oriented Software Development The language Smalltalk.
1 Owais Mohammad Haq Department of Computer Science Eastern Michigan University April, 2005 Java Script.
Stéphane Ducasse 1 The Taste of Smalltalk.
CS 106 Introduction to Computer Science I 02 / 12 / 2007 Instructor: Michael Eckmann.
Fall 2005CSE 115/503 Introduction to Computer Science I1 Lecture #4 Agenda Announcements Review Questions? Classes and objects UML class diagrams Creating.
Squeak Collections The Squeak collection hierarchy. Some collection operators. Working with collections. For-loops.
Stéphane Ducasse 1 Smalltalk in a Nutshell.
S.Ducasse Stéphane Ducasse 1 The Taste of Smalltalk.
Introduction to JavaScript for Python Programmers
Peter Juszczyk CS 492/493 - ISGS. // Is this C# or Java? class TestApp { static void Main() { int counter = 0; counter++; } } The answer is C# - In C#
Introduction to Ruby CSE 413 Autumn 2008 Credit: Dan Grossman, CSE341.
CSE 131 Computer Science 1 Module 1: (basics of Java)
Starting Chapter 4 Starting. 1 Course Outline* Covered in first half until Dr. Li takes over. JAVA and OO: Review what is Object Oriented Programming.
1 Programming James King 12 August Aims Give overview of concepts addressed in Web based programming module Teach you enough Java to write simple.
3A-1 1 Introduction to Smalltalk History of Smalltalk The philosophy of Smalltalk:  “...we have a universe of well-behaved objects that courteously ask.
Iteration and Simple Menus Deterministic / Non-deterministic loops and simple menus.
Computing Science 1P Lecture 21: Friday 20 th April Simon Gay Department of Computing Science University of Glasgow 2006/07.
 2003 Joel C. Adams. All Rights Reserved. Calvin CollegeDept of Computer Science(1/10) An Overview of Objects and the Java API Joel Adams and Jeremy Frens.
A brief introduction to 11ACM 朱旻申. Outline What is Groovy ? Differences between Groovy & Java About closure & Dagger Methods.
Sadegh Aliakbary Sharif University of Technology Fall 2012.
Advanced Programming Collage of Information Technology University of Palestine, Gaza Prepared by: Mahmoud Rafeek Alfarra Lecture 2: Major Concepts of Programming.
Data Structures Chapter 1- Introduction Mohamed Mustaq.A.
Smalltalk for Unix & W i n d o w s Dennis Smith Cherniak Software Development Corporation.
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.
General Data Structures and Algorithms CS 244 Brent M. Dingle, Ph.D. Department of Mathematics, Statistics, and Computer Science University of Wisconsin.
CS 614: Theory and Construction of Compilers Lecture 18 Fall 2003 Department of Computer Science University of Alabama Joel Jones.
April 6, 1998CS102-02Lecture 2-1 Java Operators CS Lecture 2-1 Being a Smooth Operator.
Chapter 12 Support for Object oriented Programming.
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.
Squeak and Botkit-Port Jeff Forbes Joel Miller. Introduction ● Squeak is a pure OO language ● Based off of SmallTalk-80 – Designed at Xerox PARC by Alan.
Lecture 121 CS110 Lecture 12 Tuesday, March 9, 2004 Announcements –hw5 due Thursday –Spring break next week Agenda –questions –ArrayList –TreeMap.
Smalltalk Mark Colangelo CMSC-631, Fall December 2002.
CMSC 330: Organization of Programming Languages Functional Programming with OCaml.
1 Programming 2 Aims Give overview of concepts addressed in Web based programming module Teach you enough Java to write simple web and network applications.
CS 403: Programming Languages Lecture 18 Fall 2003 Department of Computer Science University of Alabama Joel Jones.
CS 614: Theory and Construction of Compilers Lecture 5 Fall 2003 Department of Computer Science University of Alabama Joel Jones.
IS2802 Introduction to Multimedia Applications for Business Lecture 4: JavaScript, Loops, and Conditional Statements Rob Gleasure
Arrays-. An array is a way to hold more than one value at a time. It's like a list of items.
S.Ducasse Stéphane Ducasse 1 Smalltalk in a Nutshell.
CS 603: Programming Language Organization Lecture 1 Spring 2003 Department of Computer Science University of Alabama Joel Jones.
CSE 501N Fall ’09 07: Iteration 17 September 2009 Nick Leidenfrost.
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.
©2004 Joel Jones 1 CS 403: Programming Languages Lecture 3 Fall 2004 Department of Computer Science University of Alabama Joel Jones.
Comp1004: Loops and Arrays I Whiles, For and Arrays[]
MS. NANCY HARRIS LECTURER, DEPARTMENT OF COMPUTER SCIENCE CS 149 – Programming Fundamentals (Accelerated)
Outline Basic concepts in computer security
BY GAWARE S.R. COMPUTER SCI. DEPARTMENT
INTRODUCTION TO OBJECT-ORIENTED PROGRAMMING (OOP) & CONCEPTS
CS 603: Programming Language Organization
CS190/295 Programming in Python for Life Sciences: Lecture 6
Introduction to Object-Oriented Programming with Java--Wu
Introduction to Computer Programming
CS 331 Principles of Programming Languages
CS148 Introduction to Programming II
Groovy.
Let’s Talk about… Smalltalk.
CS 403: Programming Languages
Gavin Restifo March 1, 2019 Today: Repetition Part 2 - For Loops
Loops and Iteration CS 21a: Introduction to Computing I
CSE 3302 Programming Languages
CS 403: Programming Languages
Week 6 - Monday CS221.
Presentation transcript:

CS 403: Programming Languages Lecture 5 Fall 2003 Department of Computer Science University of Alabama Joel Jones

Lecture 5©2003 Joel Jones2 Outline Introduction to Smalltalk—What, Why, How Introduction to Squeak

Lecture 5©2003 Joel Jones3 What is different about Smalltalk? Everything is an object A real integrated development environment Carefully integrated classes and syntax Dynamically typed Simple syntax

Lecture 5©2003 Joel Jones4 Why learn Smalltalk? Nobody uses it. Yeah, nobodys like: FedEx Ericsson Chrysler Deutsche Bank Dunn and Bradstreet Wisconsin Department of Revenue Geico Direct John Deere Texas Instruments Nokia Mitsubishi Volkswagen Bell Atlantic NYNEX Bell South MCI USWest

Lecture 5©2003 Joel Jones5 History of Smalltalk A few links html html lk/DaveThomas-TravelsWithSmalltalk.htm lk/DaveThomas-TravelsWithSmalltalk.htm

Lecture 5©2003 Joel Jones6 Are you serious? But hopefully you will get a feel for why I like Smalltalk so much and Why we will be looking at Smalltalk a little further Will I be a good Smalltalk programmer by the end of the lecture?

Lecture 5©2003 Joel Jones7 Why do I care about the properties mentioned earlier? Carefully integrated classes and syntax for (Iterator i = myCollection.iterator(); i.hasNext(); ) { ItemType myItem = (ItemType) i.next(); myItem.something(); } myCollection do [:myItem | myItem something ] Java Smalltalk

Lecture 5©2003 Joel Jones8 Why do I care about the properties mentioned earlier? Everything is an object for (int i = 0; i < myArray.length; i++) { ItemType myItem = myArray[i]; myItem.something(); } myArray do [:myItem | myItem something ] Java Smalltalk Pair Up: What other property is exhibited here?

Lecture 5©2003 Joel Jones9 How the heck did that Smalltalk code work? Simple stuff first myItem something is a simple message send with no arguments A little harder myCollection do: [ … ] is a message send with one keyword with an argument Even harder […] is a block, which is a closure, a thunk with arguments, an anonymous inner class, a function pointer with lexical capture, etc.

Lecture 5©2003 Joel Jones10 Everything is an Object I wasn’t kidding The block is an object All loops and control structures in Smalltalk are objects Once you learn them, the collection classes mean you don’t have to write the same kind of loop infrastructure over and over again

Lecture 5©2003 Joel Jones11 Control methods Collections do: select: collect: detect: detect: ifNone: inject: into: reject: Boolean ifTrue: ifTrue: ifFalse: ifFalse: ifFalse: ifTrue:

Lecture 5©2003 Joel Jones12 What is the Smalltalk programming environment like? We will be using Squeak, a freely available implementation We’ll be looking at it right now. A quick reference can be found at:

Lecture 5©2003 Joel Jones13 References Download implementation, etc. Smalltalk idioms and conventions alk.html alk.html

Lecture 5©2003 Joel Jones14 Next two classes I will be out of town Meet at normal class time and place Someone will have lab assignments for you to do on Smalltalk