Question: 5. A functional language could use some data structure other than the list. For example, it could use sequences of symbols. What primitives would such

 5. A functional language could use some data structure other than

5. A functional language could use some data structure other than the list. For example, it could use sequences of symbols. What primitives would such a language have in place of the CAR, CDR, and CONS primitives of Scheme? What does the following Scheme function do? 8. (define (y s lis) (cond (null? lis) 0) ((equal? s (car lis)) lis) (else (y s (cdr lis) 9. What does the following Scheme function do? (define (x lis) cond (null? lis) 0) (not (list? (car lis)) cond ((eq? (car lis) nil) (x (cdr lis) else (+ 1 (x (edr lis))) (else (+ (x (car lis) (x (cdr lis)))

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!