Question: This needs to be done in scheme programming to compile in emacs/DrRacket Exercise 2.13: subst-1st Define a procedure subst-1st that takes three parameters: an item

This needs to be done in scheme programming to compile in emacs/DrRacket

 This needs to be done in scheme programming to compile in

Exercise 2.13: subst-1st Define a procedure subst-1st that takes three parameters: an item new, an item old, and a list of items ls. The procedure subst-1st looks for the first top-level occurrence of the item old in ls and replaces it with the item new Test your procedure on: (subst-1st 'dog 'cat '(my cat is clever)) (ny dog is clever) (subst-1st 'b'a '(c a b a c)) (cb bac) (subst-1st '(0) '(.) '((*) (1) (*) (2))) ((0) (1) (.) (2)) (subst-1st 'tvo 'one '()) () In order to be able to include lists as possible arguments to which the param- eters new and old are bound, use equal? to test for sameness. Also define procedures substq-1st and substv-ist that use eq? and eqv? respectively, instead of equal? to test for sameness. Exercise 2.13: subst-1st Define a procedure subst-1st that takes three parameters: an item new, an item old, and a list of items ls. The procedure subst-1st looks for the first top-level occurrence of the item old in ls and replaces it with the item new Test your procedure on: (subst-1st 'dog 'cat '(my cat is clever)) (ny dog is clever) (subst-1st 'b'a '(c a b a c)) (cb bac) (subst-1st '(0) '(.) '((*) (1) (*) (2))) ((0) (1) (.) (2)) (subst-1st 'tvo 'one '()) () In order to be able to include lists as possible arguments to which the param- eters new and old are bound, use equal? to test for sameness. Also define procedures substq-1st and substv-ist that use eq? and eqv? respectively, instead of equal? to test for sameness

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!