Skip Menu |

This queue is for tickets about the Devel-MAT CPAN distribution.

Report information
The Basics
Id: 123143
Status: new
Priority: 0/
Queue: Devel-MAT

People
Owner: Nobody in particular
Requestors: leonerd-cpan [...] leonerd.org.uk
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: Reconsider the 'REF' and 'UNDEF' type split
The REF and UNDEF types are somewhat special-cases of the generic scalar SV. This split seems increasingly artificial for what more of the tools seem to be doing. It may be best to remove it and have them all be just SCALARs. -- Paul Evans
On Wed Sep 27 15:16:49 2017, PEVANS wrote: Show quoted text
> The REF and UNDEF types are somewhat special-cases of the generic > scalar SV. This split seems increasingly artificial for what more of > the tools seem to be doing. It may be best to remove it and have them > all be just SCALARs.
On further consideration, the REF type at least seems potentially useful, because it means you can easily dereference RVs passed in as arguments to commands/etc by doing $sv = $sv->rv if $sv->type eq "REF" The alternative if SCALAR+REF were combined would look something like $sv = $sv->rv if $sv->type eq "SCALAR" and $sv->rv -- Paul Evans
Additionally for the purposes of leak detection and SV reuse, it's useful to consider REF and UNDEF as kinds of SCALAR, because those are changes within the same underlying SV type, which might mean the same SV slot is still used. Whereas, changes between SCALAR and ARRAY/HASH/etc.. must have been a destroy and reƤllocate. -- Paul Evans