Return value in Clojure

How to describe a function in an interface, in whose signature the return type is the interface itself. I suppose that there is a way, to solve it, as it is in other languages.

(definterface Expression
  (^Number evaluate [data])
  (^Expression diff [diffVar]))
Syntax error (ClassNotFoundException) compiling deftype* at (expressionJava.clj:8:1).

Full report at:

I'd tried to "declare Expreesion", but ain't help.


  • (definterface Expression
        (evaluate ^Number [data])
        (diff ^Expression [diffVar]))

    In Clojure, return type hints are metadata on the argument list, not on the function name.