Casey R. Tweten writes:
> Ok, consider allowing:
>
> $a = length @b;
>
> to DWIM, however, when running with warnings, warn the user that C<scalar> is
> what they really want.
>
> Just thowing that out there.
Good idea, but I think it's a bad move to turn warnings into style
guides. Warnings should point out things that have unexpected
consequences ("you seemed to think that value was defined, but it
wasn't", "that parenthesis after the function name is interpreted as
starting the argument list, but you put whitespace between the
function name and the parenthesis--you're not thinking the parentheses
are giving you a term in a larger expression, are you?"). They should
be things that you pay attention to because your program is probably
wrong.
Turning Perl into a nagging harpie means that the really important
warnings will be ignored.
This line of thinking brought to you by Mark-Jason's excellent talk
on data typing.
Nat
- Re: RFC 212 (v1) Make length(@array) work Randal L. Schwartz
- Re: RFC 212 (v1) Make length(@array) work Nathan Torkington
- Re: RFC 212 (v1) Make length(@array) work Nathan Torkington
- Re: RFC 212 (v1) Make length(@array) work Casey R. Tweten
- Re: RFC 212 (v1) Make length(@array) work Nathan Torkington
- Re: RFC 212 (v1) Make length(@array) w... Nathan Wiger
- Re: RFC 212 (v1) Make length(@arr... Nathan Torkington
- Re: RFC 212 (v1) Make length(... Tom Christiansen
- Re: RFC 212 (v1) Make length(@arr... Damian Conway
- Re: RFC 212 (v1) Make length(@array) w... Casey R. Tweten
- Re: RFC 212 (v1) Make length(@arr... Nathan Torkington
- Re: RFC 212 (v1) Make length(... Casey R. Tweten
- Re: RFC 212 (v1) Make length(... Randal L. Schwartz
- Uninitialized value warnings ... Nathan Wiger
- Re: Uninitialized value warni... Nathan Torkington
- Re: Uninitialized value warni... Nathan Wiger
- Re: Uninitialized value warni... Michael Fowler
- Re: Uninitialized value warni... Tom Christiansen
- Re: Uninitialized value warni... Tom Christiansen
- Re: Uninitialized value warni... Bart Lateur
- Re: RFC 212 (v1) Make length(@array) w... David L. Nicol
