Clock.currTime

2014-11-20 Thread Kent via Digitalmars-d-learn
I am reading the book 《D Cookbook》 In Page 36,this code can't be complied: auto filtered = filter!((a) = Clock.currTime() - a.timeLastModified 14.days)(sorted); sorted's type is DirEntry[]. The errors : Error 1 Error:

Re: Clock.currTime

2014-11-20 Thread Kent via Digitalmars-d-learn
On Thursday, 20 November 2014 at 15:31:28 UTC, bearophile wrote: Kent: I am reading the book 《D Cookbook》 In Page 36,this code can't be complied: auto filtered = filter!((a) = Clock.currTime() - a.timeLastModified 14.days)(sorted); Perhaps: mySorted.filter!(a = Clock.currTime -

Re: Clock.currTime

2014-11-20 Thread Kent via Digitalmars-d-learn
On Thursday, 20 November 2014 at 15:38:10 UTC, Adam D. Ruppe wrote: On Thursday, 20 November 2014 at 15:33:37 UTC, Kent wrote: mySorted.filter!(a = Clock.currTime - a.timeLastModified 14.days); Thank you for your reply. But it still doesn't work. Are you sure you saw the important

Re: Clock.currTime

2014-11-20 Thread Kent via Digitalmars-d-learn
On Thursday, 20 November 2014 at 15:56:34 UTC, Adam D. Ruppe wrote: On Thursday, 20 November 2014 at 15:45:55 UTC, Kent wrote: foreach(file; filtered.take!(10)) Oh, there shouldn't be a ! there either. Should be take(10), not take!(10). That's my mistake too...