Question: Use SCHEME lang htdp . org racket - lang.org drRacket IDE Use Teaching language Advanced student Must show attempt to execute Write documentation for the
Use SCHEME lang
htdporg
racketlang.org
drRacket IDE
Use Teaching language
Advanced student
Must show attempt to execute
Write documentation for the following code then code:
Function Calculatormycalc no op no
Do in a single line of code
Reimplement reverse function for arbitrary list
no "for" or "loop" function
use recursion instead
use "cons" and "append" function
Count no of e in a arbitrary list
list example
list head, tail tail tail dots populated list
list empty list
Notes for the HW:
Lambda's job is to construct functions.
Method of terminating recursion:
Are we there yet?
Least amount of work?
Who can I get to do the rest of the work?
Figure out where to locate head of list and its proceeding tails
Restricted form of Scheme only has operation name parms
name of the function, parameter of function
Define lambda: Use explicit use of lambda
scheme has functions:
list car cdr cons append if
car gets the head
cdr gets the tail
cons adds an element to front of list
append appends the list
Scheme lang example used in class:
Sum Function:
Terminates when there are no more numbers to add
define mysum
lambdax
ifequalxlist
carxmysumcdrx
square function example in scheme
lambda:
pass into the lambda function which performs which are a prefix function
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
