Hmm, you could try (in pseudo-code):

str = load("my-extension.jl")
ex = parse(str)
eval(ApproxFun, ex)

That should evaluate all of the contents of my-extension.jl in the scope
of the module ApproxFun, so no need for imports or fully qualifying.
However, I don't know whether this is a good idea (or whether it even
works).

On Mon, 2015-09-07 at 08:33, Sheehan Olver <[email protected]> wrote:
>       OK that’s what I’m doing now.  
>
>        Though both are not so nice when the second module is an “extension” 
> of the first module, and therefore knows the inner workings and wants to 
> use/override many non-exported functions.  
>
>
>> On 7 Sep 2015, at 4:25 pm, Mauro <[email protected]> wrote:
>> 
>> importall only works with exported bindings.  It is generally frowned
>> upon because it makes it impossible to tell when adding/overwriting
>> methods and can lead to breakages when the imported module exports new
>> functions.
>> 
>>  import ApproxFun:  method1, method2
>> 
>> is Julian.  Equally Julian is instead fully qualifying it:
>> 
>>  ApproxFun.method1() = 4
>> 
>> Unless you're adding a ton of methods to a function, I prefer the second
>> style as it makes things clearer, IMO.
>> 
>> On Mon, 2015-09-07 at 00:13, Sheehan Olver <[email protected]> wrote:
>>> I'm trying to write a package that extends another package (ApproxFun), 
>>> which needs to use and override many methods/functions that aren't 
>>> exported.  Right now the solution is to write  a hundred "import ApproxFun: 
>>> method1, method2, ...".  
>>> 
>>>  Is there a standard "Julian" way of doing this?     importall didn't seem 
>>> to help.  
>> 

Reply via email to