Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make printing AbstractBitVector1 more generic #3

Open
jlapeyre opened this issue Oct 16, 2022 · 0 comments
Open

Make printing AbstractBitVector1 more generic #3

jlapeyre opened this issue Oct 16, 2022 · 0 comments

Comments

@jlapeyre
Copy link

This line

l = v isa BitVector1 ? lastactualpos(v.x) : v.len

Only supports current subtypes. I made a subtype that stores length in a different way. Using this line:

l = v isa BitVector1 ? lastactualpos(v.x) : length(v)

would make it more generic. Better yet would be something like:

printlength(v::Bits.BitVector1) = Bits.lastactualpos(v.x)
printlength(v) = length(v)

And then

l = printlength(v)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant