Wed 10 Aug 2016 11:56:29 AM UTC, comment #11:
A, my failure:
This is java code.
In fact, in matlab constructor is without new.
So i cannot know whether an according form of constructor of arrays works in matlab.
Does anyone have a working matlab at hand??
|
Wed 10 Aug 2016 01:10:16 AM UTC, comment #10:
Is new a keyword in the Matlab language or a function? What happens if you shadow new before trying to create a java array with new in Matlab?
|
Tue 09 Aug 2016 11:22:23 PM UTC, comment #9:
I have forgotten:
seemingly also javaArray can be written
in the form java.lang...
in the matlab docs I found in
http://de.mathworks.com/help/matlab/ref/javaarray.html?searchHighlight=javaArray
the snippet:
A = new PackageName.ClassName[x1]...[xN];
|
Tue 09 Aug 2016 11:07:45 PM UTC, comment #8:
This thread concentrates on object creation with javaObject.
But there are still static methods and fields.
Semmingly matlab does not allow static methods
invoked in java style like java.lang.System.load(...)
but i am not sure...
What about set and get fields?
is java.lang.Double.MAX_VALUE possible?
Maybe for set/get only?
|
Sun 31 Jul 2016 08:36:46 PM UTC, comment #7:
The only way I have to check the usefulness of supporting java.XXX only vs a proper fix is via Octave Forge.
Which would suggest that supporting java.XXX only is not that important (almost all of the hits are from the io package and some from ltfat). That kind of makes sense, most of the stuff in the java namespace is core stuff that Octave will already support natively. If it's being used, is for use in java classes outside the java namespace.
|
Sun 31 Jul 2016 05:38:19 PM UTC, comment #6:
I borrowed this for pytave because every Python class is prefixed with "py." in Matlab's interface.
I agree this could be used for the "java.xxx" namespace only which may be partially useful, but also misleading since it won't support any other namespaces.
|
Sat 30 Jul 2016 01:57:09 PM UTC, comment #5:
The hack I proposed on comment #4 is now being used in pytave to support py.foo syntax so maybe it's not that bad and we could consider to support java.XXX only.
One thing that I now realize for supporting this notation on other java namespaces. If we want to cover anything in the javaclasspath, we will have to start the JVM the first time someone calls an undefined function of mistypes a variable name. That's a performance hit we might not want to have.
|
Thu 14 Jul 2016 03:11:52 PM UTC, comment #4:
This can be easily worked around for java.X classes with the following class:
Obviously this will not be merged but it might be useful if anyone needs to make some Matlab code work and they only use java.XXX classes.
|
Thu 07 Jul 2016 04:45:14 PM UTC, comment #3:
I'd like to leave this up as a stand-alone item. The list on the task tracker is pretty long, and I want to see if we can get this one feature implemented for 4.2.
|
Thu 07 Jul 2016 04:25:32 PM UTC, comment #2:
There's task tracker entry (task #12601) where this is also mentioned in your original report.
Should we close this bug and refer to the task tracker?
|
Wed 06 Jul 2016 11:00:48 PM UTC, comment #1:
More specific examples that work in Matlab, but not Octave
|
Wed 06 Jul 2016 10:59:39 PM UTC, original submission:
Matlab supports java.XXX syntax to easily use Java in m-files. Octave only supports the longer form using javaObject, the class name, and any function arguments.
It would be nice to add a little bit of syntactic sugar in the parser to possiby convert
to
|