in reply to Thoughts on Exegesis 7

Now, I'm not so certain about the usefulness of :some_option[1, 2, 3] or the almost impenetrable :some_option«Some Text» (How on earth are you supposed to make those characters in vi, anyways?!?
If you don't like vim's ^K<< approach, Perl 6 will support ASCII lookalikes for anything non-ASCII. Though really, we're intentionally restricting ourselves to Latin-1 characters for builtins, so it shouldn't be that hard to get used to. Anyway, you can always write :some_option<<Some Text>> if you're an ASCII supremacist.
When was this decided, and by who?)
The idea of variable option brackets first occurred to me on Feb 16, and Damian extended it to include the qw-ish «» quotes. I decided on it very shortly before E7 was sent off to O'Reilly, because Damian was hankering to use them. As you may have noticed...
I know I'll like them after the first few months, but I'm just not seeing it right now ...
That's my job in a nutshell: to foresee what people will like after their initial period of disgust... :-)

Part of what causes the initial distress is that one doesn't know how the new feature fits in as a whole. It's certain that :some_option«Some Text» would not be in there if there wasn't already a meaning for «Some Text» by itself. And by itself, even that wouldn't be enough to justify the new :some_option syntax. However, it's also going to let us toss out the special exception for autoquoting hash subscripts that frequently confuses Perl 5 programmers.

In Perl 6, %hash{shift} will always be a call to the shift function, and if you want a constant string as a subscript, you can use, guess what, %hash«shift». (As long as your constant string doesn't contain whitespace, of course.) Plus it generalizes to a slice of constant strings, which Perl 5 can't do at all without a bazillion quotes. So we fix a special case, introduce a pretty syntax for qw//, and get constant slices for free, in addition to omitting the parens from :some_option(«Some Text»), along with the other bracketing composers.

And, over the long term, it will turn out to be much more readable, I think.

Edited by theorbtwo: Fixed HTML mis-nesting.

Replies are listed 'Best First'.
Re: Re: Thoughts on Exegesis 7
by dragonchild (Archbishop) on Feb 29, 2004 at 00:46 UTC
    Ok. So, how does the Perl6 compiler distinguish << and >> between their bitshift and quoting modes?

    ------
    We are the carpenters and bricklayers of the Information Age.

    Please remember that I'm crufty and crochety. All opinions are purely mine and all code is untested, unless otherwise specified.

      The bitops have all been re-Huffman-coded because they're not as frequently used as the things we'll be using their operators for. Plus we've resolved the ambiguites by regularizing all the bitops with a prefix that indicates whether you mean a numeric bitop, and string bitop, or a boolean bitop. So << has been respelled +< and >> is now +>.

      As for here docs, those now require quotes, so the only amibguity is if you happen to want to use something like <<"stuff">>, in which case you'd have to say << "stuff" >> instead.

      Much work has gone into re-engineering the operators for Perl 6. You might be interested in Synopsis 3, which is coming out real soon, by Luke Palmer. (In fact, it would have been out already except that Damian's E7 nudged it aside.) Luke's been doing us the favor of going back and writing Synopses for those earlier Apocalypses that didn't ever have one. And the intent is to leave the Apocalypses "as is" as historical documents full of my old speculations and goofs, while we keep the Synopses up-to-date with my latest speculations and goofs.

Re: Re: Thoughts on Exegesis 7
by BUU (Prior) on Feb 29, 2004 at 01:53 UTC
    Wait a second, I thought (from reading those nifty perl mailing list summaries on perl.com) that the «Some Text» operators would be used as nifty list operators (of some sort). Did this change or is this just another abuse of those funky characters?
      Hasn't changed. That's just another abuse of those characters. The qw// thingies are spelled like French quotes, «Some Text», while the hyper operators are spelled like German quotes, »+« and such. In both cases the underlying visual and psychological metaphor is "there's something potentially plural on the big side of these double angles." I say "potentially", since «SomeText» is actually the single element array ['SomeText'], and 1 »+« 1 would still equal two, since neither side wants to raise the stakes.
        In both cases the underlying visual and psychological metaphor is "there's something potentially plural on the big side of these double angles."

        That makes perfect sense. I've always like operators, like greater-than which says "The part with two points is bigger than the part with one point". It's kinda like roman numerals (at least 1, 2, and 3), which are what they represent.

        Now - another question that pops up - Will «SomeText» be implemented in the opcode level as ['SomeText'] would be, or will there be other opcodes for ['SomeText'] that provide the chance for different behavior because you're using the «SomeText» syntax? (If that makes any sense ...)

        ------
        We are the carpenters and bricklayers of the Information Age.

        Please remember that I'm crufty and crochety. All opinions are purely mine and all code is untested, unless otherwise specified.