On Apr 12, 2007, at 14:52 , brian d foy wrote:

At the moment the file test operators that I expect to return true or
false do, but the true is the filename. I expected a boolean, for no
other reason than Perl 6 has them so it might as well use them.

This is documented somewhere already. Pugs does not implement the spec as documented, though.

File tests are supposed to return something which:
- behaves as a Bool
- stringifies as a filename
- numifies as a file size or as a time, if appropriate
- propagates a stat object (obviating perl5's magic _)

Current Pugs only does the first three, sort of: the size and time operators return numeric, the others string, all behave appropriately if used as booleans. This means you mostly get the expected results for chained tests, at the price of every operator doing its own stat().

My impression is that junction types aren't really "there" yet, so this is the best that can currently be done.

--
brandon s. allbery [solaris,freebsd,perl,pugs,haskell] [EMAIL PROTECTED] system administrator [openafs,heimdal,too many hats] [EMAIL PROTECTED] electrical and computer engineering, carnegie mellon university KF8NH


Reply via email to