SHARE
TWEET

Untitled

a guest Nov 29th, 2019 99 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. (define-struct abc (a b))
  2.  
  3.  
  4. (define (foo p)
  5.   (cond
  6.     [(and (abc? p) (list? (abc-b p))) (cons (abc-a p) (list (abc-b p)))]
  7.     )
  8.   )
  9.  
  10. (define (bar1 lst)
  11. (cond
  12.   [(empty? lst) empty]
  13.   [(abc? (first lst)) (cons (foo (first lst)) (bar1 (rest lst)))]
  14.   [else (bar1 (rest lst))])
  15. )
  16.  
  17.  
  18. (bar1 (list (make-abc 4 (list 1 2 3))))
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top