Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

Why not include the faster XS-based Clone?

clone faster
0
Posted

Why not include the faster XS-based Clone?

0

Only because it is XS-based and not included with the standard Perl distribution and would make classes less portable. Those applications that have a greater demand for cloning speed, and that have the XS Clone installed, can easly point their classes’ clone method to that implementation. § • Why are all attribute values required to be scalars? Because it is fast and simplier to deal with than trying to figure out context issues when returning from an accessor, (which is what Class::Struct and others have attempted at the cost of simplicity). If you need more than a reference, create a setter and getter than inflates and deflates it just as you would normally, no sense making all the attributes take that penalty. § • Why use affordance accessor and mutators? Why the set_ and get_? They are faster and safer than the common setter/getter-in-one accessors commonly found in Perl. See Provide separate read and write accessors in Perl Best Practices if you need more convincing. You can still

Related Questions

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.

Experts123