Re: Which brackets should @a.perl use?

2009-01-05 Thread moritz
>> "m" == moritz writes: > > m> S02 says: > > m> "To get a Perlish representation of any object, use the .perl method. > Like > m> the Data::Dumper module in Perl 5, the .perl method will put quotes > around > m> strings, square brackets around list values," > > m> So according to t

Re: Which brackets should @a.perl use?

2009-01-05 Thread Markus Laker
Uri, On Sun, 04 Jan 2009 22:37:43 -0500, Uri Guttman wrote: > that fails with nested arrays. we don't want them to flatten. > > my $c = eval '(1, (4, 5), 3)'; > > will that work as you envision? No, but it's not what I'm proposing. A reference must Perlify as a reference, just as it does toda

Re: Which brackets should @a.perl use?

2009-01-04 Thread Uri Guttman
> "ML" == Markus Laker writes: ML> Adding a single backslash before `eval' pushes an anonymous array on to ML> @b, as you envisage wanting to do: ML> # Imagine that @a.perl has produced this: ML> my $p = "('blue', 'light', 'hazard')"; ML> my @b; ML> @b.push(\eval $p); but that

Re: Which brackets should @a.perl use?

2009-01-04 Thread Markus Laker
On Sun, 04 Jan 2009 14:19:15 -0500, Uri Guttman wrote: >> "m" == moritz writes: > m> But I think that a .perl()ification as ("blue", "light", "hayard",) would > m> make much more sense, because simple thing like > > m> @a.push eval(@b.perl) > > m> would then DWIM. > > for your def

Re: Which brackets should @a.perl use?

2009-01-04 Thread Uri Guttman
> "m" == moritz writes: m> S02 says: m> "To get a Perlish representation of any object, use the .perl method. Like m> the Data::Dumper module in Perl 5, the .perl method will put quotes around m> strings, square brackets around list values," m> So according to this, Rakudo has it

Re: Which brackets should @a.perl use?

2009-01-04 Thread moritz
> m...@edward:~/perl/6$ ./ap2 > @c: 3 elements: ["blue", "light", "hazard"] > @c[0]: blue > $c: 3 elements: ["blue", "light", "hazard"] > $c[0]: blue > m...@edward:~/perl/6$ > > > Is Rakudo's behaviour correct here? S02 says: "To get a Perlish representation of any object, use the .perl method. L

Which brackets should @a.perl use?

2009-01-03 Thread Markus Laker
This behaviour looks wrong to me: m...@edward:~/perl/6$ cat ap1 #!/home/msl/bin/perl6 my @a = ; my $p = @a.perl; say "\...@a: {...@a.elems} elements: $p"; say '@a[0]: ', @a[0]; my @b = eval $p; say "\...@b: {...@b.elems} elements: $p"; say '@b[0]: ',@b[0]; say '@b[0][0]: ', @b[0][0]; m...@