clojure proxy does not re-define methods then a Java constructor is called

2013-06-12 Thread Vladimir Tsichevski
Hi, In a Clojure proxy I need to re-define a method which is called by a Java constructor. I noticed that the function dispatch table in the proxy object is not initialized at that moment still, so the original method is always called. Any suggestions? Thanks in advance, Vladimir -- -- You

Re: how to get SHA1 of a string?

2013-03-04 Thread Vladimir Tsichevski
On Monday, March 4, 2013 10:54:13 PM UTC+4, larry google groups wrote: > > Right now I am using this block of code: > > (let [username (get-in @um/interactions [:omniture-api- > credentials :username]) > secret (get-in @um/interactions [:omniture-api-credentials :shared- > secret]) > ran

Re: Java interop: "Can't call public method of non-public class"

2013-03-04 Thread Vladimir Tsichevski
I think not. But upgrading to clojure 1.5 will do. On Friday, March 1, 2013 1:20:57 PM UTC+4, Marko Topolnik wrote: > > I'd say it's a bug. You are invoking a public class's method, which > happens to be inherited from a package-private class. Clojure's reflective > code accesses the superclass

Why not when-let* ?

2013-02-27 Thread Vladimir Tsichevski
Hi, The when-let macro is great, but it accepts only one binding. Why? Are there any reason why this macro was not ever extended to support multiple bindings (defined, for example, here: http://inclojurewetrust.blogspot.ru/2010/12/when-let-maybe.html)? (when-let* [x (something)

Type hints ignored in proxy-super

2013-02-07 Thread Vladimir Tsichevski
Hi, seems type hints are ignored when we use proxy-super: (set! *warn-on-reflection* true) (proxy [Object][] (equals[o] (proxy-super equals))) Reflection warning, null:3 - reference to field equals can't be resolved. Regards, Vladimir PS: I'm on clojure-1.4 -- -- You received this mes

IllegalAccessError problem when referring non-public classes

2013-02-03 Thread Vladimir Tsichevski
Hi, I'm trying to create Excel files with jexcelapi: https://sourceforge.net/projects/jexcelapi/files/jexcelapi API provides a method of creating Excel fonts which uses instances of a non-public inner class: public WritableFont(FontName fn, int ps,

Re: Misleading ArityException error string

2012-12-26 Thread Vladimir Tsichevski
Thanx! On Wednesday, December 26, 2012 6:49:36 PM UTC+4, Andy Fingerhut wrote: > > Timothy Baldridge wrote a patch to improve this issue and attached it to > CLJ-1083: > > http://dev.clojure.org/jira/browse/CLJ-1083 > > Andy > > On Dec 26, 2012, at 3:20 AM, Vladim

Misleading ArityException error string

2012-12-26 Thread Vladimir Tsichevski
Hi, if the function name has characters, which are mangled by Clojure compiler, and we pass to such function wrong number of argument, we got wrong error message. For example: (defn a->b [x] x) (a->b 1 2) produces: clojure.lang.ArityException: Wrong number of args (2) passed to: user$*a* at

Re: Interop question concerning optional args

2012-12-11 Thread Vladimir Tsichevski
I found this (mis)feature quite annoying too. I think, we all shall ask the language authors to fix it. On Tuesday, December 11, 2012 10:44:34 AM UTC+4, Andy Fingerhut wrote: > > You can pass in a length 0 array of > java.nio.file.attribute.FileAttribute's like so: > > (java.nio.file.Files/creat

Re: class loaders stack constant grow in REPL

2012-12-10 Thread Vladimir Tsichevski
re.main), > but I went ahead and opened an nREPL JIRA issue to track it: > http://dev.clojure.org/jira/browse/NREPL-36 > > - Colin > > > > > On Monday, December 10, 2012 2:46:10 AM UTC-6, Vladimir Tsichevski wrote: >> >> Hi, >> >> just found that e

class loaders stack constant grow in REPL

2012-12-10 Thread Vladimir Tsichevski
Hi, just found that every interaction with Clojure REPL causes one more DynamicClassLoader put on the Thread context class loader chain. Here is how clojure.main/repl beginning looks like: (let [cl (.getContextClassLoader (Thread/currentThread))] (.setContextClassLoader (Thread/currentThr

gen-class: class loading problem

2012-12-09 Thread Vladimir Tsichevski
Hi, I'm trying embed clojure into a proprietary system. That system can be configured to create instances of specified Java classes and calling specified methods. So I want to use gen-class to create these proxies. The only problem is that both clojure and my proprietary system handle class l

Re: A bearded person, Clojure and JavaFX

2012-12-06 Thread Vladimir Tsichevski
Take a look at Eclipse RCP. It is much more than just a set of widgets. On Thursday, December 6, 2012 3:38:45 AM UTC+4, Christian Sperandio wrote: > > Hi, > > I'm one of those bearded (Lin)Unixians person who love the black screen. > I'm closer to back-office than front-office (it's may be my (to

Re: CCW: compile class static method call for a class that cannot be loaded

2012-12-06 Thread Vladimir Tsichevski
t is necessary. Regards, Vladimir On Thursday, December 6, 2012 9:02:52 PM UTC+4, Herwig Hochleitner wrote: > > In clojure, as in java, you can compile against a stub class and run > against the real class with the same signature. > > > 2012/12/6 Vladimir Tsichevski > > >&g

CCW: compile class static method call for a class that cannot be loaded

2012-12-06 Thread Vladimir Tsichevski
Hi, I'm using CCW to compile Clojure to java classes. I have to compile a static class method call like this: (MyClass/myMethod arg1 ...) To compile this the compiler needs to load the MyClass class. The problem is that in my case some classes can only be loaded in the running application. S

Re: CCW and Eclipse Build Path configuration

2012-12-04 Thread Vladimir Tsichevski
Done On Tuesday, December 4, 2012 8:06:37 PM UTC+4, lpetit wrote: > > > So, would you please create an issue for it ? I would not like to lose > track of it. > > http://code.google.com/p/counterclockwise/issues/list > > Thanks, > > -- > Laurent > -- You received this message because you a

Re: CCW and Eclipse Build Path configuration

2012-12-04 Thread Vladimir Tsichevski
egards, Vladimir On Tuesday, December 4, 2012 4:35:23 PM UTC+4, lpetit wrote: > > Hi Vladimir, > > 2012/12/4 Vladimir Tsichevski >: > > Hi, > > > > Is it possible to make CCW respect exclusions and inclusions in Eclipse > > Build Path configuration? >

CCW and Eclipse Build Path configuration

2012-12-04 Thread Vladimir Tsichevski
Hi, Is it possible to make CCW respect exclusions and inclusions in Eclipse Build Path configuration? Regards, Vladimir -- 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 fr

Re: Change the CCW compile output catalog

2012-12-02 Thread Vladimir Tsichevski
You aswers had everything I needed to know to move forward. Did not notice anything strange in them. It were late hours here in Moscow thought :-) On Sunday, December 2, 2012 2:32:45 AM UTC+4, lpetit wrote: > > 2012/12/1 Laurent PETIT >: > > Hello, > > > > 20

Re: Change the CCW compile output catalog

2012-12-01 Thread Vladimir Tsichevski
On Sunday, December 2, 2012 2:11:48 AM UTC+4, Vladimir Tsichevski wrote: > > > Hi Laurent, > > many thanks for the quick and helpful response! > > Now that I've managed to make CCW compile my clojure code to classes I'm > wondering how to tell Eclipse to pack

Re: Change the CCW compile output catalog

2012-12-01 Thread Vladimir Tsichevski
2, 2012 1:04:06 AM UTC+4, lpetit wrote: > > Hello, > > 2012/12/1 Vladimir Tsichevski >: > > Hi, > > > > CCW always outputs compiled classes into the "classes" catalog. AFAIK, > this > > name is compiled into CCW and hence cannot be changed.

Change the CCW compile output catalog

2012-12-01 Thread Vladimir Tsichevski
Hi, CCW always outputs compiled classes into the "classes" catalog. AFAIK, this name is compiled into CCW and hence cannot be changed. My two questions are: 1. Why the catalog path is not configurable? Was this made intentionally? 2. Why this catalog differs from the Java output catalog? Was it

Re: class loading problem in embedded clojure

2012-12-01 Thread Vladimir Tsichevski
Hi, nobody still cannot explain why PlatformUI (PlatformUI/getWorkbench) works, and (PlatformUI/getWorkbench) does not? -- 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

Re: call superclass method in classes created by Clojure?

2012-11-30 Thread Vladimir Tsichevski
9, 2012 1:40 PM, "Vladimir Tsichevski" > > > wrote: > >> Thanks >> >> On Thursday, November 29, 2012 5:33:20 PM UTC+4, David Powell wrote: >>> >>> >>> reify can only implement interfaces and protocols, so there aren't any >>

class loading problem in embedded clojure

2012-11-30 Thread Vladimir Tsichevski
Hi, I've embedded Clojure 1.4 with nREPL into my Eclipse RCP application. Now in nREPL I define a function which builds a menu with some actions. Everything seemes to work as expected. Now I select some menu item which executes the following code: (println PlatformUI) (println (PlatformUI/g

Re: call superclass method in classes created by Clojure?

2012-11-29 Thread Vladimir Tsichevski
Thanks On Thursday, November 29, 2012 5:33:20 PM UTC+4, David Powell wrote: > > > reify can only implement interfaces and protocols, so there aren't any > superclass methods to call (except the ones in Object I guess). > > > On Thu, Nov 29, 2012 at 1:30 PM, Vladimi

Re: call superclass method in classes created by Clojure?

2012-11-29 Thread Vladimir Tsichevski
Thanks, is there something like that for reify? On Thursday, November 29, 2012 2:52:56 AM UTC+4, Meikel Brandmeyer (kotarak) wrote: > > Am 28.11.12 23:10, schrieb Vladimir Tsichevski: > > Is it possible? > See exposes-methods in documentation for gen-class. > > > h

call superclass method in classes created by Clojure?

2012-11-28 Thread Vladimir Tsichevski
Is it possible? -- 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, sen

Re: How to add an URL into the classpath?

2012-11-21 Thread Vladimir Tsichevski
Hi Yoshinori, after (unsuccessfully) struggling with Clojure dynamic ClassLoaders in clojure-1.4, I ended up with the 'brute force' solution--just add URL entries to the Java system classloader. Here is a simple example on how to do it from clojure: (defn add-system-classpath "Add an url pat

Re: Run Counterclockwise nREPL on specific port

2012-11-20 Thread Vladimir Tsichevski
Hi Jim, On Tuesday, November 20, 2012 10:13:02 PM UTC+4, Jim foo.bar wrote: > > On 20/11/12 18:08, Vladimir Tsichevski wrote: > > I've started a nREPL process embedded into some Java application. I > > can successfully connect to it and execute code remotely from oth

Run Counterclockwise nREPL on specific port

2012-11-20 Thread Vladimir Tsichevski
Hi, I've started a nREPL process embedded into some Java application. I can successfully connect to it and execute code remotely from other Clojure process. Now I need a client to provide me interactive REPL session. Since I use Counterclockwise, can I force Counterclockwise not to start a Clo

Re: impossible to create classes for non-closure environment

2012-11-05 Thread Vladimir Tsichevski
on, Nov 5, 2012 at 9:07 AM, Vladimir Tsichevski > > wrote: > >> >> Hi Stuart. >> >> thank you for pointing me to my 'cloSure' misspelling. Have lived in the >> Scheme world for too long :-) >> >> As to Java classes generation, IMHO it

Re: impossible to create classes for non-closure environment

2012-11-05 Thread Vladimir Tsichevski
s is > very regular, you may find it easier to generate Java source code as > strings. That's how all the primitive interfaces in clojure.lang.IFn were > created. > > -S > > > > On Sunday, November 4, 2012 4:43:59 AM UTC-5, Vladimir Tsichevski wrote: >> >>

Re: pattern-matching in Closure?

2012-11-04 Thread Vladimir Tsichevski
Excellent! Thanks! On Monday, November 5, 2012 2:12:16 AM UTC+4, Marek Šrank wrote: > > At the wiki: https://github.com/clojure/core.match/wiki :-) > > Marek. > > On Sunday, November 4, 2012 11:03:40 PM UTC+1, Vladimir Tsichevski wrote: >> >> Hi Moritz, >>

Re: pattern-matching in Closure?

2012-11-04 Thread Vladimir Tsichevski
Hi Moritz, this looks promising. Do you know where can I get any documentation/examples for this module? Regards, Vladimir On Monday, November 5, 2012 1:10:59 AM UTC+4, Moritz Ulrich wrote: > > Use core.match: https://github.com/clojure/core.match > > On Sun, Nov 4, 2012 at 10:09

Re: Java-to-Clojure source translation?

2012-11-04 Thread Vladimir Tsichevski
Hi Stuart. On Monday, November 5, 2012 1:10:36 AM UTC+4, Stuart Sierra wrote: > > Hello, > > It is not really possible to make a direct translation from Java to > Clojure. Java has mutable variables and imperative flow-control, for which > there is no equivalent in Clojure. > > -S > > That's wh

pattern-matching in Closure?

2012-11-04 Thread Vladimir Tsichevski
Hi gurus. Is it possible in Clojure to use pattern matching, like I can with Bigloo scheme, for example: (match-case '(a b a) ((?x ?x) 'foo) ((?x ?- ?x) 'bar)) Regards, Vladimir -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this g

Re: Java-to-Clojure source translation?

2012-11-04 Thread Vladimir Tsichevski
Hi Maik, no, I need to re-implement existing code in Clojure. Why do you want this? If you have java code you can just call it from > clojure.no need for translation > Am 04.11.2012 19:39 schrieb "Vladimir Tsichevski" > > >: > >> Hi gurus, >> >>

Java-to-Clojure source translation?

2012-11-04 Thread Vladimir Tsichevski
Hi gurus, I wonder if there are any means that'd help me translate Java sources to Clojure? I do not expect getting working Closure code OOTB, just anything to start from. Regards, Vladimir -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post t

Re: impossible to create classes for non-closure environment

2012-11-04 Thread Vladimir Tsichevski
, Vladimir On Sat, 2012-11-03 at 13:57 -0700, Vladimir Tsichevski wrote: > > In one of my purely Java project I have to create hundreds of java > classes > > with repeatable structure, so the task is an excellent candidate for > > automation. I hoped I will be able to crea

impossible to create classes for non-closure environment

2012-11-03 Thread Vladimir Tsichevski
Hi closure developers. In one of my purely Java project I have to create hundreds of java classes with repeatable structure, so the task is an excellent candidate for automation. I hoped I will be able to create these classes with the latest closure, using the 'deftype' construct. I learned cu