Try:
(defn my-fn [#^String s #^Integer i] (println (format"%s %d" s i)))
#'user/my-fn
user=> (my-fn 1 "foo")
java.util.IllegalFormatConversionException: d != java.lang.String
(NO_SOURCE_FILE:0)
user=> (my-fn "foo" 1)
foo 1
Stuart
>
> Hi all,
>
> I'm attempting to provide 2 type hints here and not working...
>
> (defn my-fn [#^String s #^Integer i] (println format("%s %d" s i)))
> (my-fn "hello" (new Integer 123))
>
> Thanks
> Sun
>
> >
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Clojure" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
-~----------~----~----~----~------~----~------~--~---