Re: initial stab at :import

Adriaan de Groot <adridg-FlD2LfDziEhmR6Xm/[email protected]>
Newsgroups gmane.comp.tools.aap.devel
Message-ID <[email protected]>
On Tuesday 16 September 2003 11:13, you wrote:
> When an action is invoked the scopes are setup to search for variables
> in:
> - the local scope of the action build commands.
> - the call stack, scopes from where the action was invoked (with :do or
>
> - the recipe where the action was defined (the module scope)
> - the toplevel scope
>
> This is the same as what is used for actions defined by the user, except
> that the tree of parent recipes is not searched.  The difference with

Part of the "problem" here is about "disappearing" scopes. Consider, for 
instance, a child recipe defining an action for filetype d, where the action 
uses a particular variable defined in that child recipe. After the child is 
done, its variables are too, but the action remains defined in the global 
scope. If the action is invoked later, it fails, because the variables it 
uses aren't defined anymore.

This isn't meant to state that the variables _should_ be kept around, but 
certainly it complicates things. In particular it means I can't treat 
imported recipes just like children (which is what I've been doing).

I could define a new scope _module, and put all imported variables in there. 
That would force some level of cooperation between modules, and I'd have to 
figure out how to force the currently-read recipe to do assignments in that 
scope. Something to fill a sunday evening ...

-- 
pub  1024D/FEA2A3FE 2002-06-18 Adriaan de Groot <[email protected]>
     Key fingerprint = 934E 31AA 80A7 723F 54F9  50ED 76AC EE01 FEA2 A3FE



-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.