take and drop
Nobody has claimed this yet.
- Dominant language
- Macaulay2
- Stars
- 435
- Forks
- 297
- Avg merge
- 4d 20h
- Merged PRs (30d)
- 11
Description
It would be great if `take(L, {1,-1})` or `drop(L, {1,-1})` interpreted -1 as `#L-2` instead (and -n as `#L-1-n` resp.). This is useful when the input L is really coming from another small function and I want to keep everything in one line; e.g.
```m2
take(separate("[ ]+", str), {1,-1})
```
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by locating the implementations of `take` and `drop` and any tests covering list index ranges. Check how negative entries are currently interpreted, then define tests for `{1,-1}` and general `-n` behavior using the `separate` example. Done means both functions return the requested ranges without requiring an intermediate variable.
Written by the indexing model from the issue text.
Assessment
- Domain
- tooling
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100