There are a handful of ways that you can approach the issues you're trying to solve:
1. Functions can contain other functions: file:some_function.fish ----------------------- function some_function --description "foo bar baz" function helper_function # do something end set somevar (helper_function "arg") # do something end ----------------------- 2. autoloaded functions can call other autoloaded functions (double underscore is typically used to denote "private" functions): file:__helper_function.fish ----------------------- function __helper_function --description "helper function" # do something end ----------------------- file:some_function1.fish ----------------------- function some_function1 --description "foo bar baz" set somevar (__helper_function "arg") # do something end ----------------------- file:some_function2.fish ----------------------- function some_function2 --description "quux muux bazinga" set somevar (__helper_function "arg") # do something end ----------------------- --George On 11/11/2013 11:03 AM, Leira Hua wrote: > According to the document: > > "It is very important that function definition files only contain the > definition for the specified function and nothing else. Otherwise, it is > possible that autoloading a function files requires that the function already > be loaded, which creates a circular dependency." > > So an autoloading function file can only contain the definition of the > specified function and nothing else. I'm not fully understand the reason in > the > document. But what if this specified function references to some other tool > function, if I cannot put the tool function inside the same file, where should > I put it? In the .load file? If I don't want to expose this tool function, I > don't think it's a good idea to put it in .load file. > > Another question, similar to this one, if 2 autoloading function both calls to > one tool function, and I want to expose this tool function too, seems the only > way to do that, is to put this tool function into config.fish, which lost the > benefits of autoloading function. Is it possible to make this tool function an > autoloading function, and make other autoloading functions depend on it? > > Thanks, > > Leira Hua > > > ------------------------------------------------------------------------------ > November Webinars for C, C++, Fortran Developers > Accelerate application performance with scalable programming models. Explore > techniques for threading, error checking, porting, and tuning. Get the most > from the latest Intel processors and coprocessors. See abstracts and register > http://pubads.g.doubleclick.net/gampad/clk?id=60136231&iu=/4140/ostg.clktrk > _______________________________________________ > Fish-users mailing list > Fish-users@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/fish-users > ------------------------------------------------------------------------------ November Webinars for C, C++, Fortran Developers Accelerate application performance with scalable programming models. Explore techniques for threading, error checking, porting, and tuning. Get the most from the latest Intel processors and coprocessors. See abstracts and register http://pubads.g.doubleclick.net/gampad/clk?id=60136231&iu=/4140/ostg.clktrk _______________________________________________ Fish-users mailing list Fish-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/fish-users