develooper Front page | perl.perl6.language | Postings from April 2006

Re: Adverbs

Thread Previous | Thread Next
Jonathan Lang
April 24, 2006 20:30
Re: Adverbs
Message ID:
Larry Wall wrote:
> Jonathan Lang wrote:
> : How do you define new adverbs, and how does a subroutine go about
> : accessing them?
> Adverbs are just optional named parameters.  Most of the magic is in
> the call syntax.

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');


(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

Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About