On 03/01/2017 12:45 AM, Richard Hainsworth wrote:

As Andrew explained Z takes two arrays and an operator, eg. =>, or +,
and then 'runs' the operator on the elements of the two lists.

Here, you defined @x as a list of strings. I defined two lists, one of
keys and one of values. Then I zipped the two together with the =>
operator that associates keys with values.

Personally, I find

%h = <key1 key2 key3 key4> Z=> <val1 val2 val3 val4>

as easier to read. I am happy not to have () and "" and ',', and the
problems of matching them, cluttering the line.

I think that the fewer the characters there are, the clearer it is to
see the relationships.

It depends on the code, and different code is more elegant and easier to
maintain when written in a different way.

But that is an opinion.

It seems to me that there are a number of new idioms arising in Perl6.
Eventually the more elegant and computationally efficient idioms will
become apparent.

From time to time, I look at the code in the modules to see if there are
nicer ways to express something.

I also can type almost as fast I think. But having typed, I think again,
and usually rewrite to make things clearer.

Thank you!

Reply via email to