RE: Stringification of references and objects.
[email protected] ("Brent Dax") Fri, 6 Dec 2002 01:16:51 -0800
| Newsgroups | perl.perl6.language,perl.perl6.documentation |
|---|---|
| Message-ID | <000001c29d08$3669ae70$6501a8c0@deepblue> |
Joseph F. Ryan:
# >Why? Isn't the pretty form more generally useful?
# >
#=20
# I don't think so; I'd think it to be annoying to have type=20
# more code in order to specify a more cocise form; if I need=20
# to dump a structure, I'd prefer to do it manually.
I think it's useful to be able to say @array.str() and $arrayref.str()
and get the same result. And since we already know what @array.str will
do (essentially what "@array" does in Perl 5), that suggests that
$arrayref.str() will do the same.
# > method str() {
# > #Unnamed invocant means you need $_, right?
# > return $_.class() ~ "($_.id())";
# > }
# >
# >(where id() returns a uniquely identifying integer, usually the=20
# >address).
# >
#=20
# Objects aren't references anymore, are they? So I don't=20
# think it is apporpriate for an object to stringify with its id.
To tell you the truth, I don't consider arrayrefs references anymore.
They're just Array objects that don't happen to be in @whatever symbols.
I don't know if this is the official view, but that fits my brain
better.
--Brent Dax <[email protected]>
@roles=3Dmap {"Parrot $_"} qw(embedding regexen Configure)
"If you want to propagate an outrageously evil idea, your conclusion
must be brazenly clear, but your proof unintelligible."
--Ayn Rand, explaining how today's philosophies came to be