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

Should .. work on strings? #128

Open
apblack opened this issue Jun 8, 2017 · 3 comments
Open

Should .. work on strings? #128

apblack opened this issue Jun 8, 2017 · 3 comments

Comments

@apblack
Copy link
Contributor

apblack commented Jun 8, 2017

The range notation a..b works only for numbers, not (right now) for Strings. Students seem to expect it to.

While the meaning of "a".."z" seems obvious, the meaning of "wombat".."kangaroo" is less so. We could define .. just for single-character strings. Is this a bad idea?

The .. operator on Numbers is defined only for integers — it's not total on all numbers. So it would not be inconsistent to make .. partial on Strings.

@kjx
Copy link
Contributor

kjx commented Jun 8, 2017 via email

@KimBruce
Copy link
Contributor

KimBruce commented Jun 8, 2017 via email

@apblack
Copy link
Contributor Author

apblack commented Jul 25, 2017

I think that we should implement .. for single-character strings. I don't think that James is really suggesting that we follow the example of Perl, so I won't worry about that issue.

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

3 participants