On Sat, Nov 06, 2004 at 09:17:03PM +0100, Juerd wrote:
: Which things can either have a name or be anonymous?
: 
: Scalar values
: Arrays
: Hashes
: Rules
: Subs
: Classes?
: Roles?
: Modules?
: Other things?

Subtypes
Enums
Lists (Lazy and Eager)
Grammars
Packages

: If anonymous roles exist, then does
: 
:     $object does role { method quux { ... } };
: 
: really add a method to an *instance*? I see no use for it now, but
: imagine it can be useful.

I suppose it would.

: And is there a way to name something that is anonymous? For example,
: naming an anonymous subroutine can help when debugging. In Perl 5,
: this is possible with Sub::Name.

Easy, just one of

    my $named := anonymous();
    my @named := anonymous();
    my %named := anonymous();
    my &named := anonymous();
    my ::named := anonymous();

Just don't try

    *named = anonymous();

or we'll hunt you down and put hot grits down your pants.

Larry

Reply via email to