reverse of autoload

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

reverse of autoload

c.-2
Hi,

I thought that that all functions belonging to a package would become  
undefined when the package is unloaded,
but it seems that this is not completely true, for example:

 >> pkg load combinatorics
 >> which partcnt
partcnt is the dynamically-linked function from the file
/Users/carlo/octave/combinatorics-1.0.7/i386-apple-darwin8.9.1-api-v32/
partint.oct
 >> pkg unload combinatorics
 >> partcnt(6)
ans =  11
 >> which partcnt
partcnt is the dynamically-linked function from the file
/Users/carlo/octave/combinatorics-1.0.7/i386-apple-darwin8.9.1-api-v32/
partint.oct
 >> clear partcnt
 >> which partcnt
partcnt is the dynamically-linked function from the file
/Users/carlo/octave/combinatorics-1.0.7/i386-apple-darwin8.9.1-api-v32/
partint.oct
 >> partcnt(6)
ans =  11

This is because "partcnt" is mapped to the DLD file "partint.oct" by  
an "autoload" command in a "PKG_ADD" file.
In the case of the particular exmple I have chosen this is not a big  
deal, but this behaviour could be very annoying in the case of  
packages that overwrite some core functions..

Is there a way of removing an item from the autoload map?

Thanks,
Carlo
_______________________________________________
Help-octave mailing list
[hidden email]
https://www-old.cae.wisc.edu/mailman/listinfo/help-octave
Reply | Threaded
Open this post in threaded view
|

Re: reverse of autoload

bpabbott
Administrator

On Tuesday, March 31, 2009, at 03:43PM, "Carlo de Falco" <[hidden email]> wrote:

>Hi,
>
>I thought that that all functions belonging to a package would become  
>undefined when the package is unloaded,
>but it seems that this is not completely true, for example:
>
> >> pkg load combinatorics
> >> which partcnt
>partcnt is the dynamically-linked function from the file
>/Users/carlo/octave/combinatorics-1.0.7/i386-apple-darwin8.9.1-api-v32/
>partint.oct
> >> pkg unload combinatorics
> >> partcnt(6)
>ans =  11
> >> which partcnt
>partcnt is the dynamically-linked function from the file
>/Users/carlo/octave/combinatorics-1.0.7/i386-apple-darwin8.9.1-api-v32/
>partint.oct
> >> clear partcnt
> >> which partcnt
>partcnt is the dynamically-linked function from the file
>/Users/carlo/octave/combinatorics-1.0.7/i386-apple-darwin8.9.1-api-v32/
>partint.oct
> >> partcnt(6)
>ans =  11
>
>This is because "partcnt" is mapped to the DLD file "partint.oct" by  
>an "autoload" command in a "PKG_ADD" file.
>In the case of the particular exmple I have chosen this is not a big  
>deal, but this behaviour could be very annoying in the case of  
>packages that overwrite some core functions..
>
>Is there a way of removing an item from the autoload map?
>
>Thanks,
>Carlo

Prior to loading the package, was the directory, /Users/carlo/octave/combinatorics-1.0.7/i386-apple-darwin8.9.1-api-v32/ , already in your path?

Is it in your path after "pkg unload combinatorics"?

Ben

_______________________________________________
Help-octave mailing list
[hidden email]
https://www-old.cae.wisc.edu/mailman/listinfo/help-octave
Reply | Threaded
Open this post in threaded view
|

Re: reverse of autoload

c.-2

On 31 Mar 2009, at 21:51, Ben Abbott wrote:

> Prior to loading the package, was the directory, /Users/carlo/octave/
> combinatorics-1.0.7/i386-apple-darwin8.9.1-api-v32/ , already in  
> your path?

no.

> Is it in your path after "pkg unload combinatorics"?

no, but it makes no difference as the autoload map uses absolute paths:

 >> file_in_path (path, "partint.oct")
ans = []
 >> {autoload().file}{78}
ans = /Users/carlo/octave/combinatorics-1.0.7/i386-apple-darwin8.9.1-
api-v32/partint.oct
 >> {autoload().function}{78}
ans = partcnt
 >> which partcnt
partcnt is the dynamically-linked function from the file
/Users/carlo/octave/combinatorics-1.0.7/i386-apple-darwin8.9.1-api-v32/
partint.oct


> Ben

Thanks,
c.
_______________________________________________
Help-octave mailing list
[hidden email]
https://www-old.cae.wisc.edu/mailman/listinfo/help-octave
Reply | Threaded
Open this post in threaded view
|

Re: reverse of autoload

bpabbott
Administrator

On Tuesday, March 31, 2009, at 03:59PM, "Carlo de Falco" <[hidden email]> wrote:

>
>On 31 Mar 2009, at 21:51, Ben Abbott wrote:
>
>> Prior to loading the package, was the directory, /Users/carlo/octave/
>> combinatorics-1.0.7/i386-apple-darwin8.9.1-api-v32/ , already in  
>> your path?
>
>no.
>
>> Is it in your path after "pkg unload combinatorics"?
>
>no, but it makes no difference as the autoload map uses absolute paths:
>
> >> file_in_path (path, "partint.oct")
>ans = []
> >> {autoload().file}{78}
>ans = /Users/carlo/octave/combinatorics-1.0.7/i386-apple-darwin8.9.1-
>api-v32/partint.oct
> >> {autoload().function}{78}
>ans = partcnt
> >> which partcnt
>partcnt is the dynamically-linked function from the file
>/Users/carlo/octave/combinatorics-1.0.7/i386-apple-darwin8.9.1-api-v32/
>partint.oct
>
>
>> Ben
>
>Thanks,
>c.
>

I should have also asked what version of Octave are you running.

I don' t have the combinatorics pkg on my Mac, but don't see the problem with the image package. I'm running a recent copy of the developer's sources.

Ben


_______________________________________________
Help-octave mailing list
[hidden email]
https://www-old.cae.wisc.edu/mailman/listinfo/help-octave
Reply | Threaded
Open this post in threaded view
|

Re: reverse of autoload

c.-2

On 31 Mar 2009, at 23:24, Ben Abbott wrote:

>
> I should have also asked what version of Octave are you running.
I'm using the 3.0.3 OSX binary

> I don' t have the combinatorics pkg on my Mac, but don't see the  
> problem with the image package. I'm running a recent copy of the  
> developer's sources.

There is no "autoload" command in the image package.
Other packages affected are for example "communications" and "odepakg".

But actually I think this is not an issue but a "feature" (or rather a  
missing feature),
the autoload command works exactly as documented, simply I am not  
aware of any command avilable
in the interpreter to undo the effect of a call to autoload (compare  
for example with dispatch and builtin).

> Ben

c.
_______________________________________________
Help-octave mailing list
[hidden email]
https://www-old.cae.wisc.edu/mailman/listinfo/help-octave