Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

In SCALA Create three scheme functions that take two lists and return a single list. Name the first one vecadd and add the two input

In SCALA
image text in transcribed
Create three scheme functions that take two lists and return a single list. Name the first one "vecadd" and add the two input lists together to create the output list. Make sure that at least the following work. (display (vecadd "() ( ))) (newline) (display (vecadd (1) (2))) (newline) (display (vecadd . (123) "(4 5 6))) (ne wline) ;(5 7 9) (display (vecadd (1. 3) '(4. 6))) (ne wline) (5.9) Create a second function "vecfn" that allows one to pass the function to perform on the input lists as the first argument. In addition to working for the above by passing in the "+function, it should also work for the following (display (vecfn - "(1 2 3) '(4 5 6))) (n ewline) (display (vecfn '(4) (list (sqrt -1))) ) (newline) (display (vecfn / . (1 2 3) (1 4 5))) (n ewline) Finally, add a "vecfun" to the syntax of Scheme. Submit a single text file Create three scheme functions that take two lists and return a single list. Name the first one "vecadd" and add the two input lists together to create the output list. Make sure that at least the following work. (display (vecadd "() ( ))) (newline) (display (vecadd (1) (2))) (newline) (display (vecadd . (123) "(4 5 6))) (ne wline) ;(5 7 9) (display (vecadd (1. 3) '(4. 6))) (ne wline) (5.9) Create a second function "vecfn" that allows one to pass the function to perform on the input lists as the first argument. In addition to working for the above by passing in the "+function, it should also work for the following (display (vecfn - "(1 2 3) '(4 5 6))) (n ewline) (display (vecfn '(4) (list (sqrt -1))) ) (newline) (display (vecfn / . (1 2 3) (1 4 5))) (n ewline) Finally, add a "vecfun" to the syntax of Scheme. Submit a single text file

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Big Data Fundamentals Concepts, Drivers & Techniques

Authors: Thomas Erl, Wajid Khattak, Paul Buhler

1st Edition

0134291204, 9780134291208

More Books

Students also viewed these Databases questions

Question

If

Answered: 1 week ago