java-interop Questions

2

Solved

I'd like to use reflection to get a method of a Java object from Clojure. One of the argument types is a Java primitive and I don't know how to refer to them from Clojure. For example, say I wante...
Periphery asked 27/11, 2010 at 23:0

2

Solved

I have come across the @JvmSynthetic annotation in kotlin-stdlib, and I'm wondering what it is for, but, unfortunately, it is undocumented. (UPD: it was at that moment) As far as I understand, app...
Weinberg asked 7/12, 2016 at 16:15

3

Solved

This following declaration is legal in Kotlin. fun foo(): String = "foo_1" fun <T> foo(): T = "foo_2" as T As bytecode we are getting: public final static foo()Ljava/lang/String; // sign...
Disseisin asked 25/8, 2018 at 19:31

2

This is a general question. Let's say I have an extension function written in kotlin which converts DP to PX and return a NonNull Int fun Int.toPx() { /** implementation */ } The function in jav...
Lola asked 12/12, 2017 at 15:14

3

Solved

use java::util::zip::CRC32:from<java>; my $crc = CRC32.new(); for 'Hello, Java'.encode('utf-8') { $crc.'method/update/(B)V'($_); } say $crc.getValue(); sadly, this does not work Method '...
Probate asked 26/11, 2014 at 18:23

3

Solved

I have a library contains a bunch of static *lib files, I wish to access them from JNA (a Java library that allows one to dynamically call `dll's from JAVA Code), so is there a way to magically cha...
Burcham asked 10/5, 2009 at 11:50

2

Solved

in the :constructors map and subsequent -init definitions, how do I represent a varargs constructor (assuming the superclass has multiple constructors of which one is varargs) ?

2

Solved

Is there any idiomatic way of converting Clojure list into Java array, other than first converting it to vector and using into-array (means, something other than (into-array (vec my-list)), as I do...
Perretta asked 20/5, 2013 at 10:15

3

Solved

I am creating a Clojure interface to a Java API with a method that returns a java.util.LinkedHashSet. Firstly, is the idiomatic Clojure way of handling this to convert the LinkedHashSet to a cloj...
Maturity asked 14/2, 2012 at 10:42

2

Solved

For the purposes of interoperability with Java, I need a class that has a nullary constructor that performs initialization. Objects of this class need to have something resembling mutable java fiel...
Rushy asked 29/6, 2011 at 2:30

1

Solved

I'm attempting to use deftype (from the bleeding-edge clojure 1.2 branch) to create a java class that implements the java Servlet interface. I would expect the code below to compile (even though it...
Ereshkigal asked 18/5, 2010 at 1:22

3

Solved

I am trying to wrap a Java library with a Clojure binding. One particular class in the Java library defines a bunch of static final constants, for example: class Foo { public static final int BAR...
Submarginal asked 3/4, 2010 at 18:57

3

Solved

Or do I have to specifically enumerate every class that I import? I'm just learning Clojure now, and it seems useful to be able to do something like this in the REPL: (import '(java.io *)) Not...
Ungrudging asked 2/1, 2010 at 5:42
1

© 2022 - 2024 — McMap. All rights reserved.