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

FR: automatically derive to/from index for trivial tuple-types #993

Open
Cokemonkey11 opened this issue Mar 20, 2021 · 0 comments
Open

FR: automatically derive to/from index for trivial tuple-types #993

Cokemonkey11 opened this issue Mar 20, 2021 · 0 comments

Comments

@Cokemonkey11
Copy link
Collaborator

Here is an example:

public tuple instant(real timestamp_seconds)

public function instantToIndex(instant inst) returns int
    return realToIndex(inst.timestamp_seconds)

public function instantFromIndex(int index) returns instant
    return instant(realFromIndex(index))

Only saves 4 lines of code to automatically derive this, but would be nice!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants