On 11/11/2014 06:00 PM, Spooge wrote:
On 11/11/2014 04:54 PM, Freddie Chopin wrote:
Maybe it's my personal preference, but in my project I use tup.rule()
exclusively, and when working with examples from the website I wasted
some time trying to make tup.definerule() do the right thing (;
tup.rule() is a bit more powerful - it properly expands variables and
tup %-flags, it's also a bit more compact. I don't even use
tup.foreach_rule(), as a lua loop works better.
That's a good point. When I wrote the documentation, I thought that
using the lower-level tup.definerule would be easier to understand and
might make the connection to the original parser clearer, but maybe
that's sufficiently explained through the Lua reference.
Maybe convert the existing examples to tup.rule and remove the extra
examples at the bottom?
I'm not sure what was the problem when I first tried lua, but I think it
had something to do with the way variables were expanded... I don't have
time to test that right now, but there was some problem when you tried
to concatenate string with a variable that did not exist. In tup.rule()
you just put the "old style" variables in the string directly with
$(name), and for me (personal preference) that's easier (and shorter)
than concatenations. Also you state the input and/or output only once,
and use %-flags in the command string.
I guess that the bottom part - where you show that most of the *rule*()
functions are related - should definitely stay (;
For the record, I use tup.definerule... it's wrapped in other
functions and I felt the verbosity savings weren't worth the increased
complexity in my case.
As I already wrote - probably personal preference (; I like
"beginning $(name) end"
more than
"beginning " .. name .. " end"
Maybe there could be docs with examples for specific use cases? Or a
"getting started" page that has a more concrete example, with
everything used together (CFLAGS, tup.rule).
Either will be very nice (;
I took a quick look at your Tupfiles and they seem really clean and
well organized. I'm a bit hesitant to write a best-practices style
document myself, since even with my own Tupfiles I'm not sure they'll
support the abstraction I need as I use them in more projects.
Yes, indeed... To compile (; "best practices" we need more users sharing
their experience, problems and solutions...
Having some sort of example "compile", "link", etc. functions would
probably help to illustrate the advantages of Lua. I'm not really
sure how that could be worked into the current documentation.
These functions are really strong point of lua, even though in my
project these are almost 1:1 equivalents of "bang macros" of tup parser.
BTW - here's another thing to improve in the docs -
https://github.com/gittup/tup/issues/207
Thanks for pointing that out - I actually didn't realize that was
merged myself, if it is what I think it is. I'll definitely take a look
You probably think about run-scripts, but the issue is about
getrelativedir() function (; Now when you point run-script support in
lua then it would be another thing to add (;
Regards,
FCh
--
--
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.