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

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

[Octave-bug-tracker] [bug #63023] Private function not available in PKG_


From: Maged Rifaat
Subject: [Octave-bug-tracker] [bug #63023] Private function not available in PKG_ADD context
Date: Tue, 6 Sep 2022 15:34:32 -0400 (EDT)

URL:
  <https://savannah.gnu.org/bugs/?63023>

                 Summary: Private function not available in PKG_ADD context
                 Project: GNU Octave
               Submitter: magedrifaat
               Submitted: Tue 06 Sep 2022 07:34:31 PM UTC
                Category: Octave Function
                Severity: 3 - Normal
                Priority: 5 - Normal
              Item Group: Unexpected Error or Warning
                  Status: None
             Assigned to: None
         Originator Name: 
        Originator Email: 
             Open/Closed: Open
                 Release: 7.2.0
         Discussion Lock: Any
        Operating System: Any


    _______________________________________________________

Follow-up Comments:


-------------------------------------------------------
Date: Tue 06 Sep 2022 07:34:31 PM UTC By: Maged Rifaat <magedrifaat>
I am not sure if this is a bug or the intended behavior.

Trying to use a private function handle in a PKG_ADD command (or a PKG_ADD
script) doesn't work (the function appears to be undefined).

I understand that per the documentation
<https://docs.octave.org/v7.2.0/Private-Functions.html>:

Then if the path to func1 is <directory>/func1.m, and if func2 is found in the
directory <directory>/private/func2.m, then func2 is only available for use of
the functions, like func1, that are found in <directory>. 


But apparently PKG_ADD commands in the function file func1 don't have the same
access as func1 itself so it can't access func2.

I want to also explain my use-case to further explain why I find this
inconvenient. In scripts/image/imformats.m line 67
<https://hg.octave.org/octave/file/tip/scripts/image/imformats.m#l67> it is
explained that the function handlers for the different image formats can be
modified with a call to imformats with "update" as a first parameter and a
struct holding the function handlers as a second parameter. It is further
encouraged in the next paragraph to use PKG_ADD for this task.

The problem is if I try to use PKG_ADD to set the function handlers to private
octave functions, the user won't be able to grab these handlers and use them
(but surprisingly the image functions are able to?), so a function handle like
`isa` will be completely useless because this is the only way it can be used
(i.e. the user have to get its handle to use it).







    _______________________________________________________

Reply to this item at:

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

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




reply via email to

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