[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Another package manager issue

From: John W. Eaton
Subject: Another package manager issue
Date: Mon, 28 Aug 2006 22:19:47 -0400

On 28-Aug-2006, David Bateman wrote:

| Ok, I have another issue with the package manager. Firstly in trying to
| treat both PKG_ADD and PKG_DEL I introduced a error. However the more
| interesting issue is how addpath work in pkg.m. Both addpath and pkg are
| marked as commands, but the addpath in pkg are called in sub-functions
| of pkg, Therefore we aren't at the top-level when addpath is called. If
| the PKG_ADD file in a package includes a "mark_as_command" line then
| this can't be executed.

We choose to make this an error to prevent confusion about things like

  function foo ()
    mark_as_command ("cmd");
    cmd args                     ## parse error

There will be an parse error because cmd is not marked as a command
until the function is evaluated.

As far as I can see, there is no other reason to require that
mark_as_command only work at the top level.

| 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.

| 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?


reply via email to

[Prev in Thread] Current Thread [Next in Thread]