Object Oriented Programming (OOP)

Size: px
Start display at page:

Download "Object Oriented Programming (OOP)"

Transcription

1 Object Oriented Programming (OOP) o New programming paradigm o Actions Objects o Objects Actions o Object-oriented = Objects + Classes + Inheritance Imperative programming o OOP (Object-Oriented Programming) related o Local state, delegation, inheritance o History (Norvig,465): Algol 60 SIMULA o Lisp extensions: o Smalltalk (69) o Flavors (79) o New Flavors (81) o Common Loops (88) o CLOS (91): standard

2 LISP world Smalltalk LAMBDA Flavors History Algol60 multiple inheritance method combination Simula Classes single inheritance Dahl 1966 Nygaard Kay 1969 Goldberg Ingalls Steele 1976 Cannon Weinreb 1979 New Flavors generic functions Symbolics 1981 CommonLoops Oaklisp CLOS multimethods C++ Eiffel JAVA Xerox 1982 AT&T Bell labs 1986 Meyer 1988 Lang 1988 Perlmutter Steele 1991 AOP vs. OOP (Shoham) Basic unit OOP Object (passive) AOP Agent (active) State Computation without restriction Message passing, methods belief, commitment, competence, preferences, Message passing, methods Type of messages Message restrictions without restriction no Inform, request, offer, promise, reject, Honesty, consistency, rationality,

3 Nomenclature o Object: encapsulated local state and behavior o Class: describes similar objects with the same behavior and structure. o Instance: object belonging to a class. o Class Variable: variable shared by all the members of a class. o Instance Variable: encapsulated variable of an object. o Generic Function: its behavior depends on the types or classes of the arguments. Nomenclature o Message: Action name. Equivalent to a generic function. o Method: Specialization of a generic function. o Delegation: an object passes a task to another object. o Multimethod: method with more than one argument o Inheritance: to define new classes that are a specialization of a more general one. o Multiple inheritance: from more than one father class.

