octave-bug-tracker
[Top][All Lists]
Advanced

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

[Octave-bug-tracker] [bug #55667] Conflict between package namespace and


From: John W. Eaton
Subject: [Octave-bug-tracker] [bug #55667] Conflict between package namespace and function name
Date: Fri, 15 Feb 2019 12:56:55 -0500 (EST)
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Firefox/60.0

Follow-up Comment #12, bug #55667 (project octave):

Mike: In comment #6, you wrote:

If there were a way to somehow register a proper classdef +py namespace with a
dynamic name resolution hook, I could do that.

Maybe that's what we should do instead of relying on additional indexing of
the results of function calls for this purpose.  Then we could decide to
deprecate that feature (or not) and it wouldn't affect your code.

I think the implementation would be fairly straightforward.  If a package
(+pkg Matlab-style package) had this feature enabled, any name prefixed with
"pkg." that is not explicitly part of the package results in a call to a
special dispatch function.  I think the code that needs to change to provide
this feature is the bit in cdef_package::cdef_package_rep::meta_subsref that
currently errors if the "nm" part of pkg.nm is undefined.

So, how should we go about registering this special catch-all function?

The simplest thing seems to me to just recognize a special file inside a +pkg
directory.  That way you could just define a __CATCH_ALL__.m (or .oct or .mex)
file function there that would do the job.   I'm not sure I like the name
__CATCH_ALL__, but something like that wouldn't even require any special
treatment in the parser/lexer.

    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?55667>

_______________________________________________
  Message sent via Savannah
  https://savannah.gnu.org/




reply via email to

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