[aklug] OT: Clojure help
Tim Johnson
tim at akwebsoft.com
Fri May 26 07:18:01 AKDT 2017
clojure at googlegroups.com :)
* Christopher Howard <christopher.howard at qlfiles.net> [170526 05:16]:
> Is there a Clojure programmer on one of these lists who wouldn't mind
> corresponding with a Clojure n00b to answer a few basic questions? Here
> is the first one:
>
> When I run
>
> tutorial.core> (let [img (new-image 32 32)] (set-pixel img 10 10 cyan)
> (show img))
>
> from the REPL, this returns a javax.swing.JFrame object, and displays
> the frame and image as expected. However, if put the same in
>
> (defn -main
> "Generates image."
> [& args]
> (let [img (new-image 32 32)]
> (set-pixel img 10 10 cyan)
> (show img)))
>
> in more core.clj, and run (-main) from the REPL, I get error
>
> ClassCastException java.awt.image.BufferedImage cannot be cast to
> clojure.lang.IFn tutorial.core/-main (core.clj:11)
>
> Why the difference?
>
> --
> https://qlfiles.net
> _______________________________________________
> aklug mailing list
> aklug at aklug.org
> https://lists.aklug.org/mailman/listinfo/aklug
--
Tim
http://www.akwebsoft.com, http://www.tj49.com
More information about the aklug
mailing list