Your skill will accomplish what the force of many cannot |
|
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
use_integer literally turns all the values into IV's. For me that is exactly a counterexample of what I want to be able to do. To answer the question why, is certainly something I hope I can explain clearly. Variously I consider can I do X or Y and how or why not. In a sense I'd just like to ask my computer to do what I would think many people would agree is or at least should be considered the most straight forward thing that a computer can do, add 1 to 1. At some point though it seems like somewhere somebody decided that, well, before we can do that we have to convert this thing we call 1 into some more complicated thing called an integer with a respective value of 1, that can then be added to itself to produce the answer to this question. To this I say, cool now we're doing computing, but, can we just add 1 to 1 first, without turning into one of those.. uhm integer thingys? From an educational aspect, it is a bit like saying, ok I get we are all using signed ints as the basis of our computing because it leads to a lot of efficiencies and optimisations, but where are those intermediate steps we took to go from using a byte as a 7 bit bit field to using it as an 128 decimal mapping to a non-symmetric range around zero. Historically there are a lot of transformations in how character sets have evolved, from pre-Ascii through to UTF, which we are currently trying to get our heads around, and the story is fascinating and evolving. Numbers themselves are going through similar transformations, but it seems that about fifty plus years ago somebody said right its all integers for computing and thats been the final word (lol) so to speak for a long time. Perhaps there needs to be some kind of exclusive transformation format for number themselves, also. Not just a character representation format. Maybe there already is and as I mentioned in my OP I am just missing it. However, either way, that I have been wearing down keyboards for such a time without being able to approach this simply, probably means there is some kind of need to be able to do this out there. There are a couple (and more) quirks out there. One relating to Perl is in the difference between return values. Perl returns undef, zero or > zero, whereas C can return negative one. Does this mean that Perl returns unsigned int values, whereas C returns signed int values? Another quirk is the ever hilarious signed char, how has that got in there? to the casual observer this is an extraordinary concept, but it obviously relates to how numbers have evolved within computing to be used as mappings for language. In the Perl documentation there is a hint, think of Perl IO as octects or characters. This helps, but I do wonder what this strange signed char thingy is. Are they there so my papers can be marked in the work to do range? So I'd like to approach what we do now, naively, as an exercise in understanding what is going on and how we got here. In reply to Re^2: Can I access and use UV types from perl?
by Don Coyote
|
|