Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7074739
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T06:05:39+00:00 2026-05-28T06:05:39+00:00

In order to avoid namespace bloating, I use packages. For example, let Foo be

  • 0

In order to avoid namespace bloating, I use packages. For example, let Foo be a function in a package called FooPackage

function Foo()
   disp('Foo');
end

I want to use this function in another function called Bar.

function Bar()
    InFunc1();
    InFunc2();
    InFunc3();
end

this function calls sub-functions. The Naive way is to say explicitly the package name in each call

 function InFunc1()
    FooPackage.Foo();
end

function InFunc2()
   FooPackage.Foo();
end

function InFunc3()
   FooPackage.Foo();
end

Alternatively I can use an import in each and every function:

 function InFunc1()
    import FooPackage.*
    Foo();
end

function InFunc2()
    import FooPackage.*
    Foo();
end

function InFunc3()
    import FooPackage.*
    Foo();
end

Both of the ways are exhausting. The answer in here says that thes are the only ways.
Does anyone has a better suggestion?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T06:05:40+00:00Added an answer on May 28, 2026 at 6:05 am

    Maybe you could use a private directory. The functions in the private directory can be seen only by functions in its parent directory, and they can be called just by their names.

    It’s not a completely satisfying solution, but that can help.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to use the special variable .RECIPEPREFIX in order to avoid the
In order to fully use LinqToSql in an ASP.net 3.5 application, it is necessary
In order to avoid freezing of GUI, I wanted to run method connecting to
In order to avoid spamming, I would like to add a waiting time to
In order to avoid a huge hassle with ugly UI glitches from the popover's
I made a vector set in order to avoid thrashing the GC with iterator
I have created several WCF services. In order to avoid adding service references in
In order to help avoid unnecessary heap allocations of strings inside a class, I
in order to avoid an include circle, I have replaced an #include that was
I have added the following option in order to avoid having smaller multiple binary

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.