TAILIEUCHUNG - Lecture Programming languages (2/e): Chapter 13b - Tucker, Noonan

Chapter 13b - Smalltalk. Smalltalk is a very simple language, both syntactically and semantically. The power of Smalltalk comes from its class libraries, most of which are written in Smalltalk itself. Interestingly, even control structures are objects in Smalltalk. | Programming Languages 2nd edition Tucker and Noonan Chapter 13 Object-Oriented Programming I am surprised that ancient and Modern writers have not attributed greater importance to the laws of inheritance . Alexis de Tocqueville Contents Prelude: Abstract Data Types The Object Model Smalltalk Java Python Smalltalk the original object-oriented language developed in 1970s at Xerox PARC Xerox Alto Smalltalk system OS IDE mouse based GUI Steve Jobs visit General Characteristics Simple language Most of the class libraries written in Smalltalk Everything is an object, even control structures Excluding lexical productions, grammar has 21 productions (3 pages) The value of every variable is an object; every object is an instance of some class. A method is triggered by sending a message to an object. The object responds by evaluating the method of the same name, if it has one. Otherwise the message is sent to the parent object. The process continues until the method is found; otherwise an error is raised. All methods return a value (object). Precedence Unary messages, as in: x negated Binary messages, as in: x + y Keyword messages, as in: Turtle go: length In the absence of parentheses, code is evaluated from left to right. Examples: x + y * z squared a max: b - c anArray at: i put: (anArray at: i + 1) By default, Smalltalk uses infinite precision, fractional arithmetic. 1/3 + 2/6 + 3/9 evaluates to 1. (a > b) ifTrue: [ max := a ] ifFalse: [ max := b ]. [ ] - uninterpreted block Boolean method Distinct from: ifFalse:ifTrue: sum := 0. 1 to: n do: [ :i

TAILIEUCHUNG - Chia sẻ tài liệu không giới hạn
Địa chỉ : 444 Hoang Hoa Tham, Hanoi, Viet Nam
Website : tailieuchung.com
Email : tailieuchung20@gmail.com
Tailieuchung.com là thư viện tài liệu trực tuyến, nơi chia sẽ trao đổi hàng triệu tài liệu như luận văn đồ án, sách, giáo trình, đề thi.
Chúng tôi không chịu trách nhiệm liên quan đến các vấn đề bản quyền nội dung tài liệu được thành viên tự nguyện đăng tải lên, nếu phát hiện thấy tài liệu xấu hoặc tài liệu có bản quyền xin hãy email cho chúng tôi.
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.