Skip to content

Feature request: add an AbstractBitSigned type #37752

@rfourquet

Description

@rfourquet

The motivation is increasing re-usability of Base code, in particular from the BitIntegers package.
A bunch of functions are defined for a limited set of types, like Base.BitSigned, but their code would apply as well for any signed "bits" types, so it was copy-pasted in BitIntegers.jl. It would be great to have a type hierarchy like

abstract type AbstractBitSigned <: Signed end
abstract type AbstractBitUnsigned <: Unsigned end
const AbstractBitInteger = Union{AbstractBitSigned,AbstractBitUnsigned}

And then define more functions against these types instead of the closed lists in Base.BitSigned et al.
Re-using the Base.BitSigned name to make it an abstract type instead of AbstractBitSigned would also work, but I don't know how much code this would break.

Making this happen is probably not a simple PR for me as it involves touching C code, hence only an issue (for now at least).

Metadata

Metadata

Assignees

No one assigned

    Labels

    designDesign of APIs or of the language itselffeatureIndicates new feature / enhancement requests

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions