Allegro CL Certification Program

Slides:



Advertisements
Similar presentations
Introduction to LISP Programming of Pathway Tools Queries and Updates.
Advertisements

ANSI Common Lisp 3. Lists 20 June Lists Conses List Functions Trees Sets Stacks Dotted Lists Assoc-lists.
Chapter 7: Introduction to CLIPS
Functional Programming COMP2003 A course on functional programming using Common Lisp Dr Eleni Mangina
The Corporate Income Tax
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.
Mapping And Iteration So far, the only Lisp mechanism we have considered, which allows an action to be performed repeatedly is recursion. Most programming.
How to load a program file? Lisp programs in Allegro are saved under the file extension.cl. To load a file into the Lisp console, use the following: (load.
 What are the next three terms in each sequence?  17, 20, 23, 26, _____, _____, _____  9, 4, -1, -6, _____, _____, _____  500, 600, 700, 800, _____,
Unit 2: Java Introduction to Programming 2.1 Initial Example.
Using Ant to build J2EE Applications Kumar
Microsoft Visual Basic 2010: Reloaded Fourth Edition Chapter Ten String Manipulation and Menus.
Allegro CL Certification Program Lisp Programming Series Level I Session Top Ten Things to Know.
11 Chapter 3 DECISION STRUCTURES CONT’D. 22 FORMATTING FLOATING-POINT VALUES WITH THE DecimalFormat CLASS We can use the DecimalFormat class to control.
MBAC 611.  Within your private mbac611 folder create a lab5 folder.  Copy the Moodle file lab3_vars to your lab5 folder.  Start Mathematica  Enter.
Chapter 7: Introduction to CLIPS Expert Systems: Principles and Programming, Fourth Edition.
Mitthögskolan 10/8/ Common Lisp LISTS. Mitthögskolan 10/8/2015 2Lists n Lists are one of the fundamental data structures in Lisp. n However, it.
Common lisp A functional programming language. Useful URL:
Characters The data type char represents a single character in Java. –Character values are written as a symbol: ‘a’, ‘)’, ‘%’, ‘A’, etc. –A char value.
Computer Science 101 Introduction to Programming.
Arrays and ArrayLists in Java L. Kedigh. Array Characteristics List of values. A list of values where every member is of the same type. Each member in.
BUILDING JAVA PROGRAMS CHAPTER 7 Arrays. Exam #2: Chapters 1-6 Thursday Dec. 4th.
1 Data Structures CSCI 132, Spring 2014 Lecture 32 Tables I.
Built-in Data Structures in Python An Introduction.
Basic LISP Programming Common LISP follows the algorithm below when interacting with users: loop read in an expression from the console; evaluate the expression;
Allegro CL Certification Program Lisp Programming Series Level I Session Basic Lisp Development in the IDE.
Module 10: Inheritance in C#. Overview Deriving Classes Implementing Methods Using Sealed Classes Using Interfaces Using Abstract Classes.
Introduction to LISP. Lisp Extensible: It lets you define new operators yourself Lisp programs are expressed as lisp data structures –You can write programs.
You can access the members of a list with the functions car (or first) and cdr (or rest): (setf list '(a b c)) (car list) ⇒ a (first list) ⇒ a (cdr list)
Java Part I By Wen Fei, HAO. Program Structure public class ClassName { public static void main(String[] args) { program statements } user defined methods.
An Introduction to Java – Part 1 Erin Hamalainen CS 265 Sec 001 October 20, 2010.
C Programming Day 2. 2 Copyright © 2005, Infosys Technologies Ltd ER/CORP/CRS/LA07/003 Version No. 1.0 Union –mechanism to create user defined data types.
An Introduction to Programming with C++ Sixth Edition Chapter 8 More on the Repetition Structure.
Institute of Radio Physics and Electronics ILug-Cal Introduction to GDB Institute of Radio Physics and Electronics and Indian GNU/Linux Users Group Kolkata.
STRUCTURED PROGRAMMING Complete C++ Program. Content 2  Main Function  Preprocessor directives  User comments  Escape characters  cout statement.
Introduction to python programming
Parallel Arrays? ANSI-C.
Lecture 7 Introduction to Shell Programming
Lecture 7 Introduction to Shell Scripts COP 3353 Introduction to UNIX.
What Should I Do if My Style Is Not Included?
Introduction to Programming
The setw Manipulator The setw manipulator causes the number (or string) that follows it in the stream to be printed within a field n characters wide, where.
Sequences and Indexing
Chapter 5- Control Structures: Part 2
C++ Basic Syntax – Homework Exercises
Objectives Define polymorphism Overload functions
Lists in Lisp and Scheme
Chapter 7: Introduction to CLIPS
Topics Introduction to File Input and Output
An Introduction to Java – Part I, language basics
Allegro CL Certification Program
J.E. Spragg Mitthögskolan 1997
CIS16 Application Development and Programming using Visual Basic.net
3-4: Arithmetic Sequences
PHP.
Topics Sequences Introduction to Lists List Slicing
Allegro CL Certification Program
C Programming Getting started Variables Basic C operators Conditionals
Arithmetic Sequence A sequence of terms that have a common difference between them.
Warm Up Factor the following: a) b).
Functions continued.
Lab 4: Introduction to Scripting
String Processing 1 MIS 3406 Department of MIS Fox School of Business
Topics Sequences Introduction to Lists List Slicing
Arithmetic Sequence A sequence of terms that have a common difference between them.
Topics Introduction to File Input and Output
Introduction to Strings
Introduction to java Part I By Shenglan Zhang.
List manipulation Consider student database, where each student is represented by the following list: * (setf student1 '((Paul Bennett) ((hw1 4.3) (hw2.
SEEM 4540 Tutorial 4 Basic PHP based on w3Schools
Presentation transcript:

Allegro CL Certification Program 6/30/2019 Allegro CL Certification Program Lisp Programming Series Level I Session 1 Homework 6/30/2019

6/30/2019 Hello World Create a source file, write a function that prints “Hello World” Save the file Compile the file Load the .fasl file Run the function 6/30/2019

Arithmetic Write a function named polynomial 6/30/2019 Arithmetic Write a function named polynomial It must take 4 arguments: a, b, c and x It must return the value of ax2 + bx + c 6/30/2019

My-compile-and-load Write a function that compiles and loads 6/30/2019 My-compile-and-load Write a function that compiles and loads a file of Common Lisp source code. Takes as argument a file Returns the symbol t 6/30/2019

functions first, second, …, tenth 6/30/2019 functions first, second, …, tenth first, second, third, …, tenth name functions each of which takes a list as argument returns the corresponding element of its list argument define a function which takes as argument a list returns a list of the second and fourth elements of its argument 6/30/2019

function nth nth names a Common Lisp function which 6/30/2019 function nth nth names a Common Lisp function which takes as arguments a non-negative integer and a list returns the element of its list argument which is in the (zero-based) position specified by the first argument as before define a function which takes as argument a list uses nth to return a list of the second and fourth elements of its argument 6/30/2019

function nth cont’d define a function similar to that above which 6/30/2019 function nth cont’d define a function similar to that above which takes as arguments 2 non-negative integer aand a list returns a list of the elements of the list argument at the indices specified by the other 2 arguments modify the function defined above to also display the number of elements in the list arguments (use the length function) 6/30/2019

6/30/2019 function rest Just as first returns the first element of a list, the rest function returns that part of the list from which the first element has been removed define a function which takes as argument a list and returns a list of the result of calling first on the list argument and the result of calling rest on the list argument. 6/30/2019

function member The member function 6/30/2019 function member The member function takes as arguments any lisp object and a list. searches the list for a list element which is eql to the first argument returns that part of the list of which the matching object is the first element define a function which calls member and returns that part of the list which follows the matching object 6/30/2019

optional arguments to functions 6/30/2019 optional arguments to functions Define a function which takes 2 required arguments and 2 optional arguments. Prints each of its arguments Call the function with 2 non-integer arguments at least once Call the function with 3 arguments, not all of them integers, at least once Call the function with 4 arguments at least once 6/30/2019

keyword arguments to functions 6/30/2019 keyword arguments to functions Define a function doit which takes 2 required arguments alpha and beta and 2 keyword arguments gamma and delta. Prints each of its arguments make each of the following calls to the function (doit 2 3) (doit 2 3 :gamma 5) (doit 2 3 :delta 7 :gamma 5) 6/30/2019

rest argument to functions 6/30/2019 rest argument to functions Define a function doit2 which takes 2 required arguments alpha and beta and an &rest argument all-the-others Prints each of its arguments make each of the following calls to the function (doit2 2 3) (doit2 2 3 5) (doit2 2 3 ‘july 4 1776) (doit2 3 4 5 6 7) 6/30/2019