Docsity

Programming Project #3 in COP4020: Implementing Functions in Lisp, Study Guides, Projects, Research of Programming Languages

Toggle sidebar
bg1
University of Central Florida
School of Electrical Engineering & Computer Science
COP4020: Programming Languages I
Summer 2009
Programming project #3 (Lisp)
Due July 1st, 2009 by 11:59 p.m.
1. In this assignment you will implement a function doubleAll in Lisp:
This function takes a list of integer and return a list if input that multiplied by 2.
The examples :
(doubleAll nil) returns nil
(doubleAll โ€˜(1 2 3)) returns (2 4 6)
(doubleAll โ€˜(3 6 2 (5 1))) returns (6 12 4 (10 2))
2. Implement the following functions in Lisp to handle a list of lists (The examples for each function
are given belows) :
a) My_Member :
(My_Member โ€˜A โ€˜(A B C D)) returns true
b) My_Union
(My_union โ€˜(a b) โ€˜(c d)) returns (a b c d)
(My_union โ€˜(a b) โ€˜(b d)) returns (a b d)
c) My_Intersect
(My_Intersect โ€˜(a b) โ€˜(c d)) returns nil
(My_Intersect โ€˜(a b) โ€˜(b d)) returns (b)
d) My_Difference
(My_difference โ€˜(a b) โ€˜(c d)) returns (a b)
(My_difference โ€˜(a b) โ€˜(b d)) returns (a)

Partial preview of the text

Download Programming Project #3 in COP4020: Implementing Functions in Lisp and more Study Guides, Projects, Research Programming Languages in PDF only on Docsity!

University of Central Florida

School of Electrical Engineering & Computer Science

COP4020: Programming Languages I

Summer 2009

Programming project #3 (Lisp) Due July 1st, 2009 by 11:59 p.m.

  1. In this assignment you will implement a function doubleAll in Lisp: This function takes a list of integer and return a list if input that multiplied by 2. The examples : (doubleAll nil) returns nil (doubleAll โ€˜(1 2 3)) returns (2 4 6) (doubleAll โ€˜(3 6 2 (5 1))) returns (6 12 4 (10 2))
  2. Implement the following functions in Lisp to handle a list of lists (The examples for each function are given belows) : a) My_Member : (My_Member โ€˜A โ€˜(A B C D)) returns true b) My_Union (My_union โ€˜(a b) โ€˜(c d)) returns (a b c d) (My_union โ€˜(a b) โ€˜(b d)) returns (a b d) c) My_Intersect (My_Intersect โ€˜(a b) โ€˜(c d)) returns nil (My_Intersect โ€˜(a b) โ€˜(b d)) returns (b) d) My_Difference (My_difference โ€˜(a b) โ€˜(c d)) returns (a b) (My_difference โ€˜(a b) โ€˜(b d)) returns (a)