in reply to Re^3: Can I access and use UV types from perl?
in thread Can I access and use UV types from perl?
The main sense I am getting from this, is that Perl is all about the storage.
bignum still appears to store the value as an IV though. and converting a number into a rat is the same problem only stepped up to a relationship between Rationals and Naturals, the Natural numbers now being a subset of Rationals rather than a subset of Integers.
#use bignum; =head1 output SV = PVAV(0x6fb404) at 0x6fa59c REFCNT = 1 FLAGS = () ARRAY = 0x2ce1c64 FILL = 1 MAX = 3 ARYLEN = 0x0 FLAGS = (REAL) Elt No. 0 SV = IV(0x25bfd30) at 0x25bfd34 REFCNT = 1 FLAGS = (IOK,pIOK) IV = 4967296 Elt No. 1 SV = IV(0x6fa578) at 0x6fa57c REFCNT = 1 FLAGS = (IOK,pIOK) IV = 429 =cut
Interestingly when I was hacking MvT attempting to use hashkeys to represent natural numbers i kept getting (FAKE) flags, maybe there's something in that. Also storing bitfields as hashkeys has unexpected results.
It would seem that some kind of overloading solution may be the way to go, let Perl handle the storage, but overload the operations with XSUBS that do type checking/coercion. Or even straight up Inlining C.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^5: Can I access and use UV types from perl? (updated)
by haukex (Archbishop) on Nov 17, 2019 at 20:36 UTC | |
by Don Coyote (Hermit) on Nov 17, 2019 at 21:33 UTC | |
by haukex (Archbishop) on Nov 17, 2019 at 22:57 UTC | |
|
Re^5: Can I access and use UV types from perl?
by hippo (Archbishop) on Nov 17, 2019 at 23:48 UTC | |
by Don Coyote (Hermit) on Nov 18, 2019 at 01:28 UTC | |
by AnomalousMonk (Archbishop) on Nov 18, 2019 at 01:50 UTC | |
by Don Coyote (Hermit) on Nov 18, 2019 at 02:22 UTC |