This whole thread seems oriented around two points:

1. Strings should not carry the burden of umpty-ump filesystem checking methods.

2. It should be possible to specify a filesystem entity using something nearly indistinguishable from standard string syntax.

I agree with the first, but the relentless pursuit of the second seems to have gone beyond the point of useful speculation.

What's wrong with

   File('C:\Windows')

or Path() or Dir() or SpecialDevice()?

Not to get all Cozens-y or anything, but chasing after ways to jam some cute string-like overloading into the syntax so that we can pull out the other overloading (which at least had the virtue of simplicity) seems pointless.

The File::* functionality is probably going to be one of the very early p6 modules, and it is probably going to be in core. If that's true, why not allocate some really short names, ideally with 0 colons in them, and use them to spell out what's being done?

Neither q:io:qq:{.} nor qq:io{.} really stand out at excellent ways to say "this is a path", or directory, or file, or whatever. If it's plug-in-able, I'd take qq:file{.} or qq:dir{.} or qq:path{.}, but I'd rather see C< File q{.} >.


=Austin



Timothy S. Nelson wrote:
On Sat, 15 Aug 2009, Timothy S. Nelson wrote:

Considering, though, that we're talking about a magic perl quoting syntax, we could offer people the option of the following two:

q:io{C:\Windows} # Does what you want
q:io:qq:{C:\\Windows} # Does the same thing

    Wouldn't that cover the bases pretty well?

    My bad -- try these:

    $file = "foo"

    Q:io{C:\Windows\$file} # Results in "C:\Windows\$file"
    q:io{C:\\Windows\\$file} # Results in the same thing
    qq:io{C:\\Windows\\$file} # Results in "C:\Windows\foo"

    HTH,


---------------------------------------------------------------------
| Name: Tim Nelson                 | Because the Creator is,        |
| E-mail: wayl...@wayland.id.au    | I am                           |
---------------------------------------------------------------------

----BEGIN GEEK CODE BLOCK----
Version 3.12
GCS d+++ s+: a- C++$ U+++$ P+++$ L+++ E- W+ N+ w--- V- PE(+) Y+>++ PGP->+++ R(+) !tv b++ DI++++ D G+ e++>++++ h! y-
-----END GEEK CODE BLOCK-----



Reply via email to