[this message^did not appear on pypy-dev]
--- Begin Message ---
At 12:55 2005-11-21 +0100, Armin Rigo wrote:
>Hi Christian,
>
>On Mon, Nov 21, 2005 at 02:04:01AM -0800, Christian Tismer wrote:
>> CPython does allow float keys and doesn't have portability
>> problems. The only concern here is compatability with equally
>> values integer keys. But that does not apply to RPython, since
>> we there dfon't allow mixing types at all.
>
>Good point. RPython can probably live with a simple hash function for
>floats, and our W_FloatObject's hash can be more complicated (possibly
>using the integer as hash when the float has no fractional part, like
>now, or falling back to the RPython hash if there is a fractional part).
>
>> 64 bit long would be perfect
>
>That's a possibility. For PyPy we should be more explicit, though, and
>use a "class r_longlong" or "class r_int64". It should be part of a
>general design that would allow integers of various precisions. The
>design decision is to choose if we want classes with explicit sizes
>(r_int64) or C-like names (longlong)...
Please pardon my jumping in, but IMO a collection of _unambigous_ names like
r_int32
is in one sense just a small notch better than a collection of _ambiguous_ names
for various integer implementations (like int, long, etc.).
If you want a "general design that would allow integers of various precisions,"
perhaps one could think about some way of parameterizing the precision info
(e.g.,
exact or min bit widths) rather than just cleaning up the ambiguity in C's way
of defining an evolving series of increasingly ridiculous (what next,
extralonglong?)
platform-dependent names. I.e., when would it be time to introduce r_int128 ?
If various integer subtypes are being generated, perhaps one could specify
minimum or exact bitwidths etc as parameters seen by a metaclass, like __SLOTS__
only relevant to integer representation, or have an integer class factory
function
that takes specs as parameters and raises an exception if the required class
can't be generated implementing the specs a particular platform.
Just a thought.
Regards,
Bengt Richter
--- End Message ---
_______________________________________________
[email protected]
http://codespeak.net/mailman/listinfo/pypy-dev