Ticket #1229 (new todo)
Opened 4 years ago
src/pmc/fixedpmcarray.pmc: get_repr() should use freeze/thaw
| Reported by: | jkeenan | Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | |
| Component: | core | Version: | 1.7.0 |
| Severity: | medium | Keywords: | |
| Cc: | Language: | ||
| Patch status: | Platform: |
Description
This ticket moves an item previously discussed in the RT system at RT 46673 to the TT system.
179 =item C<STRING *get_repr()>
180
181 Returns a string representation of the array contents.
182 RT #46673 implement freeze/thaw and use that instead.
183
184 =cut
185
186 */
187
188 VTABLE STRING *get_string() {
189 return Parrot_str_from_int(INTERP, SELF.elements());
190 }
191
192 VTABLE STRING *get_repr() {
193 STRING *res = CONST_STRING(INTERP, "(");
194 const INTVAL n = VTABLE_elements(INTERP, SELF);
195 INTVAL i;
196
197 for (i = 0; i < n; ++i) {
198 PMC * const val = SELF.get_pmc_keyed_int(i);
199 if (i > 0)
200 res = Parrot_str_append(INTERP, res, CONST_STRING(INTERP, ", "));
201
202 res = Parrot_str_append(INTERP, res, VTABLE_get_repr(INTERP, val ));
203 }
204
205 res = Parrot_str_append(INTERP, res, CONST_STRING(INTERP, ")"));
206
207 return res;
208 }
kid51
Note: See
TracTickets for help on using
tickets.
