Common Lisp! John Paxton Montana State University Summer 2003.

Slides:



Advertisements
Similar presentations
Common Lisp! John Paxton Montana State University Summer 2003.
Advertisements

Themes and Insights. Vida, Montana 23 miles from Wolf Point Average temperature in summer is 86° Present population 70 Boyhood home of eight time Montana.
Arrays (1) You create an array in LISP by using the function (make- array ). All elements are initially set to nil. To create a 1-dimensional array of.
Common Lisp! John Paxton Montana State University Summer 2003.
Common Lisp! John Paxton Montana State University Summer 2003.
Procedures with optional parameters which do not require matching arguments Example: consider the exponent function which may take one argument, m, in.
Commands and predicates LISP functions are divided into 2 classes. Predicates are functions that return boolean values i.e. t or nil. The rest are commands.
Functional Programming COMP2003 A course on functional programming using Common Lisp Dr Eleni Mangina
Using Classes Lisp also supports the Object-Oriented paradigm. The process of defining classes in Lisp is similar to how you you define structures. The.
Common Lisp! John Paxton Montana State University Summer 2003.
Common Lisp! John Paxton Montana State University Summer 2003.
Common Lisp! John Paxton Montana State University Summer 2003.
Structures Structures in LISP are analogous to that in C. To create a structure, use the following syntax: (defstruct Name Slot1 Slot2 Slot3) An example.
Презентація за розділом “Гумористичні твори”
Центр атестації педагогічних працівників 2014
Галактики і квазари.
Характеристика ІНДІЇ.
Процюк Н.В. вчитель початкових класів Боярської ЗОШ І – ІІІ ст №4
TUTORIAL 2 CSCI3230 ( First Term) By Paco WONG 1.
EXAMPLE 1 Recognizing and Extending a Pattern Scheduling Events You are a member of a summer movie club at your local movie theater. The club meets every.
Common Lisp! John Paxton Montana State University Summer 2003.
Click here to add a picture of your country’s flag Click here to add your country’s name.
Presenter: Amit guetta City: Madrid Country: Spain Continent: Europe Population: 6 million people Language: Spanish.
SINGLE-DIMENSION ARRAYS. Data Structures It is a collection of scalar data types that are all referenced or accessed through one identifier – scalar type.
ITEC 380 Organization of programming languages Lecture 5 – Functional Programming.
Lecture 6-2CS250: Intro to AI/Lisp Programming in Your Favorite Language Lecture 5-2 February 11 th, 1999 CS250.
PRACTICAL COMMON LISP Peter Seibel 1.
Hypothesis Testing for Standard Deviation or Variance.
Духовні символи Голосіївського району
Design of Problem Solvers (PS) using Classical Problem Solving (CPS) techniques Classical Problem Solver has 2 basic components:  Search engine (uses.
Structures “The programmer, like the poet, works only slightly removed from pure thought-stuff. He builds his castles in the air, from air, creating by.
Exponential Growth and Decay Greg Kelly, Hanford High School, Richland, Washington Glacier National Park, Montana Photo by Vickie Kelly, 2004.
Types of Communities 3 rd Grade Saraland Elementary School.
Top 12 Countries ranking countries by different measures.
Three Types of Communities
MONTANA State song: “Montana” State Flower: “Bitterroot”
Objects as a programming concept
RIGA.
When it became a real state... It became a real state on
Name……………………………….…. Date…………………… Name…………………. Date…………………… 1.
ASSIGNMENT NO.-2.
Проф. д-р Васил Цанов, Институт за икономически изследвания при БАН
ЗУТ ПРОЕКТ на Закон за изменение и допълнение на ЗУТ
О Б Щ И Н А С И Л И С Т Р А П р о е к т Б ю д ж е т г.
Електронни услуги на НАП
Боряна Георгиева – директор на
РАЙОНЕН СЪД - БУРГАС РАБОТНА СРЕЩА СЪС СЪДЕБНИТЕ ЗАСЕДАТЕЛИ ПРИ РАЙОНЕН СЪД – БУРГАС 21 ОКТОМВРИ 2016 г.
Сътрудничество между полицията и другите специалисти в България
Съобщение Ръководството на НУ “Христо Ботев“ – гр. Елин Пелин
НАЦИОНАЛНА АГЕНЦИЯ ЗА ПРИХОДИТЕ
ДОБРОВОЛЕН РЕЗЕРВ НА ВЪОРЪЖЕНИТЕ СИЛИ НА РЕПУБЛИКА БЪЛГАРИЯ
Съвременни софтуерни решения
ПО ПЧЕЛАРСТВО ЗА ТРИГОДИШНИЯ
от проучване на общественото мнение,
Васил Големански Ноември, 2006
Програма за развитие на селските райони
ОПЕРАТИВНА ПРОГРАМА “АДМИНИСТРАТИВЕН КАПАЦИТЕТ”
БАЛИСТИКА НА ТЯЛО ПРИ СВОБОДНО ПАДАНЕ В ЗЕМНАТА АТМОСФЕРА
МЕДИЦИНСКИ УНИВЕРСИТЕТ – ПЛЕВЕН
Стратегия за развитие на клъстера 2015
Моето наследствено призвание
Правна кантора “Джингов, Гугински, Кючуков & Величков”
Безопасност на движението
Bozeman Economic Development Update
Location Describes where a place is. Location can be
Title of Paper Author 1, Author 2, Author 3 Location / Institution
Montana Audrey S..
CMPE400 – Summer Training Presentation
Procedures with optional parameters which do not require matching arguments Example: consider the exponent function which may take one argument, m, in.
La Boutique Del PowerPoint.net
Presentation transcript:

Common Lisp! John Paxton Montana State University Summer 2003

Montana National Parks Yellowstone Glacier

Structure Declaration (defstruct city name country (population ) )

Structure Creation > (setf san-salvador (make-city)) #S(CITY :NAME NIL :COUNTRY NIL :POPULATION ) > (setf bozeman (make-city :population 30000)) #S(CITY :NAME NIL :COUNTRY NIL :POPULATION 30000)

Field Access > (setf (city-country san-salvador) 'el-salvador) EL-SALVADOR

Useful Predicates > (city-p san-salvador) T > (describe san-salvador) #S(CITY :NAME NIL :COUNTRY EL-SALVADOR :POPULATION ) is a structure of type CITY. Slots: NAME = NIL COUNTRY = EL-SALVADOR POPULATION = and more!

Questions 1.Declare a structure called playing-time that can hold the number of minutes and seconds that a song lasts. 2.Instantiate an instance of the above structure that plays for 3 minutes and 42 seconds. 3.Declare another structure called song that can hold the name of a song and its playing-time.

Questions 4.Instantiate an instance of this previous structure for the 1996 Los del Rio hit, Macarena, which plays for 3 minutes and 12 seconds. 5.Access the name of the song. 6.Access the playing-time of the song. 7.Declare an array that can hold 3 songs. 8.Assign the above structure to the second slot in the array.