[% setvar title Better english names for -X %]

This file is part of the Perl 6 Archive

Note: these documents may be out of date. Do not use as reference!

To see what is currently happening visit http://www.perl6.org/


Better english names for -X


  Maintainer: Adam Turoff <ziggy@panix.com>
  Date: 24 Sep 2000
  Last Modified: 30 Sep 2000
  Mailing List: perl6-language@perl.org
  Number: 290
  Version: 3
  Status: Frozen


Many programmers who have not used Perl's -X (or sh's -X) file tests find them to be bizarre, arcane and confusing.

They deserve better 'use english;' names.


The first version of this RFC proposed removing -X entirely, since it was a throwback to Perl's roots in sh. That proposal was quite vigorously shot down. The discussion centered around creating good descriptive names around the -X tests.

While discussing -X, the idea came about to stack multiple tests into a single tests, e.g. mutate -r && -w && -x into -rwx $file (or something). See RFC 320 for details.


Tom Christiansen proposed this in his perl6storm message:

	=item perl6storm #0101

	Just like the "use english" pragma (the modern not-yet-written
	version of "use English" module), make something for legible

		is_readable(file) is really -r(file)

	note that these are hard to write now due to -s(FH)/2 style
	parsing bugs and prototype issues on handles vs paths.

Here is a list of possible 'use english;' names for -X:

    -r  freadable()
    -w  fwriteable()
    -x  fexecable()
    -o  fowned()

    -R  Freadable()
    -W  Fwriteable()
    -X  Fexecable()
    -O  Fowned()

    -e  fexists()
    -z  fzero()
    -s  fsize()

    -f  ffile()
    -d  fdir()
    -l  flink()
    -p  fpipe()
    -S  fsocket()
    -b  fblock()
    -c  fchar()
    -t  ftty()

    -u  fsetuid()
    -g  fsetgid()
    -k  fsticky()

    -T  ftext()
    -B  fbinary()

    -M  fage()
    -A  faccessed()
    -C  fchanged()


None. New symbolic names for -X are being added.


Add appropriate hooks into 'use english;', and possibly export them as 'use english "filetests";'


RFC 320: