#1639: StringHandle should be updated to use StringBuilder internally.
--------------------+-------------------------------------------------------
 Reporter:  bacek   |       Owner:  kthakore
     Type:  todo    |      Status:  assigned
 Priority:  normal  |   Milestone:          
Component:  core    |     Version:  trunk   
 Severity:  low     |    Keywords:  newbie  
     Lang:          |       Patch:          
 Platform:          |  
--------------------+-------------------------------------------------------

Comment(by allison):

 We need to kill that Parrot_io_open loop. The function call isn't doing
 anything but setting the the flags attribute, which StringHandle's open
 method could do directly.

 Delete these 4 lines from Parrot_io_open in src/io/api.c.

 {{{
 149     else if (new_filehandle->vtable->base_type ==
 enum_class_StringHandle) {
 150         SETATTR_StringHandle_flags(interp, pmc, flags);
 151         filehandle = pmc;
 152     }
 }}}

 Delete this line from the open method in src/pmc/stringhandle.pmc:

 {{{
 210         SELF = Parrot_io_open(INTERP, SELF, filename, open_mode);
 }}}


 Move the function "Parrot_io_parse_open_flags" from src/io/filehandle.c to
 src/io/api.c (since it is used more broadly than just the FileHandle PMC).

 Add the following lines in the appropriate places in the open method in
 src/pmc/stringhandle.pmc:

 {{{
 INTVAL flags;
 ...
 flags = Parrot_io_parse_open_flags(INTERP, open_mode);
 SET_ATTR_flags(INTERP, SELF, flags)
 }}}

 Test.

-- 
Ticket URL: <https://trac.parrot.org/parrot/ticket/1639#comment:10>
Parrot <https://trac.parrot.org/parrot/>
Parrot Development
_______________________________________________
parrot-tickets mailing list
[email protected]
http://lists.parrot.org/mailman/listinfo/parrot-tickets

Reply via email to