Scheme: Cond "not equal"

conditional-statements, lisp, scheme

Solution

You can use `not` for that.

(cond
 ((not (eq? (car l) (cadr (order l))))
  (cons (count (car (order l)) (order l))
        (count-inorder-occurrences (cdr (order l))))
 ...)

Problem

I'd like to do this in scheme: ``` if ((car l) != (car (cdr (order l))) do something ``` in particular I wrote this: ``` ((eq? (car l) (car (cdr (order l))) ) (cons (count (car (order l)) (order l)) (count_inorder_occurrences (cdr (order l))))) ``` but it compares `(car l)` with `(car (cdr (order l))` for equality. I want instead to do something only if `eq?` is false. How can I do that in my example? Thanks

Original source