4 Object-Oriented Style o Example: Bank account class o Local state and functions o Instance variables: balance, interest rate o Messages and methods: withdraw, deposit, balance, name, interest o It is not possible to manipulate the variables in a closure using CommonLisp. o INSPECT is implementation dependent Object-Oriented Style (defun new-account (name &optional (balance 0.00) (interest-rate.06)) new account with the following messages:" #'(lambda (message) (case message (withdraw #'(lambda (amt) (if (<= amt balance) (decf balance amt) 'insufficient-funds))) (deposit #'(lambda (amt) (incf balance amt))) (balance #'(lambda () balance)) (name #'(lambda () name)) (interest #'(lambda () (incf balance (* interest-rate balance)))))))

5 SEND o Send function (Flavors) implements the control of objects. (defun get-method (object message) Returns the method for the given message" (funcall object message)) (defun send (object message &rest args) Applies the method for the message with the arguments (apply (get-method object message) args)) SEND o Execution examples > (setf acct (new-account "J. Random Customer" )) #<CLOSURE > > (send acct 'withdraw ) > (send acct 'deposit ) > (send acct 'name) "J. Random Customer" > (send acct 'balance)

6 Generic functions o The syntax of send is not useful. We are interested in expressions of the following type: o (mapcar 'balance accounts) o Using messages: o (mapcar #'(lambda (acct) (send acct 'balance)) accounts) o Generic functions will find the correct method of an object, specialized on a message type. o (defun withdraw (object &rest args) withdraw is a generic function over objects." (apply (get-method object 'withdraw) args)) o We can write: o (withdraw acct x) o Instead of: o (send acct 'withdraw x) Classes o Using Macros o Easier read and write object-oriented code o Create a new class o Methods o Generic functions for each message o Class variables o Instance variables

7 Classes (define-class account (name &optional (balance 0)) ((interest-rate.06)) (withdraw (amt) (if (<= amt balance (decf balance amt) 'insufficient-funds)) (deposit (amt) (incf balance amt)) (balance () balance) (name () name) (interest () (incf balance (* interest-rate balance)))) Classes (defmacro define-class (class inst-vars class-vars &body methods) class definition." `(let,class-vars (mapcar #'ensure-generic-fn ',(mapcar #'first methods)) (defun,class,inst-vars #'(lambda (message) (case #'make-clause methods)))))) (defun make-clause (clause) "Translate a message from define-class into a case clause." `(,(first clause) #'(lambda,(second clause),@(rest (rest clause)))))

8 Classes II (defun ensure-generic-fn (message) defines a generic function." (unless (or (generic-fn-p message) (eq message otherwise)) (let ((fn #'(lambda (object &rest args) (apply (get-method object message) args)))) (setf (symbol-function message) fn) (setf (get message 'generic-fn) fn)))) (defun generic-fn-p (fn-name) is fn-name a function?" (and (fboundp fn-name) (eq (get fn-name 'generic-fn) (symbol-function fn-name)))) Classes II (define-class account (name &optional (balance 0)) ((interest-rate.06)) (withdraw (amt) (if (<= amt balance (decf balance amt) 'insufficient-funds)) (deposit (amt) (incf balance amt)) (balance () balance) (name () name) (interest () (incf balance (* interest-rate balance))))

9 Classes III o Macro expansion: (LET ((INTEREST-RATE 0.06)) (MAPCAR #'ENSURE-GENERIC-FN '(WITHDRAW DEPOSIT BALANCE NAME INTEREST)) (DEFUN ACCOUNT (NAME &OPTIONAL (BALANCE 0.0)) #'(LAMBDA (MESSAGE) (CASE MESSAGE (WITHDRAW #'(LAMBDA (AMT) (IF (<= AMT BALANCE) (DECF BALANCE AMT) 'INSUFFICIENT-FUNDS))) (DEPOSIT #'(LAMBDA (AMT) (INCF BALANCE AMT))) (BALANCE #'(LAMBDA NIL BALANCE)) (NAME #'(LAMBDA NIL NAME)) (INTEREST #'(LAMBDA NIL (INCF BALANCE (* INTEREST-RATE BALANCE)))))))) Classes III o Using the new objects: o > (setf acct2 (account "A. User" )) #<CLOSURE > o > (deposit acct ) -> o > (interest acct2) -> o > (balance acct2) -> !!! o > (balance acct) -> Previous object

10 Delegation I o Account with password: (define-class password-account (password acct) () (change-password (pass new-pass) (if (equal pass password) (setf password new-pass) 'wrong-password)) (otherwise (pass &rest args) (if (equal pass password) (apply message acct args) 'wrong-password))) Delegation I o Details of the define-class macro: message and otherwise. > (setf acct3 (password-account "secret" acct2)) #<CLOSURE > > (balance acct3 "secret") -> > (withdraw acct3 "guess" ) -> WRONG-PASSWORD > (withdraw acct3 "secret" ) ->

11 Delegation II o The same technique for limited accounts: (define-class limited-account (limit acct) () (withdraw (amt) (if (> amt limit) 'over-limit (withdraw acct amt))) (otherwise (&rest args) (apply message acct args))) Delegation II o > (setf acct4 (password-account "pass" (limited-account (account "A. Thrifty Spender" )))) #<CLOSURE > o > (withdraw acct4 "pass" ) OVER-LIMIT o > (withdraw acct4 "pass" 20.00) o > (withdraw acct4 "guess" 20.00) WRONG-PASSWORD

12 o o Delegation III Each class implements a different withdraw method. Sending the message withdraw to the object acct4 : 1. password-account method validates the password. 2. If correct, sends the message withdraw to the limited-account object. 3. If under the limit, sends the message withdraw to the account object. Notice the differences with the procedural version (defun withdraw (acct amt &optional pass) (cond ((and (typep acct 'password-account) (not (equal pass (account-password acct)))) 'wrong-password) ((and (typep acct 'limited-account) (> amt (account-limit account))) 'over-limit) ((> amt balance) 'insufficient-funds) (t (decf balance amt)))) Inheritance I o Classes are hierarchically organized. It is necessary to make explicit this hierarchy. o Lisp structures implement inheritance: (defstruct (limited-account (:include account)) limit) o The same for classes: (define-class limited-account account (limit) () (withdraw (amt) (if (>amt limit) 'over-limit (call-next-method)))

13 Inheritance II o Multiple inheritance : (define-class limited-account-with-password (password-account limited-account)) o Union of the functionalities belonging to the two classes. o No new variable or methods. LISP world Smalltalk LAMBDA Flavors History Algol60 multiple inheritance method combination Simula Classes single inheritance Dahl 1966 Nygaard Kay 1969 Goldberg Ingalls Steele 1976 Cannon Weinreb 1979 New Flavors generic functions Symbolics 1981 CommonLoops Oaklisp CLOS multimethods Common Lisp Object System C++ Eiffel JAVA Xerox 1982 AT&T Bell labs 1986 Meyer 1988 Lang 1988 Perlmutter Steele 1991

14 CLOS: defclass Our System define-class methods in class class-name call-next-method ensure-generic-fn CLOS defclass defmethod make-instance call-next-method ensure-generic-function o Definition of: o Classes: defclass o Methods: delmethod o Instances: make-instance. o Syntax of class definition: (defclass class-name (superclass...) (slot-specifier...) optional-class-option...) defclass (slots and implicit methods) (defclass account () ((name :initarg :name :reader name) (balance :initarg :balance :initform 0.00 :accessor balance) (interest-rate :allocation :class :initform.06 :reader interest-rate))) > (setf a1 (make-instance 'account :balance :name "Fred")) #<ACCOUNT > > (name a1) "Fred" > (balance a1) > (interest-rate a1) 0.06

15 CLOS: defmethod (defmethod method-name (parameter...) body...) (defmethod withdraw ((acct account) amt) (if (< amt (balance acct)) (decf (balance acct) amt) 'insufficient-funds)) o limited-account class is a subclass of account class. (defclass limited-account (account) ((limit :initarg :limit :reader limit))) (defmethod withdraw ((acct limited-account) amt) (if (> amt (limit acct)) 'over-limit (call-next-method))) Inheritance example > (setf a2 (make-instance 'limited-account :name "A. Thrifty Spender" :balance :limit )) #<LIMITED-ACCOUNT > Values to slots inherited from the account class. > (name a2) "A. Thrifty Spender" Name method is inherited. > (withdraw a ) OVER-LIMIT > (withdraw a ) Using call-next-method. Multiple: left to right

16 Examples (defclass audited-account (account) ((audit-trail :initform nil :accessor audit-trail))) (defmethod withdraw :before ((acct audited-account) amt) (push (print `(withdrawing,amt)) (audit-trail acct))) RETURN (defmethod withdraw :after ((acct audited-account) amt) (push (print `(withdrawal (,amt) done)) (audit-trail acct))) o o Order: 1. All the methods :before, from more specific to more general 2. Primary methods: the most specific (call-next-method) 3. All the methods :after, from more general to more specific Auxiliary method :around o The most specific (call-next-method) Examples > (setf a3 (make-instance 'audited-account :balance )) #<AUDITED-ACCOUNT > > (withdraw a ) (WITHDRAWING 100.0) (WITHDRAWAL (100.0) DONE) > (audit-trail a3) ((WITHDRAWAL (100.0) DONE) (WITHDRAWING 100.0)) > (setf (audit-trail a3) nil) NIL o CLOS problem: Encapsulation of methods. Methods are not defined into the classes.

17 OOP Example: Search tools o OOP is useful to implement two important models of representation: 1. Isomorphism between real objects and computational objects. 2. Program combination as a building tool for programming. o The second model is useful for searching. o Classification of search problems: o Domain: planning, games, etc. o Topology: tree, graph, etc. o Search strategy: depth-first, breadth-first, etc. o Modularity Search tools o A problem contains a space of states. (defclass problem () ((states :initarg :states :accessor problem-states)))

18 Search I o The definition of the search method of the problem class uses generic functions. (defmethod searcher ((prob problem)) Finding a solution state" (cond ((no-states-p prob) fail) ((goal-p prob) (current-state prob)) (t (let ((current (pop-state prob))) (setf (problem-states prob) (problem-combiner prob (problem-successors prob current) (problem-states prob)))) old (searcher prob)))) new Search I (defmethod current-state ((prob problem)) "The current state is the first of the possible states." (first (problem-states prob))) (defmethod pop-state ((prob problem)) "Remove and return the current state." (pop (problem-states prob)))

19 Search II (defmethod no-states-p ((prob problem)) "Are there any more unexplored states?" (null (problem-states prob))) (defmethod searcher :before ((prob problem)) (format t "~&;; Search: ~a" (problem-states prob))) (defmethod searcher ((prob problem)) Finding a solution state" (cond ((no-states-p prob) fail) ((goal-p prob) (current-state prob)) (t (let ((current (pop-state prob))) (setf (problem-states prob) (problem-combiner prob (problem-successors prob current) (problem-states prob)))) (searcher prob)))) Search II Problem subclass: problems with a goal. (defclass eql-problem (problem) ((goal :initarg :goal :reader problem-goal))) (defmethod goal-p ((prob eql-problem)) (eql (current-state prob) (problem-goal prob)) (defmethod searcher ((prob problem)) Finding a solution state" (cond ((no-states-p prob) fail) ((goal-p prob) (current-state prob)) (t (let ((current (pop-state prob))) (setf (problem-states prob) (problem-combiner prob (problem-successors prob current) (problem-states prob)))) (searcher prob))))

20 Strategies o Two subclasses of problems with search strategies: (defclass dfs-problem (problem)() (:documentation "Depth-first search problem.")) (defclass bfs-problem (problem)() (:documentation "Breadth-first search problem.")) (defmethod problem-combiner ((prob dfs-problem) new old) "Depth-first search looks at new states first." (append new old)) (defmethod problem-combiner ((prob bfs-problem) new old) "Breadth-first search looks at old states first." (append old new)) Domain and combination o Subclass of problem representing the topology type and the domain knowledge by means of successors computing. (defclass binary-tree-problem (problem) ()) (defmethod problem-successors ((prob binary-tree-problem) state) (let ((n (* 2 state))) (list n (+ n 1)))) o Finally we show the power of multiple inheritance by combining: topology, strategy and the problem type (goal-oriented). (defclass binary-tree-eql-bfs-problem (binary-tree-problem eql-problem bfs-problem) ())

21 Run the example > (setf p1 (make-instance 'binary-tree-eql-bfs-problem :states '(1) :goal 12)) #<BINARY-TREE-EQL-BFS-PROBLEM > > (searcher p1) ;; Search: (1) ;; Search: (2 3) ;; Search: (3 4 5) ;; Search: ( ) ;; Search: ( ) ;; Search: ( ) ;; Search: ( ) ;; Search: ( ) ;; Search: ( ) ;; Search: ( ) ;; Search: ( ) ;; Search: ( ) 12 First summary Problem states, Current state, pop-state no-states-p, searcher bfs-problem dfs-problem problem-combiner problem-combiner eql-problem Goal goal-p binary-tree-problem problem-successors binary-tree-eql-bfs-problem

22 Other search strategies o Advantages of modularity (defclass best-problem (problem) () (:documentation "A Best-first search problem.")) (defmethod problem-combiner ((prob best-problem) new old) "Best-first search sorts new and old according to cost-fn." (sort (append new old) #'< :key #'(lambda (state) (cost-fn prob state)))) (defmethod cost-fn ((prob eql-problem) state) (abs (- state (problem-goal prob)))) ( (defclass beam-problem (problem) ((beam-width :initarg :beam-width :initform nil :reader problem-beam-width))) (defmethod problem-combiner :around ((prob beam-problem) new old) (subseq (call-next-method) 0 (problem-beam-width prob))) New combination (defclass binary-tree-eql-best-beam-problem (binary-tree-problem eql-problem best-problem beam-problem) ()) > (setf p3 (make-instance 'binary-tree-eql-best-beam-problem :states '(1) :goal 12 :beam-width 3)) #<BINARY-TREE-EQL-BEST-BEAM-PROBLEM > > (searcher p3) ;; Search: (1) ;; Search: (3 2) ;; Search: (7 6 2) ;; Search: ( ) ;; Search: ( ) ;; Search: ( ) ;; Search: ( ) 12

23 New schema Problem states, Current state, pop-state no-states-p, searcher best-problem beam-problem problem-combiner problem-combiner eql-problem Goal goal-p cost-fn binary-tree-problem problem-successors binary-tree-eql-best-beam-problem

Object oriented programming

Object oriented programming Object oriented programming The main ideas behind object-oriented programming: the same type of action may be carried out differently on different types of objects cutting a cake is different from cutting

More information

Common Lisp Object System Specification. 1. Programmer Interface Concepts

Common Lisp Object System Specification. 1. Programmer Interface Concepts Common Lisp Object System Specification 1. Programmer Interface Concepts Authors: Daniel G. Bobrow, Linda G. DeMichiel, Richard P. Gabriel, Sonya E. Keene, Gregor Kiczales, and David A. Moon. Draft Dated:

More information

A Genetic Algorithm Implementation

A Genetic Algorithm Implementation A Genetic Algorithm Implementation Roy M. Turner (rturner@maine.edu) Spring 2017 Contents 1 Introduction 3 2 Header information 3 3 Class definitions 3 3.1 Individual..........................................

More information

2. Reasons for implementing clos-unit

2. Reasons for implementing clos-unit A CLOS Implementation of the JUnit Testing Framework Architecture: A Case Study Sandro Pedrazzini Canoo Engineering AG sandro.pedrazzini@canoo.com Abstract There are different reasons why you would like

More information

A Brief Introduction to Common Lisp

A Brief Introduction to Common Lisp A Brief Introduction to Common Lisp David Gu Schloer Consulting Group david_guru@gty.org.in A Brief History Originally specified in 1958, Lisp is the second-oldest highlevel programming language in widespread

More information

A little bit of Lisp

A little bit of Lisp B.Y. Choueiry 1 Instructor s notes #3 A little bit of Lisp Introduction to Artificial Intelligence CSCE 476-876, Fall 2017 www.cse.unl.edu/~choueiry/f17-476-876 Read LWH: Chapters 1, 2, 3, and 4. Every

More information

LISP. Everything in a computer is a string of binary digits, ones and zeros, which everyone calls bits.

LISP. Everything in a computer is a string of binary digits, ones and zeros, which everyone calls bits. LISP Everything in a computer is a string of binary digits, ones and zeros, which everyone calls bits. From one perspective, sequences of bits can be interpreted as a code for ordinary decimal digits,

More information

Common LISP-Introduction

Common LISP-Introduction Common LISP-Introduction 1. The primary data structure in LISP is called the s-expression (symbolic expression). There are two basic types of s-expressions: atoms and lists. 2. The LISP language is normally

More information

19 Machine Learning in Lisp

19 Machine Learning in Lisp 19 Machine Learning in Lisp Chapter Objectives Chapter Contents ID3 algorithm and inducing decision trees from lists of examples. A basic Lisp implementation of ID3 Demonstration on a simple credit assessment

More information

INF4820. Common Lisp: Closures and Macros

INF4820. Common Lisp: Closures and Macros INF4820 Common Lisp: Closures and Macros Erik Velldal University of Oslo Oct. 19, 2010 Erik Velldal INF4820 1 / 22 Topics for Today More Common Lisp A quick reminder: Scope, binding and shadowing Closures

More information

FUNKCIONÁLNÍ A LOGICKÉ PROGRAMOVÁNÍ 4. LISP: PROMĚNNÉ, DALŠÍ VLASTNOSTI FUNKCÍ, BLOKY, MAPOVACÍ FUNKCIONÁLY, ITERAČNÍ CYKLY,

FUNKCIONÁLNÍ A LOGICKÉ PROGRAMOVÁNÍ 4. LISP: PROMĚNNÉ, DALŠÍ VLASTNOSTI FUNKCÍ, BLOKY, MAPOVACÍ FUNKCIONÁLY, ITERAČNÍ CYKLY, FUNKCIONÁLNÍ A LOGICKÉ PROGRAMOVÁNÍ 4. LISP: PROMĚNNÉ, DALŠÍ VLASTNOSTI FUNKCÍ, BLOKY, MAPOVACÍ FUNKCIONÁLY, ITERAČNÍ CYKLY, 2011 Jan Janoušek MI-FLP Evropský sociální fond Praha & EU: Investujeme do vaší

More information

Structure Programming in Lisp. Shared Structure. Tailp. Shared Structure. Top-Level List Structure

Structure Programming in Lisp. Shared Structure. Tailp. Shared Structure. Top-Level List Structure Structure 66-2210-01 Programming in Lisp Lecture 6 - Structure; ase Study: locks World Lisp's use of pointers Let you put any value anywhere Details are taken care of by the Lisp interpreter What goes

More information

CSCI337 Organisation of Programming Languages LISP

CSCI337 Organisation of Programming Languages LISP Organisation of Programming Languages LISP Getting Started Starting Common Lisp $ clisp i i i i i i i ooooo o ooooooo ooooo ooooo I I I I I I I 8 8 8 8 8 o 8 8 I \ `+' / I 8 8 8 8 8 8 \ `-+-' / 8 8 8 ooooo

More information

Lecture 16: Object Programming Languages

Lecture 16: Object Programming Languages Lecture 16: Object Programming Languages Introduction Corresponds to EOPL 5.1 and 5.2 Goal: to introduce Object Oriented Programming Language (OOPL) concepts using the EOPL extensible language framework

More information

INF4820: Algorithms for Artificial Intelligence and Natural Language Processing. More Common Lisp

INF4820: Algorithms for Artificial Intelligence and Natural Language Processing. More Common Lisp INF4820: Algorithms for Artificial Intelligence and Natural Language Processing More Common Lisp Stephan Oepen & Murhaf Fares Language Technology Group (LTG) September 6, 2017 Agenda 2 Previously Common

More information

Common LISP Tutorial 1 (Basic)

Common LISP Tutorial 1 (Basic) Common LISP Tutorial 1 (Basic) CLISP Download https://sourceforge.net/projects/clisp/ IPPL Course Materials (UST sir only) Download https://silp.iiita.ac.in/wordpress/?page_id=494 Introduction Lisp (1958)

More information

Principles of Programming Languages, 2

Principles of Programming Languages, 2 Principles of Programming Languages, 2 Matteo Pradella February 2015 Matteo Pradella Principles of Programming Languages, 2 February 2015 1 / 23 1 Object Oriented Programming (OO) Matteo Pradella Principles

More information

1 CLWEB INTRODUCTION 1

1 CLWEB INTRODUCTION 1 1 CLWEB INTRODUCTION 1 1. Introduction. This is CLWEB, a literate programming system for Common Lisp by Alex Plotnick plotnick@cs.brandeis.edu. It is modeled after the CWEB system by Silvio Levy and Donald

More information

CS508-Modern Programming Solved MCQ(S) From Midterm Papers (1 TO 22 Lectures) BY Arslan

CS508-Modern Programming Solved MCQ(S) From Midterm Papers (1 TO 22 Lectures) BY Arslan CS508-Modern Programming Solved MCQ(S) From Midterm Papers (1 TO 22 Lectures) BY Arslan April 18,2017 V-U For Updated Files Visit Our Site : Www.VirtualUstaad.blogspot.com Updated. MidTerm Papers Solved

More information

(defvar *state* nil "The current state: a list of conditions.")

(defvar *state* nil The current state: a list of conditions.) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;; GPS engine for blocks world ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (defvar *dbg-ids* nil "Identifiers used by dbg") (defvar *state* nil "The current state: a list of conditions.")

More information

Multi-Methods in Racket

Multi-Methods in Racket Multi-Methods in Racket António Menezes Leitão April, 18, 2013 1 Introduction Multi-methods are an advanced concept that extends the single dispatch approach that is used in the majority of object-oriented

More information

Introduction to Functional Programming

Introduction to Functional Programming Introduction to Functional Programming Xiao Jia xjia@cs.sjtu.edu.cn Summer 2013 Scheme Appeared in 1975 Designed by Guy L. Steele Gerald Jay Sussman Influenced by Lisp, ALGOL Influenced Common Lisp, Haskell,

More information

Aspect-Oriented Programming On Lisp

Aspect-Oriented Programming On Lisp 6 th International Conference on Applied Informatics Eger, Hungary, January 27 31, 2004. Aspect-Oriented Programming On Lisp Miklós Espák Department of Information Technology, University of Debrecen e-mail:

More information

COSI: Adding Constraints to the object-oriented paradigm

COSI: Adding Constraints to the object-oriented paradigm COSI: Adding Constraints to the object-oriented paradigm Gary Curtis, Mark Giuliano Space Telescope Science Institute, 3700 San Martin Drive, Baltimore, MD 21218 I. Overview Trans [1] is a Lisp system

More information

Custom Specializers in Object-Oriented Lisp

Custom Specializers in Object-Oriented Lisp Custom Cadence Design Systems Goldsmiths, University of London 23rd May 2008 Common : Skill: Unification of various dialects; Not dead yet. Common Skill Internal dialect from Cadence Design Systems; Extension

More information

The Users Guide. and. API Reference

The Users Guide. and. API Reference McCLIM User s Manual The Users Guide and API Reference Copyright c 2004,2005,2006,2007,2008,2017 the McCLIM hackers. i Table of Contents Introduction......................................... 1 Standards...........................................................

More information

Allegro CL Certification Program

Allegro CL Certification Program Allegro CL Certification Program Lisp Programming Series Level I Session 1.3.1 David Margolies Manipulating Lists 9/16/2010 1 What is a List? An ordered (possibly empty) collection of things in a particular

More information

Lecture 13: Object orientation. Object oriented programming. Introduction. Object oriented programming. OO and ADT:s. Introduction

Lecture 13: Object orientation. Object oriented programming. Introduction. Object oriented programming. OO and ADT:s. Introduction Lecture 13: Object orientation Object oriented programming Introduction, types of OO languages Key concepts: Encapsulation, Inheritance, Dynamic binding & polymorphism Other design issues Smalltalk OO

More information

UMBC CMSC 331 Final Exam

UMBC CMSC 331 Final Exam UMBC CMSC 331 Final Exam Name: UMBC Username: You have two hours to complete this closed book exam. We reserve the right to assign partial credit, and to deduct points for answers that are needlessly wordy

More information

CL-STORE: CL Serialization Package

CL-STORE: CL Serialization Package CL-STORE: CL Serialization Package Copyright c (c) (C) 2004 Sean Ross All rights reserved. Redistribution and use in source and binary forms, with or without modication, are permitted provided that the

More information

Functional Programming with Common Lisp

Functional Programming with Common Lisp Functional Programming with Common Lisp Kamen Tomov ktomov@hotmail.com July 03, 2015 Table of Contents What is This About? Functional Programming Specifics Is Lisp a Functional Language? Lisp Says Hi Functional

More information

Common Lisp. Blake McBride

Common Lisp. Blake McBride Contents Common Lisp Blake McBride (blake@mcbride.name) 1 Data Types 2 2 Numeric Hierarchy 3 3 Comments 3 4 List Operations 4 5 Evaluation and Quotes 5 6 String Operations 5 7 Predicates 6 8 Math Predicates

More information

Robot Programming with Lisp

Robot Programming with Lisp 2. Imperative Programming Institute for Artificial University of Bremen Lisp the Language LISP LISt Processing language 2 Lisp the Language LISP LISt Processing language (LISP Lots of Irritating Superfluous

More information

CSCE476/876 Fall Homework 3: Programming Assignment Using Emacs and Common Lisp. 1 Exercises (15 Points) 2. 2 Find (6 points) 4

CSCE476/876 Fall Homework 3: Programming Assignment Using Emacs and Common Lisp. 1 Exercises (15 Points) 2. 2 Find (6 points) 4 CSCE476/876 Fall 2018 Homework 3: Programming Assignment Using Emacs and Common Lisp Assigned on: Monday, September 10 th, 2018. Due: Monday, September 24 th, 2018. Contents 1 Eercises (15 Points) 2 2

More information

Streams and Lazy Evaluation in Lisp

Streams and Lazy Evaluation in Lisp Streams and Lazy Evaluation in Lisp Overview Different models of expression evaluation Lazy vs. eager evaluation Normal vs. applicative order evaluation Computing with streams in Lisp Motivation Unix Pipes

More information

AllegroCache: an Introduction

AllegroCache: an Introduction AllegroCache: an Introduction David Margolies (dm@franz.com) Questions and comments to support@franz.com Topics What is AllegroCache? Getting started Persistent classes and objects Transactions, committing

More information

UMBC CMSC 331 Final Exam

UMBC CMSC 331 Final Exam UMBC CMSC 331 Final Exam Name: UMBC Username: You have two hours to complete this closed book exam. We reserve the right to assign partial credit, and to deduct points for answers that are needlessly wordy

More information

NST: A Unit Test Framework for Common Lisp

NST: A Unit Test Framework for Common Lisp Smart Information Flow Technologies (SIFT, LLC) TC-lispers, June 9, 2009 Outline 1 Unit testing 2 3 The basic idea Early implementations, and other lessons How it maybe should work 4 What is unit testing?

More information

Symbolic Programming. Dr. Zoran Duric () Symbolic Programming 1/ 89 August 28, / 89

Symbolic Programming. Dr. Zoran Duric () Symbolic Programming 1/ 89 August 28, / 89 Symbolic Programming Symbols: +, -, 1, 2 etc. Symbolic expressions: (+ 1 2), (+ (* 3 4) 2) Symbolic programs are programs that manipulate symbolic expressions. Symbolic manipulation: you do it all the

More information

Robot Programming with Lisp

Robot Programming with Lisp 4. Functional Programming: Higher-order Functions, Map/Reduce, Lexical Scope Institute for Artificial University of Bremen 9 of November, 2017 Functional Programming Pure functional programming concepts

More information

FUNKCIONÁLNÍ A LOGICKÉ PROGRAMOVÁNÍ 5. LISP: MAKRA, DATOVÁ STRUKTURA ZÁZNAM

FUNKCIONÁLNÍ A LOGICKÉ PROGRAMOVÁNÍ 5. LISP: MAKRA, DATOVÁ STRUKTURA ZÁZNAM FUNKCIONÁLNÍ A LOGICKÉ PROGRAMOVÁNÍ 5. LISP: MAKRA, DATOVÁ STRUKTURA ZÁZNAM 2011 Jan Janoušek MI-FLP Evropský sociální fond Praha & EU: Investujeme do vaší budoucnosti MACROS Introduction to macro system

More information

Simula 67. Simula and Smalltalk. Comparison to Algol 60. Brief history. Example: Circles and lines. Objects in Simula

Simula 67. Simula and Smalltalk. Comparison to Algol 60. Brief history. Example: Circles and lines. Objects in Simula CS 242 Simula 67 Simula and Smalltalk John Mitchell First object-oriented language Designed for simulation Later recognized as general-purpose prog language Extension of Algol 60 Standardized as Simula

More information

CS 480. Lisp J. Kosecka George Mason University. Lisp Slides

CS 480. Lisp J. Kosecka George Mason University. Lisp Slides CS 480 Lisp J. Kosecka George Mason University Lisp Slides Symbolic Programming Symbols: +, -, 1, 2 etc. Symbolic expressions: (+ 1 2), (+ (* 3 4) 2) Symbolic programs are programs that manipulate symbolic

More information

CS 842 Ben Cassell University of Waterloo

CS 842 Ben Cassell University of Waterloo CS 842 Ben Cassell University of Waterloo Recursive Descent Re-Cap Top-down parser. Works down parse tree using the formal grammar. Built from mutually recursive procedures. Typically these procedures

More information

Search = the exploration of a search space, which is a collection of search states and connections between them, until a goal state is found

Search = the exploration of a search space, which is a collection of search states and connections between them, until a goal state is found Searching Tools Search = the exploration of a search space, which is a collection of search states and connections between them, until a goal state is found Example: Find a route from Tasi to Arad A simplified

More information

LP/LispLite: Trivial Lisp Org Mode Conversion

LP/LispLite: Trivial Lisp Org Mode Conversion LP/LispLite: Trivial Lisp Org Mode Conversion Roy M. Turner Spring 2016 Contents 1 Introduction 3 2 Using the tool 3 3 Header/miscellaneous 3 4 Variables/parameters 4 4.1 Variable: =*short-comment-start-regexp*........................

More information

Filtered Dispatch ABSTRACT. Categories and Subject Descriptors. Keywords

Filtered Dispatch ABSTRACT. Categories and Subject Descriptors. Keywords Filtered Dispatch Pascal Costanza Jorge Vallejos Charlotte Herzeel Theo D Hondt Programming Technology Lab Vrije Universiteit Brussel B-1050 Brussels, Belgium pascal.costanza charlotte.herzeel jorge.vallejos

More information

Jatha. Common Lisp in Java. Ola Bini JRuby Core Developer ThoughtWorks Studios.

Jatha. Common Lisp in Java. Ola Bini JRuby Core Developer ThoughtWorks Studios. Jatha Common Lisp in Java Ola Bini JRuby Core Developer ThoughtWorks Studios ola.bini@gmail.com http://olabini.com/blog Common Lisp? Common Lisp? ANSI standard Common Lisp? ANSI standard Powerful Common

More information

COMMOM OBJECT ORIENTED LISP SYSTEMS

COMMOM OBJECT ORIENTED LISP SYSTEMS COMMOM OBJECT ORIENTED LISP SYSTEMS HISTORY: The following information is derived from the history section of dpans Common Lisp. Lisp is a family of languages with a long history. Early key ideas in Lisp

More information

Berkeley Scheme s OOP

Berkeley Scheme s OOP Page < 1 > Berkeley Scheme s OOP Introduction to Mutation If we want to directly change the value of a variable, we need a new special form, set! (pronounced set BANG! ). (set! )

More information

Massimiliano Ghilardi

Massimiliano Ghilardi 7 th European Lisp Symposium Massimiliano Ghilardi May 5-6, 2014 IRCAM, Paris, France High performance concurrency in Common Lisp hybrid transactional memory with STMX 2 Beautiful and fast concurrency

More information

Structured Knowledge Representation

Structured Knowledge Representation Intelligent Systems: Reasoning and Recognition James L. Crowley ENSIMAG 2 / MoSIG M1 Second Semester 2015/2016 Lesson 17 15 April 2016 Structured Knowledge Representation Object Oriented Programming...2

More information

Carnegie Mellon University. Pittsburgh, PA April This research has been supported in part by the Advanced Research

Carnegie Mellon University. Pittsburgh, PA April This research has been supported in part by the Advanced Research PORK Object System Programmers' Guide Ora Lassila CMU-RI-TR-95-12 The Robotics Institute Carnegie Mellon University Pittsburgh, PA 15213 April 1995 c 1995 Ora Lassila This research has been supported in

More information

INF4820: Algorithms for Artificial Intelligence and Natural Language Processing. Common Lisp Fundamentals

INF4820: Algorithms for Artificial Intelligence and Natural Language Processing. Common Lisp Fundamentals INF4820: Algorithms for Artificial Intelligence and Natural Language Processing Common Lisp Fundamentals Stephan Oepen & Murhaf Fares Language Technology Group (LTG) August 30, 2017 Last Week: What is

More information

Lecture #5 Kenneth W. Flynn RPI CS

Lecture #5 Kenneth W. Flynn RPI CS Outline Programming in Lisp Lecture #5 Kenneth W. Flynn RPI CS We've seen symbols in three contexts so far: > (setf sym ) (let ((sym ))...) >'Sym SYM -- Context The first of these refers to a special (or

More information

Class 22: Inheritance

Class 22: Inheritance Menu Class 22: Inheritance Objects Review Object-Oriented Programming Inheritance CS50: Computer Science University of Virginia Computer Science David Evans http://www.cs.virginia.edu/evans 2 Objects When

More information

Design Issues. Subroutines and Control Abstraction. Subroutines and Control Abstraction. CSC 4101: Programming Languages 1. Textbook, Chapter 8

Design Issues. Subroutines and Control Abstraction. Subroutines and Control Abstraction. CSC 4101: Programming Languages 1. Textbook, Chapter 8 Subroutines and Control Abstraction Textbook, Chapter 8 1 Subroutines and Control Abstraction Mechanisms for process abstraction Single entry (except FORTRAN, PL/I) Caller is suspended Control returns

More information

This should prevent residual sexism, racism, favoritism lurking in the unconscious of your professor & TA from biasing grading!!

This should prevent residual sexism, racism, favoritism lurking in the unconscious of your professor & TA from biasing grading!! NAME login: Signature: Computer Science and Engineering 150 Programming Languages for Artificial Intelligence Tuesday, November 5, 2002: DON T FORGET TO VOTE!!! FIRST MIDTERM EXAM DO NOT TURN THIS PAGE

More information

Functional programming with Common Lisp

Functional programming with Common Lisp Functional programming with Common Lisp Dr. C. Constantinides Department of Computer Science and Software Engineering Concordia University Montreal, Canada August 11, 2016 1 / 81 Expressions and functions

More information

UMBC CMSC 331 Final Exam Section 0101 December 17, 2002

UMBC CMSC 331 Final Exam Section 0101 December 17, 2002 0 / 0 1 / 20 UMBC CMSC 331 Final Exam Section 0101 December 17, 2002 Name: Student ID#: 2 / 25 3 / 20 4 / 25 5 / 20 6 /40 7 /40 You will have two hours to complete this closed book exam. We reserve the

More information

Lisp: Question 1. Dr. Zoran Duric () Midterm Review 1 1/ 13 September 23, / 13

Lisp: Question 1. Dr. Zoran Duric () Midterm Review 1 1/ 13 September 23, / 13 Lisp: Question 1 Write a recursive lisp function that takes a list as an argument and returns the number of atoms on any level of the list. For instance, list (A B (C D E) ()) contains six atoms (A, B,

More information

Lisp as a second language, composing programs and music. Chapter III Object-Oriented Style I

Lisp as a second language, composing programs and music. Chapter III Object-Oriented Style I 1 of 69 05/07/2018, 11:36 [an error occurred while processing this directive] Lisp as a second language, composing programs and music. Peter Desain and Henkjan Honing Chapter III Object-Oriented Style

More information

Imperative, OO and Functional Languages A C program is

Imperative, OO and Functional Languages A C program is Imperative, OO and Functional Languages A C program is a web of assignment statements, interconnected by control constructs which describe the time sequence in which they are to be executed. In Java programming,

More information

4CAPS differs from other production system interpreter-based architectures in two major ways.

4CAPS differs from other production system interpreter-based architectures in two major ways. 3 Symbolic Aspects of Knowledge Representation 4CAPS is a hybrid architecture, encompassing both symbolic and connectionist processing styles. This chapter describes the symbolic aspects of 4CAPS knowledge

More information

CMPUT325 Extensions to Pure Lisp. Extensions to Pure Lisp. Bob Price and Russ Greiner. 5th October 2004

CMPUT325 Extensions to Pure Lisp. Extensions to Pure Lisp. Bob Price and Russ Greiner. 5th October 2004 CMPUT325 Extensions to Pure Lisp Bob Price and Russ Greiner 5th October 2004 Bob Price and Russ Greiner CMPUT325 Extensions to Pure Lisp 1 Extensions to Pure Lisp Extensions to Pure Lisp Side Eects (setq,

More information

Modern Programming Languages. Lecture LISP Programming Language An Introduction

Modern Programming Languages. Lecture LISP Programming Language An Introduction Modern Programming Languages Lecture 18-21 LISP Programming Language An Introduction 72 Functional Programming Paradigm and LISP Functional programming is a style of programming that emphasizes the evaluation

More information

Programming Languages at a Glance

Programming Languages at a Glance Programming Languages at a Glance Programming Languages at a Glance Published 2003 Copyright 2003 by Andreas Hohmann Table of Contents 1. Introduction...1 1.1. Acknowledgements...2 2. Fortran...3 2.1.

More information

Simula and Smalltalk. Comparison to Algol 60. Brief history. Example: Circles and lines. Objects in Simula. John Mitchell

Simula and Smalltalk. Comparison to Algol 60. Brief history. Example: Circles and lines. Objects in Simula. John Mitchell CS 242 Simula 67 Simula and Smalltalk John Mitchell First object oriented language Designed for simulation Later recognized as general purpose prog language Extension of Algol 60 Standardized as Simula

More information

Chapter 13. Object Oriented Programming

Chapter 13. Object Oriented Programming Chapter 13. Object Oriented Programming Byoung-Tak Zhang TA: Hanock Kwak Biointelligence Laboratory School of Computer Science and Engineering Seoul National University http://bi.snu.ac.kr Computer Programming

More information

Context-oriented Software Transactional Memory in Common Lisp

Context-oriented Software Transactional Memory in Common Lisp Context-oriented Software Transactional Memory in Common Lisp Pascal Costanza Charlotte Herzeel Theo D Hondt Software Languages Lab Vrije Universiteit Brussel B-1050 Brussels, Belgium pascal.costanza -

More information

CIS4/681 { Articial Intelligence 2 > (insert-sort '( )) ( ) 2 More Complicated Recursion So far everything we have dened requires

CIS4/681 { Articial Intelligence 2 > (insert-sort '( )) ( ) 2 More Complicated Recursion So far everything we have dened requires 1 A couple of Functions 1 Let's take another example of a simple lisp function { one that does insertion sort. Let us assume that this sort function takes as input a list of numbers and sorts them in ascending

More information

ESA: A CLIM Library for Writing Emacs-Style Applications

ESA: A CLIM Library for Writing Emacs-Style Applications GOLDSMITHS Research Online Conference or Workshop Item Strandh, Robert, Henriksen, Troels, Murray, David and Rhodes, Christophe ESA: A CLIM Library for Writing Emacs-Style Applications You may cite this

More information

Functional programming techniques

Functional programming techniques Functional programming techniques o Currying o Continuations o Streams. Lazy evaluation Currying o Haskell B. Curry. o Second-order programming: o Functions that return other functions. o Example: A two-arguments

More information

Dynamic ADTs: a don t ask, don t tell policy for data abstraction

Dynamic ADTs: a don t ask, don t tell policy for data abstraction Dynamic ADTs: a don t ask, don t tell policy for data abstraction Geoff Wozniak Dept. of Computer Science University of Western Ontario London, Ontario, Canada wozniak@csd.uwo.ca Mark Daley Depts. of Computer

More information

A TUTORIAL ON LISP OBJECT-ORIENTED PROGRAMMING FOR BLACKBOARD COMPUTATION (SOLVING THE RADAR TRACKING PROBLEM)

A TUTORIAL ON LISP OBJECT-ORIENTED PROGRAMMING FOR BLACKBOARD COMPUTATION (SOLVING THE RADAR TRACKING PROBLEM) Electrical and Computer Engineering ECE Technical Reports Purdue Libraries Year 993 A TUTORIAL ON LISP OBJECT-ORIENTED PROGRAMMING FOR BLACKBOARD COMPUTATION (SOLVING THE RADAR TRACKING PROBLEM P. R. Kersten

More information

Inferred System Descriptions ELS <http://dydra.com/>

Inferred System Descriptions ELS <http://dydra.com/> Inferred System Descriptions James Anderson @dydradata @lomoramic Perspective github : nine repositories; (SLOC) = 188,758 dydra : :depends-on x 22; (SLOC) = 317,746

More information

Lecture #2 Kenneth W. Flynn RPI CS

Lecture #2 Kenneth W. Flynn RPI CS Outline Programming in Lisp Lecture #2 Kenneth W. Flynn RPI CS Items from last time Recursion, briefly How to run Lisp I/O, Variables and other miscellany Lists Arrays Other data structures Jin Li lij3@rpi.edu

More information

Subtyping (Dynamic Polymorphism)

Subtyping (Dynamic Polymorphism) Fall 2018 Subtyping (Dynamic Polymorphism) Yu Zhang Course web site: http://staff.ustc.edu.cn/~yuzhang/tpl References PFPL - Chapter 24 Structural Subtyping - Chapter 27 Inheritance TAPL (pdf) - Chapter

More information

Using a waiting protocol to separate concerns in the mutual exclusion problem

Using a waiting protocol to separate concerns in the mutual exclusion problem Using a waiting protocol to separate concerns in the mutual exclusion problem Frode V. Fjeld frodef@cs.uit.no Department of Computer Science, University of Tromsø Technical Report 2003-46 November 21,

More information

Binary Methods Programming: the Clos Perspective

Binary Methods Programming: the Clos Perspective Journal of Universal Computer Science, vol. 14, no. 20 (2008), 3389-3411 submitted: 23/6/08, accepted: 24/8/08, appeared: 28/11/08 J.UCS Binary Methods Programming: the Clos Perspective Didier Verna (Epita

More information

Below are example solutions for each of the questions. These are not the only possible answers, but they are the most common ones.

Below are example solutions for each of the questions. These are not the only possible answers, but they are the most common ones. 6.001, Fall Semester, 2002 Quiz II Sample solutions 1 MASSACHVSETTS INSTITVTE OF TECHNOLOGY Department of Electrical Engineering and Computer Science 6.001 Structure and Interpretation of Computer Programs

More information

(defun fill-nodes (nodes texts name) (mapcar #'fill-node (replicate-nodes nodes (length texts) name) texts))

(defun fill-nodes (nodes texts name) (mapcar #'fill-node (replicate-nodes nodes (length texts) name) texts)) PROBLEM NOTES Critical to the problem is noticing the following: You can t always replicate just the second node passed to fill-nodes. The node to be replicated must have a common parent with the node

More information

AllegroCache. Reference Manual. Franz Inc. version 3.1.2

AllegroCache. Reference Manual. Franz Inc. version 3.1.2 AllegroCache Reference Manual Franz Inc. version 3.1.2 AllegroCache 3.1.0 2 Table of Contents Introduction...3 Package...3 Creating persistent objects...3 Indexes...5 Maps...5 Sets...6 Transactions...7

More information

Lisp Basic Example Test Questions

Lisp Basic Example Test Questions 2009 November 30 Lisp Basic Example Test Questions 1. Assume the following forms have been typed into the interpreter and evaluated in the given sequence. ( defun a ( y ) ( reverse y ) ) ( setq a (1 2

More information

References: Chapters 10 and 11 Chapters 8, and 12( 2 and 3)

References: Chapters 10 and 11 Chapters 8, and 12( 2 and 3) Topic V Object-oriented languages : Concepts and origins SIMULA and Smalltalk References: Chapters 10 and 11 of Concepts in programming languages by J. C. Mitchell. CUP, 2003. Chapters 8, and 12( 2 and

More information

a little more on macros sort of like functions, but..

a little more on macros sort of like functions, but.. a little more on macros 1 sort of like functions, but.. one of the most interesting but tricky aspects of Lisp. unlike functions, macros don't evaluate their arguments; they compute on unevaluated expressions

More information

CSCI 2210: Programming in Lisp. Progn. Block. CSCI Programming in Lisp; Instructor: Alok Mehta 1. ANSI Common Lisp, Chapters 5-10

CSCI 2210: Programming in Lisp. Progn. Block. CSCI Programming in Lisp; Instructor: Alok Mehta 1. ANSI Common Lisp, Chapters 5-10 CSCI 2210: Programming in Lisp ANSI Common Lisp, Chapters 5-10 CSCI 2210 - Programming in Lisp; Instructor: Alok Mehta; 4.ppt 1 Progn Progn Creates a block of code Expressions in body are evaluated Value

More information

Space War Class Diagram. Elements of OOP. How to design interactions between objects. Space War Class Diagram with Inheritance

Space War Class Diagram. Elements of OOP. How to design interactions between objects. Space War Class Diagram with Inheritance Elements of OOP Object Smart data structure Set of state variables Set of methods for manipulating state variables Class: Specifies the common behavior of entities Instance: A particular object or entity

More information

1st Semester MTCE 601A COMPUTER SYSTEM SOFTWARE

1st Semester MTCE 601A COMPUTER SYSTEM SOFTWARE 1st Semester MTCE 601A COMPUTER SYSTEM SOFTWARE LECTURE-1 Syllabus Introduction 1.1 Introduction to Object Oriented 1.2 Introduction to UML 1.3 Software Process and OOA&D 1.4 Component and CBSD 1.5 Patterns

More information

Method Combinators. e ELS 2018 E. Didier Verna. EPITA / LRDE. Introduction Issues SBCL Combinators CGFs Alt. MCs Perfs Conclusion

Method Combinators. e ELS 2018 E. Didier Verna. EPITA / LRDE. Introduction Issues SBCL Combinators CGFs Alt. MCs Perfs Conclusion Method Combinators e ELS 2018 E Didier Verna EPITA / LRDE didier@lrde.epita.fr lrde/~didier @didierverna didier.verna google+ in/didierverna Introduction CLOS improvements over mainstream object systems

More information

Lecture content. Course goals. Course Introduction. TDDA69 Data and Program Structure Introduction

Lecture content. Course goals. Course Introduction. TDDA69 Data and Program Structure Introduction Lecture content TDDA69 Data and Program Structure Introduction Cyrille Berger Course Introduction to the different Programming Paradigm The different programming paradigm Why different paradigms? Introduction

More information

Lecture 09. Ada to Software Engineering. Mr. Mubashir Ali Lecturer (Dept. of Computer Science)

Lecture 09. Ada to Software Engineering. Mr. Mubashir Ali Lecturer (Dept. of Computer Science) Lecture 09 Ada to Software Engineering Mr. Mubashir Ali Lecturer (Dept. of dr.mubashirali1@gmail.com 1 Summary of Previous Lecture 1. ALGOL 68 2. COBOL 60 3. PL/1 4. BASIC 5. Early Dynamic Languages 6.

More information

Thanks! Review. Course Goals. General Themes in this Course. There are many programming languages. Teaching Assistants. John Mitchell.

Thanks! Review. Course Goals. General Themes in this Course. There are many programming languages. Teaching Assistants. John Mitchell. 1 CS 242 Thanks! Review John Mitchell Final Exam Wednesday Dec 8 8:30 11:30 AM Gates B01, B03 Teaching Assistants Mike Cammarano TJ Giuli Hendra Tjahayadi Graders Andrew Adams Kenny Lau Vishal Patel and

More information

Chapter 9 :: Data Abstraction and Object Orientation

Chapter 9 :: Data Abstraction and Object Orientation Chapter 9 :: Data Abstraction and Object Orientation Programming Language Pragmatics Michael L. Scott Control or PROCESS abstraction is a very old idea (subroutines!), though few languages provide it in

More information

Expressions and Assignment

Expressions and Assignment Expressions and Assignment COS 301: Programming Languages Outline Other assignment mechanisms Introduction Expressions: fundamental means of specifying computations Imperative languages: usually RHS of

More information

Principles of Programming Languages Topic: Scope and Memory Professor Louis Steinberg Fall 2004

Principles of Programming Languages Topic: Scope and Memory Professor Louis Steinberg Fall 2004 Principles of Programming Languages Topic: Scope and Memory Professor Louis Steinberg Fall 2004 CS 314, LS,BR,LTM: Scope and Memory 1 Review Functions as first-class objects What can you do with an integer?

More information

Infinite transducers on terms denoting graphs

Infinite transducers on terms denoting graphs Infinite transducers on terms denoting graphs Irène Durand and Bruno Courcelle LaBRI, Université de Bordeaux June, 2013 European Lisp Symposium, ELS2013 2/30 Objectives What : Compute information about

More information

OO design. Classes, Responsibilities, Collaborations (CRC) 13/9/1999 COSC

OO design. Classes, Responsibilities, Collaborations (CRC) 13/9/1999 COSC OO design Classes, Responsibilities, Collaborations (CRC) 1 bank accounts the system to be modelled: bank accounts with differing fee structures purpose: evaluate different account types with respect to

More information

0LispWorks CAPI Reference Manual. Version 4.1

0LispWorks CAPI Reference Manual. Version 4.1 0LispWorks CAPI Reference Manual Version 4.1 Copyright and Trademarks LispWorks CAPI Reference Manual Version 4.1 October 1998 Part number: 3LADT3A15LF Copyright 1994 1998 by Harlequin Group plc. All Rights

More information

Lisp. Versions of LISP

Lisp. Versions of LISP Lisp Versions of LISP Lisp is an old language with many variants Lisp is alive and well today Most modern versions are based on Common Lisp LispWorks is based on Common Lisp Scheme is one of the major

More information