On Thursday, June 12, 2014 2:50:41 AM UTC+9, Michael Levine wrote:
>
>
> I guess that my underlying thought is that Groups is a *great* feature for
> Tup -- I use it extensively in my rules -- that dates to way before the Lua
> parser was written. Perhaps Lua might provide the possibility to replace
> this feature with an alternate construct. In other words, rather than
> duplicating Groups with the Lua parser, perhaps there is a more Lua-like
> way to do it.
>
>
I haven't used groups myself or had a chance to try them out, so I
apologize in advance if this is obviously unworkable.
My preferred interface would be something like this:
name = tup.group('name') -- Returns group reference
name += 'obj1.o' -- Name depends on this file
name = tup.group('name') -- Returns group reference
for index, obj in ipairs(name) do print(obj) done -- This file depends on
name group
-- This file depends on name group. App group depends on this file
tup.group('apps') += tup.frule{inputs = {'main.o'} .. name, command = 'gcc
-o %o %f', outputs = {'app'}}
I imagine you wouldn't be able to read and write a group in the same
tupfile. Files depending on groups would be re-executed if the structure
of the group changes. The group could be stored internally as a group ->*
tupfile ->* file hierarchy. Rules would as usual depend on the files
themselves, so I don't think that would need any change. Groups could be
integer indexed and provide a length implementation, but disallow
overwriting elements.
I think this would also handle things like:
tup.group('b') += tup.group('a')
tup.group('all sources') += tup.glob('*.c')
I'll try to help out where I can, I've been really busy with administrative
stuff the last couple months and will continue to be busy for another
couple months probably.
--
--
tup-users mailing list
email: [email protected]
unsubscribe: [email protected]
options: http://groups.google.com/group/tup-users?hl=en
---
You received this message because you are subscribed to the Google Groups
"tup-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.