"Xiong Changnian via RT" <bug-Devel-Comments@rt.cpan.org> writes:
Show quoted text>
> Yes, I'm able to reproduce it. And the same bug is
> found when testing against "Vanilla" Smart::Comments.
Bug for bug compatibility :-).
Show quoted text> Realistically, this means I have to figure out just how Conway did his
> stuff; which has been the big issue all along.
My suspicion is Data::Dumper doesn't enjoy an empty values list, or the
post-dump crunch, or something.
Show quoted text> I agree that the current output is unacceptable. An empty string is
> reported as '', an undefined variable is reported as 'undef', a zero
> value is reported as 0.
I like those, as it's good to distinguish undef from empty string, and
from a string "undef".
Show quoted text> I suggest the "correct" report for:
>
> sub foo {return}
>
> should be 'undef', also.
I think it should distinguish no-values from a single undef value --
assuming the expression is run in array context, which is what
Smart::Comments has done, and which is handy for a list of values or
list return from a function.
### blah: $x,$y,$z
Show quoted text> bug
I opened a couple of tickets against Smart::Comments too. Colon in
labelled expression would probably be top of my list
https://rt.cpan.org/Ticket/Display.html?id=55641
which I think Devel::Comments has inherited, eg.
use Devel::Comments;
{ package xx;
sub foo { 123 }
}
### expr: 1 ? 2 : 3
### expr: xx::foo()
prints
### expr: 1 ? 2 : 3
Undefined subroutine &main::foo called at x.pl line 6.
I think the labelled epxression regexp is a bit greedy and goes to the
last colon, which means you can't use a ?: or a fully-qualified package
var or func.
Dunno if anyone would have been using colons in the label part, and
wanting them as part of the label. I'd think it more useful to have
qualified func names xx::foo() than colons in the label ...