Piers wrote:
Stringification of references
Joseph F. Ryan kicked off a discussion of the stringification of objects and references and offered his suggestions. Joseph leans towards having the default stringifications of objects and references provide information useful to the programmer. I agree with him (so, if you spot any bias in the upcoming summary that'd be because I'm biased). Michael Lazzaro explicitly brought up the distinction between "stringification for output" and "stringification for debugging", and came down in favour of stringification for output (heck, he even wanted references to be invisible to stringification). Piers Cawley told him he was very wrong and appealed to the authority of Kent Beck (a Smalltalk and Java programmer, possibly not the *best* authority to choose). Michael then proposed a scheme involving subclasses of String, to provide cues for different stringifications, which John Siracusa thought was going rather a long way too far, coming down in favour of the "stringify for debugging" position. I'm not sure anything has actually been *decided* yet though. Tune in next week.
We still need this decided, ASAP, so that doc can be completed.

I doggishly maintain my preference for treating "stringification for output" and "stringification for debugging" differently, but as long as I can specify an "AS_STRING" (sp?) method for a class, and _still_ get at a debugging version to print to other (debugging-related) strings, I think we're all basically happy. That implies, however, that we need at least two methods per type/class: AS_STRING, and AS_DEBUG, for lack of better names. By default, the first calls the second.

(I also beg people to stop thinking about testing for equality/equivalence between two objects as being related to their stringification. You shouldn't be stringifying objects merely to test if they're the same object -- yuck. It was an artifact of Perl5 that we should be replacing.)

of stringification for output (heck, he even wanted references to be invisible to stringification). Piers Cawley told him he was very wrong
Especially need to decide this.  When last we joined our heroes:

On Fri, Dec 06, 2002, Dan Sugalski wrote:
If an aggregate and a reference to an aggregate are going to behave the same, which is what Larry's indicated in the past, then stringifying a reference should be the same as stringifying its referent.
Larry wrote:
This is a bit of an oversimplification.
<snip>
But it's probably fair to say that $foo and @foo always behave
identically in a scalar context.
(Which sortof _implies_ the answer to the question, but only indirectly.)

MikeL

Reply via email to