#2113: FileHandle .puts and .print
-------------------------+--------------------------------------------------
Reporter: whiteknight | Owner:
Type: cage | Status: new
Priority: trivial | Milestone:
Component: core | Version: master
Severity: low | Keywords:
Lang: | Patch:
Platform: |
-------------------------+--------------------------------------------------
The two methods .print and .puts on the FileHandle PMC are nearly
identical.
.puts takes a STRING and .print takes a PMC and converts it to a string
using VTABLE_get_string. However, Parrot's PCC system will automatically
coerce a PMC argument to a STRING parameter using VTABLE_get_string, so
these two sequences are identical. Both methods call Parrot_io_putps with
the string value. The only significant difference is that .print returns
nothing while .puts returns the return value from Parrot_io_putps.
I suggest we merge the two methods. I don't care which name we keep,
although "print" seems a little bit more friendly and non-C than "puts"
does. The method can take a STRING (relying on argument autoconversion)
and can return the Parrot_io_putps status value.
The amount of work to merge these methods should be small. However, we are
going to need a deprecation cycle to do it.
--
Ticket URL: <https://trac.parrot.org/parrot/ticket/2113>
Parrot <https://trac.parrot.org/parrot/>
Parrot Development
_______________________________________________
parrot-tickets mailing list
[email protected]
http://lists.parrot.org/mailman/listinfo/parrot-tickets