list - How to return nothing with cons in scheme -
I have a small problem with the programming task assigned to the plan. We were given the task to perform a task that gives only one value in a pair structure that meets the requirements of a given point. They are also back in the same pair structure, just the degrading entries have been removed. So far my code is
(define (if - all ia pred ls) (cons ((null? Ls) null) (cons (keep-
There is a problem if all (car LS) (housed-if-all future (CDR LS))) ((future LS) LS) (and faucet))
(keep-if-all odd? (List 1 2 3 (opposition) 4 4) (list 1 2 3 4 5))
returns
(1 () 3 (()) (1 () 3 () 5))
instead desired
(1 3 () (1 3 5))
A poke in the right direction will be highly appreciated
just another add a (If (or (not (empty? X)), (if something (car ls) of the (,? Ls) (but ((x (keep- if-all pre (car ls)) Is left ...); or if it was a pair, (Opposition X (Keep-A-Sub-Pre (CDR LS)); Then, add output to x ....)); Second, in output X (future LS) LS is not included (other '())))
Now it works as expected:
If-all weird? (List 1 2 3 (opposition 4 4) (list 1 2 3 4 5)); Value 15: (1 3 () (1 3 5))
Comments
Post a Comment