On Tuesday, June 10, 2014 11:43:22 AM UTC-4, [email protected] wrote: > > > I think the issue is with these if statements: > > if (#objects) then > > When there are no objects, #objects is 0, and if(0) is true in Lua (unlike > in C, where it would be false). So you probably want: > > if (#objects != 0) > > or: > > if (next(objects) != nil) > > My understanding is the latter is a little more efficient (though I > haven't confirmed it :), but that probably only matters if you have > extremely large tables. > > -Mike >
Thanks Mike -- I got similar advice from Rendaw in a PM, and I'm pleased to say that this worked just great. The problem now is one that Rendaw mentioned in his PM to me earlier-- the legacy parser had a concept of groups, which I was using to collect all of my outputs together, for use in rules. I have made -- what is clearly -- an erroneous assumptions that the variables declared in my Tupfiles are global variables -- i.e. if I have a table shared_libs which I append in each directory, then I'd expect that the shared_libs table would be made available for use (containing all of the libs) in my main Tupfile.lua. I can work around this by changing my rules to output these files into a known path and then find them with a glob rule, but I don't like that approach at all. Is there a way to have a global variable which is shared with all of the Tupfile instances (similar to legacy groups??) Is there any other way to achieve this? Thanks, Shmuel -- -- 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.
