Using substitution model write corresponding constructor, C/C++ Programming

(a) Pairs may be represented using a lambda. Using only lambdas, create a procedure (triple x y z) that constructs a triplet. You may NOT use car, cons or cdr in the triplet procedures. Using this formulation for a triplet, write procedures first, second and third that return the first, second and third elements of the triplet respectively.
For example:

(define a (triple 1 2 3))
(first a) => 1
(second a) => 2
(third a) => 3

(b) Using the substitution model, show how (first a) returns the value 1.

(c) Develop another alternative representation of triples. Write the corresponding constructor, first, second and third procedures, along with set-first!, set-second! and set-third!. You may not use car, cdr or cons in this second implementation.

 

Posted Date: 3/25/2013 1:06:56 AM | Location : United States







Related Discussions:- Using substitution model write corresponding constructor, Assignment Help, Ask Question on Using substitution model write corresponding constructor, Get Answer, Expert's Help, Using substitution model write corresponding constructor Discussions

Write discussion on Using substitution model write corresponding constructor
Your posts are moderated
Related Questions
Please use C or C++ to write your programs. Our homework will focus on SUN sparc machines because to exploit x86 stack-overflow is too easy. This is not just a programming assignme

You are to develop a Clinic System. 1. Identify and briefly explain the objects, classes, methods and attributes for the Clinic System. 2. Draw a use case diagram to represen


hi Bhasker, as we spoke tru phone ,we need a project using cloud computing .we need to present a protoype or demo on it (any thing using cloud should be fine)(ex: P2p)

Should I call a destructor explicitly on a local variable?

What is a newline escape sequence? - A newline escape sequence is signified by the \n character. - It is used to insert a new line whereas displaying the output data. - T

The ability to verify at run time the type of an object by using the typed operator or the dynamic_cast operator.

Program to draw a circle: int main(void) {    /* request auto detection */    int gdriver = DETECT, gmode, errorcode;    int midx, midy;    int radius = 100;

Develop a client and a server for an instant messaging system based on UDP and IPv4

For your class to work properly, you'll need to define appropriate constructors, extract and insert operators, and of course arithmetic operators. (If you wanted to use it as a gen