Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Anyone relying on objects stringifying to class names?

10 views
Skip to first unread message

Jonathan Worthington

unread,
Oct 28, 2006, 1:50:05 PM10/28/06
to Internals List
Hi,

At the moment, if you have some ParrotObject instance, say foo, and do
something like:

$S0 = foo

Then $S0 will contain the name of the class. This is BAD because it
means you can't overload what a class stringifies too! In fact, there is
a comment in the code saying that:

/*

=item C<STRING *name()>

Shortcut for .class().name()

XXX - this is bad and should go

=cut

*/

So, I want to get rid of this and allow this v-table method to just
dispatch to a user implementation or a fallback. But before I do that, I
wanted to check if anyone is relying on the behavior? I'd really rather
not break working code without giving folks a chance to fix it, but this
behavior needs to die. I'm amazed, nobody has killed it already.

I propose this is removed in a week, please respond if you'd have an
issue with that or think that's too short.

Thanks,

Jonathan

Patrick R. Michaud

unread,
Oct 28, 2006, 1:55:58 PM10/28/06
to Jonathan Worthington, Internals List
On Sat, Oct 28, 2006 at 06:50:05PM +0100, Jonathan Worthington wrote:
> So, I want to get rid of this and allow this v-table method to just
> dispatch to a user implementation or a fallback. But before I do that, I
> wanted to check if anyone is relying on the behavior? I'd really rather
> not break working code without giving folks a chance to fix it, but this
> behavior needs to die. I'm amazed, nobody has killed it already.
>
> I propose this is removed in a week, please respond if you'd have an
> issue with that or think that's too short.

I think it's too long. :-)

Does anything fail if you eliminate it (e.g., via "make tests")?
If no, then I think it's okay to eliminate, and we'll see
if anyone carps about it. But that's just my $0.02.

Pm

Allison Randal

unread,
Oct 29, 2006, 1:18:25 AM10/29/06
to Patrick R. Michaud, Jonathan Worthington, Internals List
Patrick R. Michaud wrote:
>>
>> I propose this is removed in a week, please respond if you'd have an
>> issue with that or think that's too short.
>
> I think it's too long. :-)
>
> Does anything fail if you eliminate it (e.g., via "make tests")?
> If no, then I think it's okay to eliminate, and we'll see
> if anyone carps about it. But that's just my $0.02.

A week's notice seems fair. Then if all the tests pass, nuke it! :)

Allison

Jonathan Worthington

unread,
Nov 4, 2006, 3:46:37 PM11/4/06
to Internals List
Jonathan Worthington wrote:
> At the moment, if you have some ParrotObject instance, say foo, and do
> something like:
>
> $S0 = foo
>
> Then $S0 will contain the name of the class.
>
> ...
>
> =item C<STRING *name()>
>
Erm, what the heck was I smoking when I wrote this...the name method
doesn't control what an object stringifies to at all. I managed to read
it as get_string. :-(

Sorry 'bout that. And while this is marked as being bad in the comment,
I can't remove it since it's used (and I'm not even sure, how bad it is
now). PGE uses it for example.

D'oh.

Jonathan

Patrick R. Michaud

unread,
Nov 6, 2006, 11:03:49 PM11/6/06
to Jonathan Worthington, Internals List
On Sat, Nov 04, 2006 at 08:46:37PM +0000, Jonathan Worthington wrote:
> Jonathan Worthington wrote:
> >At the moment, if you have some ParrotObject instance, say foo, and do
> >something like:
> >
> > $S0 = foo
> >
> >Then $S0 will contain the name of the class.
> >
> >=item C<STRING *name()>
>
> Erm, what the heck was I smoking when I wrote this...the name method
> doesn't control what an object stringifies to at all. I managed to read
> it as get_string. :-(
>
> Sorry 'bout that. And while this is marked as being bad in the comment,
> I can't remove it since it's used (and I'm not even sure, how bad it is
> now). PGE uses it for example.

Hmm, I can't recall where PGE might be using this -- could you
point to an example so I can make sure it's relatively sane?

Thanks,

Pm

0 new messages