Class Note for CS 403 at UA-Programming Languages (20)
Class Note for CS 403 at UA-Programming Languages (20)
Popular in Course
Popular in Department
This 4 page Class Notes was uploaded by an elite notetaker on Friday February 6, 2015. The Class Notes belongs to a course at University of Alabama - Tuscaloosa taught by a professor in Fall. Since its upload, it has received 16 views.
Reviews for Class Note for CS 403 at UA-Programming Languages (20)
Report this Material
What is Karma?
Karma is the currency of StudySoup.
You can buy or earn more Karma at anytime and redeem it for class notes, study guides, flashcards, and more!
Date Created: 02/06/15
CS 403 10312002 0 Today Quick review of Scheme s editor amp documentation Finish Smalltalk Note There will be additional slides posted later tonight 0 Next Tuesday ntroduce Prolog chapter 13 m 2002 cs 403Nm P I Advising should be finished 0 If you plan to graduate in May or August 2003 you should file an application for degreequot right away 0 If you plan to graduate in December 2003 file your application in the spring 0 If you plan to graduate this December and haven t filed an application good luck F0 2002 cs 40 Nates P Grades onIine 0 Your grades for all the assignments I ve graded are on the website Please check them for typos etc 0 You can get your grades using your 5 digit random number 0 You will get writing assignment 2 and hopefully 3 back on Tuesday m 2002 cs 403Nm P LISP 9 MIT Scheme We have the MIT Scheme version of LISP Version 770 o It is installed in the lab EE116 You can download amp install it from httpwwwswissaimiteduprojectsschememit There are several minor differences from the LISP ofthe textbook You will need to look in the User s Guide V ndows menu Documentation 7 t amp f forTrue amp False Watch for others F0 2002 cs 40 Nates P 4 Scheme Assignment is posted Due next Tuesday Be sure to check the Documentation a complete user s guide to the language including several small examples I think it s easiest to use Scheme s Edwin a version of the Emacs editor Check the Tutorial Ch t Read through at least half of it 50 on the status line You can evaluate functions in the editor You can save buffers into files etc m 2002 cs 403Nm P 5 Edwin Emacs Quick Keys Ckey 9 Control key Mkey 9 Meta or Alt key also ESCkey Ch 9 Help several options Ch m 9 lists commands for Scheme mode Cx 2 9 splits the editor window in 2 to show 2 buffers ie Tutorial and schemequot Cx o 9 moves point cursor to other window Cx 1 9 removes split windows 09 9 abort command Cx Cf 9 reads a file into a buffer Cx Os 9 saves buffer to file F0 2002 cs 40 Nates P e 5 Edwin Emacs Quick Keys C x C e 9 evaluates the Scheme expression Cursor should be after last of expression C k 9 Kill a line from cursor V ndows cut Make a region MS Windows highlight Set a mark at one end of region C or Cspace Sets the mark at point Shows no visible sign Move point to other end of region then Cw kills MS Win cuts the region Cy yanks it back MS Win paste but still in the kill buffer So Cw Cy 9 MS Win copy m 2mm cs 403 Class Names Smalltalk History closely tied to Xerox amp Alan Kay Kay s Dynabook a notebook computer designed in 1970 Dynabook used touchscreen overlapping windows Extensively tested with children aged 615 Alan Kay laterwent to Apple and designed the Mac Smalltalk72 was first version m 2mm cs 403 Class Names Edwin Emacs Motion Keys Cursor Motion Backward Up Forward Down One character Cb Cf Word Mb Mf Line Cp previous Cn next Screen Cv Mv BeginEnd of line Ca Ce BE of sentence Ma Me BE of paragraph M M BE Lisp function CMa CMe BE of buffer Mlt Mgt miznnz cs 40 class ms 1 Smalltalk Objects amp Classes Everything is an object Even a class is an object Smalltalk is interactive amp interpreted Objects are instances of Classes So classes can also get messages Class hierarchy Everything ultimately descends from the object class Subclasses inherit and can be extended FallZEIEIZ cs 403 Class Naies Smalltalk Messages Objects send amp receive messages and act on those messages Sending a message to an object is very similarto calling a member function of that object Even control structures are messages to objects Overloading operators is implicit amp easy Each operator if defined is defined for that class so for a string is different from for numbers m 2mm cs ACEClassNalzs P e n Classes amp Inheritance Hierarchical subclasses preclude orthogonal classifications Multiple inheritance polymorphism causes lots of problems Assume class X inherits from classes A amp B X A B FallZEIEIZ cs 403 Class Naies P212 Functions lt gt Objects Algollike languages are function oriented Programs are active Data is passive You pass objects data to functions to do things Object oriented languages Objects data are active They respond to messages The message is only a signal relatively passive To do something send a message to an object Objects store the state of the computation Concurrency is easy Fa 2mm cs ACEClassNalzs P I Names are not Objects Names are not inherently typed The type is assigned and checked when the object is created or when it receives a message This is dynamic type checking Algollike languages do static type checking at compile time Both static amp dynamic type checking can still enforce strong type checking as opposed to weak type checking Fuiiznnz cs 403 ciuss Nuns P 14 Smalltalk Virtual Machine VM Three main parts Storage manager Manages objects creates amp deletes objects Must also manage memory free amp in use Interpreter Primitive subroutines Written in machine code for efficiency lO arithmetic basic screen graphics etc Fa 2mm cs ACEClassNalzs P I Object implementation 0 Basic information Fig 1214 Length amount of memory used Pointer to this object s class Attributes ie Box location size pen These may be references to other objects etc 0 But a class is also an objectFig 1215 80 it has the same kind of information Superclass message descriptions Fuiiznnz cs 403 ciuss Nuns P I Messages Essentially implemented as procedure calls 0 Need activation recordsquot for each activation of a method for each message sent Environment part lnstruction part Sender part Dynamic link 9 who to return to Fa 2mm cs ACEClassNalzs P 217 Activation Records Stack No Can t do concurrency on a stack 0 Records are created and destroyed by the Storage Managerquot 0 How does the Storage Manager know when to delete an object Each object keeps a count of references to itself When the count goes to zero delete it Fuiiznnz cs 403 ciuss Nuns P e 12 Object Oriented Languages C9C LISP 9 CLOS Common Lisp Object System 0 Java derived largely from C 0 Ada we ll see this language later m 2mm cs ACEClassNalzs P l Evaluation Smalltalk is small flexible extensible 0 Principles Elegancel A prime example Simplicity Regularity Abstraction Security lnformation hiding mznnz cs 403 Class Naies P Evaluation Smalltalk is a Real Programming Environment pcGrasp even MS Development Studio are grafted onto the languages later Smalltalk s programming environment was specifically designed for Smalltalk a natural extension of the language It was one ofthe first and one ofthe best m 2mm cs ACEClassNalzs P l Evaluation Smalltalk introduced objectoriented programming treating programming as simulation of real world objects 0 A fundamentally different model from Algol and LISP mznnz cs 403 Class Naies P End of class Read chapter 13 Prolog for Tuesday It s a whole nother approach Turn in Scheme experience paper and 5 functions on Tuesday Check web page for updated grades m 2mm cs ACEClassNalzs P 23
Are you sure you want to buy this material for
You're already Subscribed!
Looks like you've already subscribed to StudySoup, you won't need to purchase another subscription to get this material. To access this material simply click 'View Full Document'