tech-toolchain archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: (b)make: selecting every other element from a list



On Thu, Sep 03, 2015 at 06:37:32PM +0200, Edgar Fu? wrote:
> Thanks.
> 
> > l2:=
> Any particular reason for using := and not = in this place?
> 
> > .for _i _j in $(l)
> > l2+=$(_i)
> > .endfor
>
> Oops. I was sure this didn't work in older (NetBSD 4.0.1) versions of (b)make, 
> but I just checked it does work. I (wrongly) remembered this ending up in l2 
> being ${_i} ${_i} ${_i} after the loop, and subsequent expansion of ${l2} 
> repeating the last value ${_i}?was set to. Strange.

It used to be difficult to get the required delayed expansion of the loop
variables.
I fixed it a while ago by some magic transformation I can't quite remember.


	David

-- 
David Laight: david%l8s.co.uk@localhost


Home | Main Index | Thread Index | Old Index