octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Pluging hooks in the parser?


From: Michael Goffioul
Subject: Re: Pluging hooks in the parser?
Date: Wed, 13 Jun 2007 12:47:34 +0200

On 6/13/07, John W. Eaton <address@hidden> wrote:
In the example above, what is the type of "java"?  If it is your own
user-defined type, then can't you already do what you want from the
subsref method in that octave_value sub-type?

"java" has no type. It's even not an object known to octave.
"java.lang.String" is just a class name (as "java.lang.System"). This
is basically the problem.

I know it's possible to "emulate" this by defining a "java" object and using
the normal subsref mechanism, but not all java classes starts with "java",
only the standard classes. Basically, it could be anything (or nothing).
Moreover, if you want to also support "import" (like Matlab does), even
the emulation is not possible:

import java.lang.*;
s = String('my string');
System.out.println("hello");

Maybe it's still possible to emulate all this (although it might become very
tricky). But I thought that a more generic implementation could be based on
some parser hooks. So I just wanted to know whether this was imaginable.

Michael.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]