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

Unable to Write Numbers in Unusual Bases #179

Closed
jpziegler opened this issue Mar 4, 2015 · 7 comments
Closed

Unable to Write Numbers in Unusual Bases #179

jpziegler opened this issue Mar 4, 2015 · 7 comments
Labels
feature request Asking for new or improved functionality low-hanging fruit For issues that should be easy to fix wontfix For issues that we've reviewed and decided do not require changes.

Comments

@jpziegler
Copy link
Contributor

As demonstrated below, it's possible to set output to print non-standard bases, but not, apparently, to input them. Another instance where output is not copy-paste-able, but maybe should be?

Cryptol> :s base=36
Cryptol> 1337
Assuming a = 11
0<36>115
Cryptol> :s base=10
Cryptol> 0<36>115

Parse error at <interactive>:1:6, unexpected 115
@brianhuffman
Copy link
Contributor

Yes, I've pointed out this problem here within the office. I'm of the opinion that all pretty-printed values should be able to be parsed and type-checked at the same type.

There is a related issue that has to do with #30: The pretty printer will happily print literals of odd sizes as ordinary hex literals; e.g. 20:[5] prints as 0x14, even though 0x14:[5] does not type-check.

@acfoltzer acfoltzer added the feature request Asking for new or improved functionality label Mar 4, 2015
@dylanmc dylanmc added the low-hanging fruit For issues that should be easy to fix label Mar 8, 2016
@dylanmc
Copy link
Contributor

dylanmc commented Mar 8, 2016

We discussed restricting :set base=, or just fixing the parser. If it's low-hanging fruit, let's fix the parser, if not, let's restrict the base. Brian points out that we need to decide whether any of these constants have fixed-widths (like hex does). The yak of whether hex constants should reared its head, but let's avoid going too far.

@acfoltzer acfoltzer added this to the Cryptol 2.5 milestone Jun 29, 2016
@ggranberry
Copy link

I can write up a pull request for this issue if you would still like it patched up. Has there been any more discussion about what route you'd like to take for this issue? Restricting the base seems straightforward and lines up with the docs.

@atomb atomb modified the milestones: Cryptol 2.5, Cryptol 2.6 Feb 5, 2018
@atomb atomb removed this from the Cryptol 2.6 milestone Apr 16, 2018
@brianhuffman
Copy link
Contributor

Would anyone object if I restricted the base to be one of 2, 8, 10, or 16? It seems to me that output in other bases is more of a gimmick than a useful feature. I will also update the documentation to match.

@kiniry
Copy link
Member

kiniry commented Jul 12, 2018 via email

@brianhuffman brianhuffman added the wontfix For issues that we've reviewed and decided do not require changes. label Jul 12, 2018
@atomb
Copy link
Contributor

atomb commented Jul 12, 2018

Seems reasonable to me.

@robdockins
Copy link
Contributor

Agreed. The only other base I might consider is base 64 since that's an encoding that people actually use sometimes for certs and such... but it isn't covered by the current "up to base 36" system anyway.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request Asking for new or improved functionality low-hanging fruit For issues that should be easy to fix wontfix For issues that we've reviewed and decided do not require changes.
Projects
None yet
Development

No branches or pull requests

8 participants