Larry Wall wrote:
Okay, I think this is worth bringing up to the top level.

Fact: Captures seem to be turning into a first-class data structure
that can represent:

    argument lists
    match results
    XML nodes
    anything that requires all of $, @, and % bits.

Fact: We're currently going through contortions to try to get these to behave
when they're stored in a scalar variable: [,] =$capture

Fact: This contrasts with the ease with which we can request arrayness
and hashness using the @ and % sigils.

Conjecture: We need a corresponding sigil to request captureness.
As with @ and %, you can store a capture in a $ to hide it, but we
don't have the ability to have capture variables that know how to
behave like captures without fakey syntactic help.

Let me see if I'm following you correctly:

   ¤args = \(1,2,3,:mice<blind>)

Is the backslash still neccessary, or is the use of the Capture sigil
enough to indicate that the rvalue should be treated as a capture
object?

   $¤args;         # would this return 1 or an indication that
nothing's there?
   @¤args;         # would this return [1, 2, 3], or [2, 3]?
   %¤args;         # this would return { mice -> 'blind' }

Would '¤¤args' mean anything?
Does '&¤args' mean anything?

(I like '¤' for capture objects, because it reminds me of '*', and
capture objects remind me of Perl 5's typeglobs.  Perhaps the ASCII
workaround could be '**'?)

'$¤args' would mean "retrieve the scalar portion of the capture object
'args'"; '¤$args' would mean "treat the scalar object 'args' as if it
were a capture object".  Right?  (And what, precisely, is meant by
treating a scalar as if it were a capture object?)

Which leads me to wonder if there's a Latin-1 synonym for @@, like §
maybe for "sectional", or µ for "multidimensional", or (r) for, er, repetitious
or something.

Of these, I like the idea of § for Latin-1 equivalent of @@.  Not only
does it have the meaning of "section", but it registers in my brain as
"this looks sigilish" - perhaps due to its vague visual resemblance to
the dollar sign (oddly enough, ¢ doesn't look sigilish to me; I don't
know why not, but it doesn't).  Do this, and the sigil set becomes:

   $   scalar
   @   ordered array
   §   multislice view of @ (ASCII alias: @@)
   %   unordered hash, i.e. associative array
   ¤   capture object (ASCII alias: **)
   &   code/rule/token/regex
   ::  package/module/class/role/subset/enum/type/grammar

Hmm, then (r)(c)foo could take the multidimensional feeds out of capture
"foo".  Maybe µ¢foo looks better though.  Or maybe we could work
the € in there somewhere for "extra" dimensional... ☺

Ack!  I beg you; stop the line noise!

On the other hand, we could just make |foo a capture because it
inclusive-ORs several other structures.  Main downside is that it looks
too much like an "ell".  That's probably not a showstopper in practice.
Much of the time we'd be using it to qualify other variables anyway, so
instead of scattering [,] all over the place we would have things like

    foo(|$foo)
    foo(|@foo)
    foo(|%foo)
    foo(|foo)

I'm lost.  What would '|@foo' mean?

Visually it kinda works as an "insert this here" marker too.  And most
of the places you'd use it wouldn't be using | operators.  Another factor
is that it kind of resonates visually with the \ that makes captures.

Please remind me: what does perl 6 do with '$(...)' and '@(...)'?  And
oughtn't it do something analogous with '|(...)', '¤(...)', or
whatever the capture sigil turns out to be?  Would that differ from
'\(...)'?

--
Jonathan "Dataweaver" Lang

Reply via email to