On Thu, Sep 21, 2006 at 10:20:20PM -0700, Jonathan Lang wrote:
: Two questions:
:
: 1. How would the capture sigil affect the use of capture objects as
: replacements for perl5's references?
I don't see how it would have any effect at all, unless the P5 ref happened
to be to a typeglob, or had both array and hash semantics tied to it.
The regular $$x, @$x, and %$x look much like they do in P5.
: 2. With the introduction of the capture sigil, would it be worthwhile
: to allow someone to specify a signature as a capture object's 'type'?
: That is:
:
: my :(Dog: Str $name, Num :legs) |x = \($spot: "Spot"):legs<4>;
:
: in analogy to 'my Dog $spot'?
There are a several syntax errors in there, and we currently don't
allow assignment to a capture, only binding. Semantically, I don't
know what such a construct would buy you over the already defined:
my (|x Dog: Str $name, Num :$legs) := \($spot: "Spot", :legs(4));
Larry