Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- (define eval-arith
- '(let (member?
- (lambda-rec (member-in-list? e list)
- (cond
- [(eq? list `()) false]
- [(eq? e (car list)) true]
- [true (member-in-list? e (cdr list))])))
- (let
- (length
- (lambda-rec (lenght list)
- (if (eq? list `())
- 0
- (+ 1 (len (cdr list))))))
- (let
- (is-list?
- (lambda-rec (is-list? list)
- (or (eq? list `())
- (and (pair? list)
- (is-list? (cdr list))))))
- (let
- (binop?
- (lambda (e)
- (and (is-list? e)
- (and 😊 (length e) 3)
- (member? (car e) (cons-cons '+ (cons-cons '- (cons-cons '* (cons-cons '/ null)))))))))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement