[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Another package manager issue
From: |
John W. Eaton |
Subject: |
Re: Another package manager issue |
Date: |
Tue, 29 Aug 2006 09:56:59 -0400 |
On 29-Aug-2006, David Bateman wrote:
| John W. Eaton wrote:
| > On 28-Aug-2006, David Bateman wrote:
| >
| > | I see two solutions. Mark all of the
| > | sub-functions that call addpath in pkg.m as commands,
| >
| > I don't understand how this helps.
| >
| Think about addpath which is a function marked as a command. When it
| adds a path with a PKG_ADD file in it is is evaluated correctly. I
| haven't looked at the code, but I suspect that if a function marked as a
| command is run, the level is not incremented. Therefore if all of the
| functions up to and including the function with the addpath are marked
| as commands, then addpath will appear at the top-level.
It's not that the addpath function is marked as a command, it is that
it is a built-in function. Octave considers itself at the top level
if curr_sym_tab == top_level_sym_tab (see at_top_level in
variables.cc). We don't reset curr_sym_tab when a built-in function
executes because a built-in function has no local symbol table.
Should built-in functions execute so that at_top_level is true? If
not, we could always set curr_sym_tab to 0 while built-in functions
execute.
| > | or use evalin to
| > | run the addpath command in the top-level (which is what the attached
| > | patch does). Can this be applied
| >
| > This would also work, but would it be better to eliminate the
| > requirement that mark_as_command may only be called at the top level?
| > Or would the potential for confusion be too great?#
| >
| Your call, though I can see that the above is a nasty syntax error whose
| reason is not clear. I suppose that a warning might be added for when
| functions are marked as commands within other functions, and I can turn
| this warning off in the case of the package manager, so do it however
| you want.
|
| Note though that the change in the patch I sent for extract_pkgadddel
| sub-function is necessary as there is a variable name clash in this
| function that I accidentally introduced..
For now I think it is best to use evalin. Will you please check in
your patch?
Thanks,
jwe