Question: You can only use the functions/macros we discussed in the LISP notes. You may also use += in your iterate Your code must be executed


You can only use the functions/macros we discussed in the LISP notes. You may also use += in your iterate Your code must be executed on a fox server using the specified test cases. To load your code, use (load "p3Lisp.txt" :echo T :print T). . To run the test cases, use (load "p3LispRun.txtecho T :print T) Turn in a zip file named LastNameFirstName.zip (no spaces) containing o Your source LISP code o Your log of the session (see the setup instructions). This should be a p30ut.txt o Do not have any directories within your zip file Your code must follow my LISP programming standards 1. code the macro, +=, which is passed a variable which it increments and assigns the new value. The function value returned by should be the new value of numericVariable (+numericVariabLe incrementVaLue) Example: > setf x 10 y 5) 15 15 20 20 CLISP sometimes gives an error like the following when you LOAD a file with that macro definition: #PACKAGE COMMON-LISP> is locked if you continue (by typeing'continue'): Ignore the lock and proceed To ignore that message, simply type CONTINUE 2. Code the macro, iterate, which is based on the following iterate controlVariable beginValueExpr endValueExpr incrExpr bodvexpr1 bodyexpr2... bodvexprN) iterate is passed a controlVariable which is used to count from beginValueExpr to endValueExpr (inclusive) by the specified increment For each iteration, it evaluates each of the one or more body expressions Since beginValueExpr endValueExpr, and incrExpr are expressions, they must be evaluated The endValueExpr and incrExpr are evaluted before processing the rest of the macro. This means the code within the user's use of the macro cannot alter the termination condition nor the increment; however, it can change the value of the controlVariable, The functional value of iterate will be T You can create an intermediate variable named endValue for the endValueExpr. You can create an intermediate variable named incValue for the incrExpr. name of those two variables. For 2 points bonus, use gensym to generate the You can only use the functions/macros we discussed in the LISP notes. You may also use += in your iterate Your code must be executed on a fox server using the specified test cases. To load your code, use (load "p3Lisp.txt" :echo T :print T). . To run the test cases, use (load "p3LispRun.txtecho T :print T) Turn in a zip file named LastNameFirstName.zip (no spaces) containing o Your source LISP code o Your log of the session (see the setup instructions). This should be a p30ut.txt o Do not have any directories within your zip file Your code must follow my LISP programming standards 1. code the macro, +=, which is passed a variable which it increments and assigns the new value. The function value returned by should be the new value of numericVariable (+numericVariabLe incrementVaLue) Example: > setf x 10 y 5) 15 15 20 20 CLISP sometimes gives an error like the following when you LOAD a file with that macro definition: #PACKAGE COMMON-LISP> is locked if you continue (by typeing'continue'): Ignore the lock and proceed To ignore that message, simply type CONTINUE 2. Code the macro, iterate, which is based on the following iterate controlVariable beginValueExpr endValueExpr incrExpr bodvexpr1 bodyexpr2... bodvexprN) iterate is passed a controlVariable which is used to count from beginValueExpr to endValueExpr (inclusive) by the specified increment For each iteration, it evaluates each of the one or more body expressions Since beginValueExpr endValueExpr, and incrExpr are expressions, they must be evaluated The endValueExpr and incrExpr are evaluted before processing the rest of the macro. This means the code within the user's use of the macro cannot alter the termination condition nor the increment; however, it can change the value of the controlVariable, The functional value of iterate will be T You can create an intermediate variable named endValue for the endValueExpr. You can create an intermediate variable named incValue for the incrExpr. name of those two variables. For 2 points bonus, use gensym to generate the
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
