Yesterday we discussed a strange behaviour of .perl on the result of a
hyperoperator. The basic bug is that

  my @hyp = -« ([1, 2], 3);
  say @hyp.perl;


  [(-1, -2), -3]

which are strange inner parens inside the brackets that would get
flattened after eval. I committed a :todo test for this in

Some questions arose during the discussion:

1. Should assigning an arrayref to an array dereference? Eg., so that

     @foo = [[1, 2], 3]

   is basically the same as

     @foo = ([1, 2], 3)

   Currently the first assignment generates a list whose first element
   is the complete array reference:

     [[[1, 2], 3],]

   which isn't maybe the expected behaviour. Or is it? Which Synopses
   describes this?

2. Shouldn't .perl generally use parens for outputting arrays (at
   least on the most outer level)? Because currently eval'ing the
   output contains the problem from question 1.

3. Which test file is the real one:

     pugs/t/builtins/perl2.t ?

   They are similar but not identical.

Steffen Schwigon <http://renormalist.net>
Dresden Perl Mongers <http://dresden-pm.org/>
Deutscher Perl-Workshop <http://www.perl-workshop.de/>

Reply via email to