On 4/13/07, brian d foy <[EMAIL PROTECTED]> wrote:
Which then makes me think I'd want to do something a bit wacky to see
if the modtime is greater than 5:


   "doc" ~~ M => any( 5 ..* );

Or even "doc" ~~ M => (5..*).  Then again, ("doc" ~~ :M) ~~ 5..* does
the same thing, without having to have pattern matching in two
different places.

It seems like the pairness of the pair is pretty useless in this case;
i.e. it's a hack to fudge Lisp- or Ruby-style symbols.  But symbols
would be a hack in this case, too.

These things are methods, and I'm not sure why we've crammed them into
smart match. Things like :M have nothing to do with matching. What
would it mean if smart match returned false?  "This file has not been
modified ever"?  :e has a bit more merit for a smart match, but the
operation has little to do with the concept of a string or the pair e
=> 1.

I'm inclined to say that the best solution for filetests is to throw
out our dwimmery altogether.  Back in Perl 4 days, using "stat"
explicitly was awkward, because you had to use it as a list and
memorize the positions of all the returns.  -s $file beats the heck
out of (stat $file)[7], for sure.  It also had the benefit that shell
people would instantly recognize what's going on.

However, now we have stat($file).size.  With that, every programmer
will recognize what's going on, not just people with shell background.
And I don't think even people with a shell background will know what
($file ~~ :s) means (their guess could be right, but they'd have to
look it up to confirm, and they would never think to *write* such a
thing).

I can never remember whether mtime is -m or -M anyway...

Let's get rid of all the filetest magic, in favor of using stat explicitly.

Luke

Reply via email to