Re: Ignoring parameters
by Patrick R. Michaud other posts by this author
Jun 17 2005 7:04AM messages near this date
Re: Ignoring parameters
|
Re: Ignoring parameters
On Fri, Jun 17, 2005 at 08:13:55AM +1000, Damian Conway wrote:
> Patrick wrote:
> > method greet(FooClass $class:) { say "Hello!"; }
>
> No. That needs to be:
>
> method greet(FooClass ::class:) { say "Hello!"; }
>
> (as implied by "takes a class as its invocant" in S12).
Okay, I'm a bit confused. I understand why the one I wrote above is
incorrect -- silly me. But I'm having trouble with the syntactical
parsing of the parameter list of the second, and I can't find any
references or similar cases in S12/A12/S06/A06. Is '::' acting as a
sigil here?
More to the point, I'm having trouble meshing this with the rules for
parameters listed in A06 (fully recognizing that there may be
"correcter" forms of A06-- I'm just trying to find what the correcter
form is ... :-). From A06, with an updated "rule sigil" for
private attributes and pod....
Here's what an individual parameter looks like:
rule parameter :w {
[ <type> ? <zone>? <variable> <trait>* <defval>?
| \[ <signature> \] # treat single array ref as an arg list
]
}
rule zone { <[?*+]> }
rule variable { <sigil> <name> [ \( <siglet> \) ]? }
rule sigil { <[$@%&]> <[*.:?^=]>? }
I'm missing something fundamental in getting
method greet(FooClass ::class:) { say "Hello!"; }
to parse.
Pm
Thread:
Gaal Yahas
Luke Palmer
John Siracusa
Damian Conway
John Siracusa
David Storrs
Matthew Zimmerman
Juerd
Matthew Zimmerman
Damian Conway
David Storrs
Juerd
Kurt
Jonathan Scott Duff
Juerd
Juerd
Kurt
Juerd
John Siracusa
John Siracusa
Adam Kennedy
Juerd
John Siracusa
Adam Kennedy
John Siracusa
Darren Duncan
John Siracusa
Juerd
Juerd
Darren Duncan
John Siracusa
John Siracusa
John Siracusa
Damian Conway
Abhijit Mahabal
Damian Conway
Patrick R. Michaud
John Siracusa
Larry Wall
Gaal Yahas
Damian Conway
Patrick R. Michaud
Damian Conway
Patrick R. Michaud
Larry Wall
Patrick R. Michaud
"TSa (Thomas Sandlaß)"
Larry Wall
|