--
Jonathan Lang
Adverbs are just optional named parameters. Most of the magic is in
the call syntax.
Larry
Ah. So every part of a Capture Object has an alternate call syntax:
act $foo, @list, bar => 'baz';
is the same as
@list ==> $foo.act:bar('baz');
right?
(And if this is the case, the one capability that the adverb notation
provides that the more traditional named parameter notation doesn't
have is a way to let a particular key to exist without being defined.)
--
Jonathan "Dataweaver" Lang
You might have to write that
@list ==> $foo.act :bar('baz');
I think or the colon on the method would be taken as starting a list.
I dunno, depends on whether .act: is considered a "longest token",
I guess. I could argue it the other way as well, and :bar is a longest
token compared to :.
: (And if this is the case, the one capability that the adverb notation
: provides that the more traditional named parameter notation doesn't
: have is a way to let a particular key to exist without being defined.)
Without being specified, anyway. The default values are always defined.
Larry
> act $foo, @list, bar => 'baz';
is actually the same as:
act($foo, @list, bar => 'baz');
which might or might not dispatch to a method on $foo,
depending on whether (and how) &act is defined.
Jonathan probably meant:
act $foo: @list, bar => 'baz';
for the indirect object syntax.
Damian
Eh? What's this bit about lists and colons? (This is one of the
things that worries me about Perl 6: there seem to be all sorts of
"edge cases" which crop up at the most unexpected times.)
--
Jonathan "Dataweaver" Lang