Error messages could certainly be better, and please call my attention
to any patches to this effect that have not gotten their due attention.
The particular error message in question here comes from Java, and is
more informative on more recent versions of Java. I get:
java.lang.ClassCastException: user.proxy$java.lang.Object$TableModel
$521c1983 cannot be cast to clojure.lang.IFn
This is pretty specific: it says that you are trying to use an
instance of a Java proxy as an IFn.
Stu
But that doesn't address the fundamental lack of useful information in
the error messages, which is something I've noticed as well. The
compiler could stand to be a bit friendlier in this regard..
On Mon, Mar 29, 2010 at 3:55 PM, Stuart Halloway
<stuart.hallo...@gmail.com> wrote:
One nice thing about Clojure is that double-parenthesized
((anything)) is
usually wrong.
Stu
Hi,
On Mon, Mar 29, 2010 at 11:23:29AM -0700, strattonbrazil wrote:
(import '(javax.swing JTable) '(javax.swing.table TableModel))
(def table (new JTable((proxy [TableModel] []
(getColumnCount [] 10)
(getRowCount [] 10)
(getValueAt [row column] (* row
column))))))
java.lang.ClassCastException: clojure.proxy.java.lang.Object
$TableModel (NO_SOURCE_FILE:2)
You have an extra pair of parens around the proxy call which will
treat
the proxy as function which won't work.
Try this:
(import 'javax.swing.JTable 'javax.swing.table.TableModel)
(def table (JTable. (proxy [TableModel] []
(getColumnCount [] 10)
(getRowCount [] 10)
(getValueAt [row column] (* row column)))))
Sincerely
Meikel
--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient
with
your first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
To unsubscribe from this group, send email to
clojure+unsubscribegooglegroups.com or reply to this email with
the words
"REMOVE ME" as the subject.
--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient
with your
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
To unsubscribe from this group, send email to
clojure+unsubscribegooglegroups.com or reply to this email with the
words
"REMOVE ME" as the subject.
--
Mark J. Reed <markjr...@gmail.com>
--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient
with your first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
To unsubscribe from this group, send email to clojure
+unsubscribegooglegroups.com or reply to this email with the words
"REMOVE ME" as the subject.
--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
To unsubscribe from this group, send email to clojure+unsubscribegooglegroups.com or
reply to this email with the words "REMOVE ME" as the subject.