Larry Wall wrote:
On Fri, Nov 26, 2004 at 07:32:58AM +0300, Alexey Trofimenko wrote:
: ah, I forget, how could I do qx'echo $VAR' in Perl6? something like : qx:noparse 'echo $VAR' ?


I think we need two more adverbs that add the special features of qx and qw,
so that you could write that:

    q:x/echo $VAR/

where ordinary qx/$cmd/ is short for

qq:x/$cmd/

I think I'd like that much better if we consider execution and word-splitting to be the primary operations, and interpolation and noninterpolation the adverbial modifiers then the other way around, making that qx:q/echo $VAR/ or qx:qq/$cmd/. OTOH, I expect backticks to be rare enough that I wouldn't mind writing


    use Spawn 'spawn';
    spawn :capture :wait ($cmd);
    spawn :capture :wait ('echo $VAR');

Much more clear, saves ` for other things, and allows for easy specification of the many adverbs of spawn (weather it returns the return status, the PID/FH set object, or output, if it waits right there, or runs in the background (and makes the return value lazy), if it replaces the current process (exec)...

Likewise a qw/a b/ is short for

q:w/a b/
      qw:q/a b/
      $fromvar = 'foo bar';
      qw:qq/a "something with spaces" b $fromvar/
      # ?? -- slightly OT, but is that a, '"something', with, 'spaces"',
      # b, 'foo bar', or... um, what?  Is qw smart enough to allow
      # internal quotes?  Does splitting take place before or after
      # interpolation if it's interpolating?

: I notice that in Perl6 thoose funny « and » could be much more common : than other paired brackets. And some people likes how they look, but : nobody likes fact that there's no (and won't!) be a consistent way to type : them in different applications, wether it's hard or easy.
: : But to swap «» with [] or {} could be real shock for major part of : people..
: We also have another ascii pair, < and > . maybe they could be better than : « and » ?:) i'm not that farseeing, but isn't problem of distinguishing < : as a bracket and < as an comparison operator no harder than distinguishing : << as bracket and as part of heredoc?..


It would get very confusing visually, even if the computer could sort it out:
We could force whitespace disambugation, possibly -- require that <...> bracketing have whitespace on the outside and none on the inside. But that's ugly.

But there are some things that would be completely ambiguous:

%hash<foo><bar>
Bracketing operator.

%hash<foo><baz()
Very long bracket operator, which quite likely has a syntax error directly after it.

: or maybe even we could see consistant to go after +<< +>> and alike, and : make old < and > written as +< and +> (and then lt and gt suddenly could : become ~< and ~> :)

I think people would rise up and slay us if we did that.  We're already
getting sufficiently risen up and slain over Perl 6.
Could be worse.  They could rise from the grave and eat us!

Well, yes, but sometimes the weights change over time, so it doesn't
hurt (much) to reevaluate occasionally.  But in this case, I think I
still prefer to attach the "exotic" characters to the exotic behaviors,
and leave the angles with their customary uses.
...of which they have plenty already. Backtick has exactly one, and not an often-used one at that... I'm fine with axing it. Of course, there are a lot more people in the world then just me.

If you're a White Russian I suppose the yolk is on me.
In Russia, the yokes throw you!

        -=- James Mastros,
            theorbtwo

Reply via email to