Question: Help for racket Write a mutually recursive function (string-lengths str-lst) that takes one argument, a string-list. ::= () | ( . ) ::= | string-lengths

Help for racket

Write a mutually recursive function (string-lengths str-lst) that takes one argument, a string-list.

  ::= () | ( . )  ::=  |  

string-lengths returns a n-list with the same shape as str-lst, where each string has been replaced by its length. For example:

 > (string-lengths '("Write" "a" "mutually" "recursive" "function" ("max-length" "str-list") "that" "takes" "one" "argument" ("a" "string-list"))) '(5 1 8 9 8 (10 8) 4 5 3 8 (1 11)) 

string-lengths should be mutually recursive with the function string-lengths-se, which processes a string expression. Recall that Racket provides string-length as a primitive function.

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!