Re: Java interop question

2019-02-05 Thread Thiago Araújo
That works, thanks a lot! Em terça-feira, 5 de fevereiro de 2019 11:55:32 UTC-3, jvshahid escreveu: > > > Thiago Araújo > writes: > > > Hi, > > > > I'm a newcomer to java interop. I'm trying to run the following code > > without success: > > > > (javafx.scene.layout.HBox. (javafx.scene.c

Re: Java interop question

2019-02-05 Thread John Shahid
Thiago Araújo writes: > Hi, > > I'm a newcomer to java interop. I'm trying to run the following code > without success: > > (javafx.scene.layout.HBox. (javafx.scene.control.Label. "Foo")) > > I get: > > IllegalArgumentException No matching ctor found for class > javafx.scene.layout.HBox

Java interop question

2019-02-05 Thread Thiago Araújo
Hi, I'm a newcomer to java interop. I'm trying to run the following code without success: (javafx.scene.layout.HBox. (javafx.scene.control.Label. "Foo")) I get: IllegalArgumentException No matching ctor found for class javafx.scene.layout.HBox clojure.lang.Reflector.invokeConstru

Re: java interop question: how to access Class object statically

2011-09-15 Thread Dave Ray
How about just "Integer"? :) Clojure> Integer java.lang.Integer Clojure> (class Integ­er) java.lang.Class Dave On Thu, Sep 15, 2011 at 1:31 PM, Andrew Xue wrote: > Hi all -- > > Trying to basically do something like Integer.class -- but ... > > user=> (Integer/class) > user=> java.lang.NoSuchFi

java interop question: how to access Class object statically

2011-09-15 Thread Andrew Xue
Hi all -- Trying to basically do something like Integer.class -- but ... user=> (Integer/class) user=> java.lang.NoSuchFieldException: class (NO_SOURCE_FILE:2) user=> (Integer/getClass) java.lang.NoSuchFieldException: getClass (NO_SOURCE_FILE:4) Some (not so pretty) workarounds are (.getClass

Re: java interop question

2011-02-04 Thread clwham...@gmail.com
Yes, Ken's original suggestion was correct -- the clojure code had to look like a real java bean. It works perfectly now, so thanks! On Feb 3, 3:55 pm, Stuart Sierra wrote: > I don't know what "select * from StockTick(symbol=..." is doing, but it > looks like the error is coming from the library

Re: java interop question

2011-02-03 Thread Stuart Sierra
I don't know what "select * from StockTick(symbol=..." is doing, but it looks like the error is coming from the library handling that query, not Clojure. -Stuart Sierra clojure.com -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this gro

Re: java interop question

2011-02-03 Thread clwham...@gmail.com
Thanks for the tip on how to express a java bean -- that appears to only be part of the problem; I still have the error I posted above. But I'm going to keep flailing at it. On Feb 2, 10:11 am, Ken Wesson wrote: > On Wed, Feb 2, 2011 at 11:15 AM, clwham...@gmail.com > > wrote: > > I am doing som

Re: java interop question

2011-02-02 Thread Ken Wesson
On Wed, Feb 2, 2011 at 11:15 AM, clwham...@gmail.com wrote: > I am doing some prototyping with the event processing framework Esper > (http://esper.codehaus.org/) and I'm running up against my ignorance > of clojure/java interop. I would like to create a java bean in clojure > that is visible to t

java interop question

2011-02-02 Thread clwham...@gmail.com
I am doing some prototyping with the event processing framework Esper (http://esper.codehaus.org/) and I'm running up against my ignorance of clojure/java interop. I would like to create a java bean in clojure that is visible to the Esper runtime; I found some sample Java code that I clojurized as

Re: Newbie : Java Interop question

2010-10-18 Thread oak
Thanks just what needed to know On Oct 15, 11:13 pm, Randy Hudson wrote: > Nested classes require the syntax AClass$NestedClass -- this being the > "real name" of the class in the JVM. > Static members of classes are referenced as AClass/member -- > essentially treating the class as a namespace o

Re: Newbie : Java Interop question

2010-10-18 Thread oak
P = Property. Guess it could have been lower case p. On Oct 15, 11:19 pm, Michael Ossareh wrote: > On Fri, Oct 15, 2010 at 09:32, oak wrote: > > Hi All, > > > This is how i see the package in package explorer. > > IEssbase.class > >  (I) IEssbase > >      (C, s f) Home > >             (M, s) cre

Re: Newbie : Java Interop question

2010-10-15 Thread Michael Ossareh
On Fri, Oct 15, 2010 at 09:32, oak wrote: > Hi All, > > This is how i see the package in package explorer. > IEssbase.class > (I) IEssbase > (C, s f) Home > (M, s) create(String) IEssbase > (M, c) Home() > (P, s f) JAPI_VERSION > > Out of interest what is this

Re: Newbie : Java Interop question

2010-10-15 Thread Randy Hudson
Nested classes require the syntax AClass$NestedClass -- this being the "real name" of the class in the JVM. Static members of classes are referenced as AClass/member -- essentially treating the class as a namespace of its static members. So this should do it: (IEssbase$Home/create IEssbase/JAPI_VE

Re: Newbie : Java Interop question

2010-10-15 Thread oak
Sorry i've tried that as well. The problem is that Home is not a method on IEssbase. That's the message i get back. On Oct 15, 1:08 pm, ".Bill Smith" wrote: > Try using  IEssbase/JAPI_VERSION instead (replace dot with slash). > > On Oct 15, 11:32 am, oak wrote: > > > > > Hi All, > > > This is ho

Re: Newbie : Java Interop question

2010-10-15 Thread .Bill Smith
Try using IEssbase/JAPI_VERSION instead (replace dot with slash). On Oct 15, 11:32 am, oak wrote: > Hi All, > > This is how i see the package in package explorer. > IEssbase.class >   (I) IEssbase >       (C, s f) Home >              (M, s) create(String) IEssbase >              (M, c) Home() >

Newbie : Java Interop question

2010-10-15 Thread oak
Hi All, This is how i see the package in package explorer. IEssbase.class (I) IEssbase (C, s f) Home (M, s) create(String) IEssbase (M, c) Home() (P, s f) JAPI_VERSION I can import like this in Clojure =>(import `(com.essbase.api.session IEssbase))` I can

RE: Java interop question: proxy or gen-class?

2010-04-17 Thread Kevin
> Many thanks to Meikel Brandmeyer, whose code (after a one-character typo correction) worked the first time. As soon as I saw it, I understood every line of it; the problem was, it wouldn't have occurred to me to put all those elements (which, individually, I understood) together in just that way.

Re: Java interop question: proxy or gen-class?

2010-04-16 Thread Gregg Williams
Many thanks to Meikel Brandmeyer, whose code (after a one-character typo correction) worked the first time. As soon as I saw it, I understood every line of it; the problem was, it wouldn't have occurred to me to put all those elements (which, individually, I understood) together in just that way. M

Re: Java interop question: proxy or gen-class?

2010-04-14 Thread Meikel Brandmeyer
Hi, My try. Not tested, though... (defn create-toggle-shape "Creates an ellipse that changes shape when it is clicked." [] (let [fIsPressed? (atom false) shape (proxy [PPath] [] (paint [#^PPaintContext paintContext]

Re: Java interop question: proxy or gen-class?

2010-04-13 Thread Gregg Williams
Since my last post, I've implemented and successfully run everything in this sample program except the ToggleShape class, and I absolutely cannot figure out how to use proxy correctly. Here's the Java code that I'm trying to re-create in Clojure: class ToggleShape extends PPath { priva

Re: Java interop question: proxy or gen-class?

2010-04-09 Thread Per Vognsen
On Sat, Apr 10, 2010 at 10:54 AM, Gregg Williams wrote: > Because this new class, ToggleShape, has the added state of > fIsPressed, is it possible to use proxy at all The proxy body can close over the lexical scope: (let [pressed? (ref false)] (proxy [PPath] [] ;; ... (

Java interop question: proxy or gen-class?

2010-04-09 Thread Gregg Williams
Hi--I'm continuing on my path to learning how to use Clojure with the graphics library Piccolo2D (http:// www.piccolo2d.org) by re-implementing some of Piccolo2D's sample programs. This time, I'm working on the "Building the Interface" program described at http://www.piccolo2d.org/learn/interface.h

Re: Java interop question

2009-01-11 Thread wal
On 12 янв, 01:01, Chouser wrote: > On Sun, Jan 11, 2009 at 3:30 PM, wal wrote: > > > Is it possible to access a constant inside a public static class which > > is defined inside a public interface? > > > For example: > > > package com.rabbitmq.client; > > > import java.io.IOException; > > [...sk

Re: Java interop question

2009-01-11 Thread Chouser
On Sun, Jan 11, 2009 at 3:30 PM, wal wrote: > > Is it possible to access a constant inside a public static class which > is defined inside a public interface? > > For example: > > package com.rabbitmq.client; > > import java.io.IOException; > [...skipped...] > > public interface AMQP > { >pub

Java interop question

2009-01-11 Thread wal
Is it possible to access a constant inside a public static class which is defined inside a public interface? For example: package com.rabbitmq.client; import java.io.IOException; [...skipped...] public interface AMQP { public static class PROTOCOL { public static final int MAJOR =

Re: Java interop question

2008-12-14 Thread Dave Newton
Sneaky, but I bet I'll get confused by the extra functionality at some point. --- On Sun, 12/14/08, Rich Hickey wrote: > There used to be a long answer as to why: > > http://groups.google.com/group/clojure/msg/8fc6f0e9a5800e4b > > Now there is a short one - it does work! --~--~-~--~-

Re: Java interop question

2008-12-14 Thread Rich Hickey
On Dec 14, 2:26 pm, David wrote: > work> (.getName (.getClass 0)) > "java.lang.Integer" > > work> (.getName java.lang.Integer) > ; Evaluation aborted. > > Why does the second expression fail? There used to be a long answer as to why: http://groups.google.com/group/clojure/msg/8fc6f0e9a5800e4b

Re: Java interop question

2008-12-14 Thread Dave Newton
--- On Sun, 12/14/08, David wrote: > work> (.getName java.lang.Integer) > ; Evaluation aborted. > > Why does the second expression fail? Would that work in Java? Dave --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Group

Java interop question

2008-12-14 Thread David
work> (.getName (.getClass 0)) "java.lang.Integer" work> (.getName java.lang.Integer) ; Evaluation aborted. Why does the second expression fail? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Clojure" group. To po

Re: Java interop question

2008-12-11 Thread Brian Doyle
This article has a good example using the proxy function. http://gnuvince.wordpress.com/2008/11/18/fetching-web-comics-with-clojure-part-2/ On Thu, Dec 11, 2008 at 1:22 PM, Randall R Schulz wrote: > > On Thursday 11 December 2008 11:31, Mark Engelberg wrote: > > I understand how Clojure lets yo

Re: Java interop question

2008-12-11 Thread Randall R Schulz
On Thursday 11 December 2008 11:31, Mark Engelberg wrote: > I understand how Clojure lets you consume Java objects, and pass > Clojure objects to Java programs. > > However, it is not uncommon for Java libraries to be designed in such > a way that you need to create a subclass of something in the

Java interop question

2008-12-11 Thread Mark Engelberg
I understand how Clojure lets you consume Java objects, and pass Clojure objects to Java programs. However, it is not uncommon for Java libraries to be designed in such a way that you need to create a subclass of something in the library in order to make use of the library. I don't understand wh

Re: java interop question

2008-10-27 Thread Phil Jordan
notallama wrote: > this may be more of a java question than a clojure question. i dunno. > > how do i use a java class from clojure? > > it's easy enough if it's one of the default java libraries, but so far > all i have managed with classes i wrote is "unable to resolve to > classname" > > i t

java interop question

2008-10-27 Thread notallama
this may be more of a java question than a clojure question. i dunno. how do i use a java class from clojure? it's easy enough if it's one of the default java libraries, but so far all i have managed with classes i wrote is "unable to resolve to classname" i tried running the repl from the dire