[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Namespace resolution in libinterp
From: |
AndrewJanke |
Subject: |
Re: Namespace resolution in libinterp |
Date: |
Sun, 15 Jul 2018 20:03:03 -0700 (MST) |
> A quick peek led me to these two files [1], [2] which might be of your
interest.
The ov-java.* files define how Java objects behave inside the Octave
interpreter. But I'm looking for something that happens earlier: how the
Octave interpreter would determine that an expression like "foo.bar.Baz"
should be interpreted as a Java class reference. It'd be basically the same
process that lets "foo.bar.Baz" resolve to a function file "+foo/+bar/Baz.m"
using Octave/Matlab namespaces.
> Also, I couldn't see if the latter syntax is used by MATLAB, it still uses
the former one [3], I believe? Not sure how will it increase matlab
compatibility.
Matlab supports both syntaxes. For example, you can just say "m =
java.util.HashMap" instead of "m = javaObject('java.util.HashMap')". This
syntax is convenient if you're doing extensive work with Java objects inside
Matlab, or if you're writing classes that might be implemented in either
M-code or Java.
Cheers,
Andrew
--
Sent from: http://octave.1599824.n4.nabble.com/Octave-Maintainers-f1638794.html