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

feature request: improved char type #4

Closed
Chris-Hawblitzel opened this issue Jul 1, 2016 · 0 comments
Closed

feature request: improved char type #4

Chris-Hawblitzel opened this issue Jul 1, 2016 · 0 comments
Assignees
Labels
kind: enhancement Enhancements, feature requests, etc. These are NOT bugs, but ways we can improve Dafny

Comments

@Chris-Hawblitzel
Copy link
Collaborator

Dafny's char type predates the newtype facility and is very limited compared to newtypes. It would be useful if char behaved more like a newtype. For example, this would allow programmers to convert between char types and other integral types, which would help when writing parsers and printers that convert between strings and integers. For example, with newtypes, you can write:

newtype mychar = x:int | 0 <= x < 0x10000

function method digitAsChar(i:int):mychar
  requires 0 <= i < 10
{
  mychar(48 + i)
}

This is difficult to do with the current char type.

@Chris-Hawblitzel Chris-Hawblitzel added the kind: enhancement Enhancements, feature requests, etc. These are NOT bugs, but ways we can improve Dafny label Jul 1, 2016
@qunyanm qunyanm self-assigned this Jan 10, 2017
utaal pushed a commit to utaal/dafny that referenced this issue Jun 26, 2020
…e-by-reference

Dafny sequence by reference
camrein added a commit that referenced this issue Apr 8, 2021
atomb added a commit that referenced this issue Jul 27, 2023
Change parsing of boxed values in counterexamples
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind: enhancement Enhancements, feature requests, etc. These are NOT bugs, but ways we can improve Dafny
Projects
None yet
Development

No branches or pull requests

2 participants