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

More number types #69

Closed
evaera opened this issue Feb 17, 2019 · 5 comments · Fixed by #275
Closed

More number types #69

evaera opened this issue Feb 17, 2019 · 5 comments · Fixed by #275
Labels
help wanted Contributions welcome scope:built-in type type:enhancement New feature or request
Projects

Comments

@evaera
Copy link
Owner

evaera commented Feb 17, 2019

natural, which would be a subset of the current integer type, would allow numbers in the range 0..n.
positive, which would be a subset of natural, would allow the range 1..n

byte, which would allow the range 0..255.
digit, which would allow the range 0..9.

@evaera evaera added the type:enhancement New feature or request label Feb 17, 2019
@evaera evaera changed the title Natural and Positive number types More number types Feb 17, 2019
@LoganDark
Copy link
Contributor

LoganDark commented Feb 17, 2019

What about negative (n..-1), zero (0, not to be used on its own), and positive (1..n) types?

Possibly a generic range type as well?

@evaera
Copy link
Owner Author

evaera commented Feb 17, 2019

What's the use case for zero? And if you're only going to allow negative, I think you might as well just use positive and then negate it in the command.

Generic types would be nice but are currently an unsupported feature. #50 could provide a means for a developer to implement generic-like arguments, though.

@LoganDark
Copy link
Contributor

@evaera Can't you combine types? I think I've seen it in the teleport command, although I suspect the @ just says "if you see an @ just use this other type"...

@evaera
Copy link
Owner Author

evaera commented Feb 17, 2019

Those are Prefixed Union Types. Actual union types might be too complex to support in this version of Cmdr.

@LoganDark
Copy link
Contributor

LoganDark commented Feb 18, 2019

Maybe negative, not_negative (positive and 0), and positive and not_positive (negative and 0)?

@evaera evaera added the help wanted Contributions welcome label Jul 30, 2019
@evaera evaera added this to Features in Cmdr Oct 17, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Contributions welcome scope:built-in type type:enhancement New feature or request
Projects
No open projects
Cmdr
  
Features
Development

Successfully merging a pull request may close this issue.

2 participants