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

Slices #111

Open
skaller opened this issue Nov 30, 2017 · 1 comment
Open

Slices #111

skaller opened this issue Nov 30, 2017 · 1 comment

Comments

@skaller
Copy link
Member

skaller commented Nov 30, 2017

Slices currently require Integer type.

Considering mp_Z, or other big integer representation,
perhaps there should be a SmallInteger type.
There is consistent way to get the smallest or largest integer.

Slices without a lower bound start at #zero for the Integer type,
but Slice_from has no upper bound.

There's no notation for a counted slice.

This all inconsistent.

We should consider, default end points as minimum and maximum
values of the type, and provide a way to find them.

Also, there's no reason to restrict slices to Integers.
Iterating through the range of pointers to elements of an array seems natural
for example. Or through the characters. Slices of unicode seem useful too.

Not all total orders are enumerable, but those that are should
provide slices.

Of those that are enumerable, some have an integral enumeration,
which implies the existence of an ordinal function.

@skaller
Copy link
Member Author

skaller commented Feb 6, 2018

Its worse! Given a string s and slice a..b, then

s.[a..b]

is not the substring of s between a and b inclusive. Instead, if a or b are negative, they're munged, so that -1 is the last index position in the string, -2 the second last, etc.

Inconsistent. I need a way to handle the negatives as mentioned here but it doesn't fit with slices of the sequence of Integers.

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

1 participant