Ticket #1231 (closed todo: fixed)

Opened 5 years ago

Last modified 4 years ago

src/pmc/hash.pmc: Use freeze in get_repr() (for hashes)

Reported by: jkeenan Owned by:
Priority: normal Milestone:
Component: core Version: 1.7.0
Severity: low Keywords:
Cc: Language:
Patch status: Platform:

Description

This ticket moves to the Trac system an issue previously discussed in the RT system as  RT #46643.

 301 =item  C<STRING *get_repr()>
 302 
 303 Return a representation of the hash contents.
 304 
 305 =cut
 306 
 307 */
 308 
 309     VTABLE STRING *get_string() {
 310         return Parrot_sprintf_c(INTERP, "Hash[0x%x]", SELF);
 311     }
 312 
 313     VTABLE STRING *get_repr() {
 314         /* RT #44643 use freeze */
 315         PMC * const  iter = VTABLE_get_iter(INTERP, SELF);
 316         STRING      *res  = CONST_STRING(INTERP, "{");
 317         const INTVAL n    = VTABLE_elements(INTERP, SELF);
 318         INTVAL       j;
 319 
...

In the original RT ticket, Paul Cochrane commented: When one gets a representation of the hash contents via get_repr(), it would be good to have a freeze/thaw-type mechanism for returning the contents. (At least, that's my reading of what this one line comment means).

Change History

  Changed 4 years ago by jkeenan

I know that there has been a lot of work done since this ticket was moved into Trac that either made changes to src/pmc/hash.pmc or dealt with freeze/thaw issues.

Can anyone evaluate the issues raised in this ticket?

Thank you very much.

kid51

follow-up: ↓ 3   Changed 4 years ago by cotto

  • type changed from bug to todo
  • severity changed from medium to low

This strikes me as one of those comments that should have been deleted instead of being automatically converted into a ticket (and then migrated to Trac). If there's a compelling reason to use freeze code in get_repr (which is pretty under-used anyway), the comment should have stated it. Since it didn't, I'd be perfectly happy to see this ticket go away.

in reply to: ↑ 2   Changed 4 years ago by jkeenan

  • status changed from new to closed
  • resolution set to fixed

Replying to cotto:

I'd be perfectly happy to see this ticket go away.

I'll second the motion.

In fact, luben beat me to it in r49190. Closing ticket.

Thank you very much.

kid51

Note: See TracTickets for help on using tickets.