Re: 'withfile' function implementation

2012-01-31 Thread David Boyce
First, I think there may be a bug. Did you intend that appending empty data would always append a newline, such that the file grows by one newline every time? It's consistent with the new documentation but not with what you wrote above ("If the file does exist and it's opened for append then the mo

Re: 'withfile' function implementation

2012-01-30 Thread Paul Smith
On Mon, 2012-01-30 at 21:33 -0500, David Boyce wrote: > On Mon, Jan 30, 2012 at 6:19 PM, Paul Smith wrote: > > Is there "something special" you would prefer beyond this? > > Well ... it's more of a thought than an actual request or preference, > but I'm suggesting that make might want to take pos

Re: 'withfile' function implementation

2012-01-30 Thread David Boyce
On Mon, Jan 30, 2012 at 6:19 PM, Paul Smith wrote: > Is there "something special" you would prefer beyond this? Well ... it's more of a thought than an actual request or preference, but I'm suggesting that make might want to take positive steps in your last case (empty text argument, append to ex

Re: 'withfile' function implementation

2012-01-30 Thread Paul Smith
On Mon, 2012-01-30 at 17:44 -0500, David Boyce wrote: > Thanks, this will make a lot of people happy. > > One nit: as mentioned earlier I think it would be good to document the > relationship of $(file ...) with timestamps. Assuming nothing special > is done (I haven't looked at the code) then wri

Re: 'withfile' function implementation

2012-01-30 Thread David Boyce
Thanks, this will make a lot of people happy. One nit: as mentioned earlier I think it would be good to document the relationship of $(file ...) with timestamps. Assuming nothing special is done (I haven't looked at the code) then writing a null string will not update the timestamp. I tried to mak

RE: 'withfile' function implementation

2012-01-29 Thread Paul Smith
On Mon, 2012-01-23 at 09:52 -0800, Lawrence Ibarria wrote: > I do like this suggestion, feels quite clean! I implemented the "write" side of this proposal and committed it to CVS, along with regression tests and documentation. The "read" side is slightly more work but I can do this one too if peo

RE: 'withfile' function implementation

2012-01-23 Thread Lawrence Ibarria
I do like this suggestion, feels quite clean! -- Lawrence > -Original Message- > From: Paul Smith [mailto:psm...@gnu.org] > Sent: Monday, January 16, 2012 5:15 AM > To: Lawrence Ibarria > Cc: bug-make@gnu.org; Tim Murphy (tnmur...@gmail.com) > Subject: Re: &

Re: 'withfile' function implementation

2012-01-16 Thread David Boyce
2012/1/16 Paul Smith : >     2. Unclear what to do about newlines.  The code doesn't add any but >        getting a newline into a make variable is tricky. Is it possible https://savannah.gnu.org/bugs/?35063 would help here? I think it's a simple, robust, helpful extension (but I would). > '>>' :

Re: 'withfile' function implementation

2012-01-16 Thread Paul Smith
On Mon, 2012-01-16 at 13:26 +, Tim Murphy wrote: > There might be some question about how the variable "$(FILE)" would > look if you tried to iterate over its contents. e.g. would one see an > iteration for each word and with "\n"s marking lines or is each line > an "atom" for want of a better

Re: 'withfile' function implementation

2012-01-16 Thread Tim Murphy
I think that looks ok. There might be some question about how the variable "$(FILE)" would look if you tried to iterate over its contents. e.g. would one see an iteration for each word and with "\n"s marking lines or is each line an "atom" for want of a better word. Regards, Tim 2012/1/16 Paul

Re: 'withfile' function implementation

2012-01-16 Thread Paul Smith
On Thu, 2011-12-15 at 15:13 -0800, Lawrence Ibarria wrote: > This is a rather simple path that implements a very simplified version > of what Tim suggested in his message of Sept 25th > (https://lists.gnu.org/archive/html/bug-make/2011-09/msg00044.html ). > > Paul, what do you think? I’d rather no

Re: 'withfile' function implementation

2011-12-16 Thread David Boyce
On Fri, Dec 16, 2011 at 7:41 AM, Tim Murphy wrote: > would probably be quite nice and they don't absolutely demand that one > use the C library mode flags (w,w+,a etc). This is one thing that > Paul didn't like from the previous suggestions. A bit of a sidetrack, but I don't agree with the logic

Re: 'withfile' function implementation

2011-12-16 Thread Paul Smith
On Fri, 2011-12-16 at 12:41 +, Tim Murphy wrote: > I looked at the implementation and it seems like a different name > would suit this function - e.g. "writefile". It basically writes text > from it's arguments out to a file. Thanks all; I'll take a look. --

Re: 'withfile' function implementation

2011-12-16 Thread Tim Murphy
Just a quick comment on this. I looked at the implementation and it seems like a different name would suit this function - e.g. "writefile". It basically writes text from it's arguments out to a file. The idea of a function called "withfile" seems hard to actually implement - I'm not sure how on