Question
I need help with making a Racket function that takes a datum and returns a boolean whether or not the quoted term is a function
I need help with making a Racket function that takes a datum and returns a boolean whether or not the quoted term is a function definition called
define func?
define definition = (define (variable+) term+), so basically a define-func need to have a list of at least one or more variable and at least one or more terms (we can also say term+ is the body of the function)
+ Template
(define (define-func node) ('todo)), 'todo is where you have to write your code
+ Test case
(check-true (define-func? (quote (define (x) 3)))) ; This should pass
(check-true (define-func? '(define (x y z x) 3 3 3 3))) ; This should pass
(check-true (define-func? (quote (define () ())))) ; This should not pass because there are no variable and term.
You can make more test case of your choice
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started