[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Namespace resolution in libinterp
From: |
apjanke |
Subject: |
Re: Namespace resolution in libinterp |
Date: |
Sun, 15 Jul 2018 19:54:58 -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 Octave, but as far
as I can tell, they don't contain the code that would let the interpreter
determine whether a given expression (like "foo.bar.Baz") should resolve to
a Java class reference.
I thinnk what I'm looking for is more something under libinterp/parse-tree.
For example, if you had a file `+foo/+bar/Baz.m`, what interpreter code
would look at the expression "foo.bar.Baz" and determine that it resolved to
that function?
> 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, and has for a while. For example, in Matlab,
you can just say `m = java.util.HashMap` instead of `m =
javaObject('java.util.HashMap')`. This syntax is convenient if you're doing
substantial work with Java objects inside Matlab code.
Cheers,
Andrew
--
Sent from: http://octave.1599824.n4.nabble.com/Octave-Maintainers-f1638794.html