Answers for "how to pass unction in scheme"


how to pass unction in scheme

/* Scheme code example for passing multiple function into a function) */

(define (square x) (* x x))
(define (mul_two x) (* 2 x))

(define (new_fun fun1 fun2) (lambda (x) (fun2 (fun1 x))))

/* The line below is to run the code in scheme  */
((new_fun square mul_two) 10)
Posted by: Guest on May-11-2020

Code answers related to "Scheme"

Browse Popular Code Answers by Language