Ticket #1231 (closed todo: fixed)
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
Note: See
TracTickets for help on using
tickets.
