Easy for you to say... (haha)
Nice! Many thanks.
Mark
From: Vadim Belman
Sent: Sunday, September 8, 2019 21:32
To: Mark Devine
Cc: perl6-users
Subject: Re: Wrap an attribute’s ^get_value method in TWEAK
Here is a quickly hacked together example:
multi trait_mod: (Attribute:D $a,
Here is a quickly hacked together example:
multi trait_mod: (Attribute:D $a, :$xmlattr!) {
my $mname = $a.name.substr(2);
my = my method { say "ATTR($mname):", my \val = $a.get_value(self);
val };
_name($mname);
$a.package.^add_method($mname, );
}
class Foo {
has $.foo is
Vadim,
Vadim,
Would you be able to expand on how to implement the trait that wraps into what
is effectively the ‘get_value’ accessor of an attribute? I’m not finding
enough in the documentation to connect the dots. I’ve looked at XML::Class,
which does some pretty heavy trait’ing, but my
Hi Mark,
get_value won't give you what you expect. It's use is narrowly limited to trait
'is handles' and method .perl. Besides, are you sure all of your attributes
will be considered as belonging to XML? I mean, won't there be need for utility
attributes serving exclusively internal needs of
Perl6 Community,
How do I properly wrap an attribute’s ^get_value method in TWEAK? If a
condition exists, I’d like to wrap all (:local) attributes so that they can do
some extra work.
The module that I’m working on has classes/attributes for hundreds of fields in
dozens of different, big XML
Because sets are unordered collections of items. And the (&) operator
returns a set.
Le dim. 8 sept. 2019 à 00:18, Aureliano Guedes
a écrit :
> Why does it dont return ordered for neither of those lists?
> I mean:
>
> my $u = "24680";
> my @s = $u.comb.unique;
> say @s ; # [2 4 6 8 0]
>
> sub