redundant code
Nobody has claimed this yet.
- Dominant language
- Macaulay2
- Stars
- 435
- Forks
- 297
- Avg merge
- 4d 20h
- Merged PRs (30d)
- 11
Description
These functions are basically equivalent, so we could get rid of one.
```
export toInt(e:Expr):int := (
-- This is getting used incorrectly in interface2.dd, so a user error could be labelled an internal error.
-- We should have no internal errors.
-- To fix it, we should have this function, and similar ones, return union types that have to be tested.
when e
is i:ZZcell do toInt(i)
else fatal("internal error"));
export getSmallInt(e:Expr):int := when e is i:ZZcell do toInt(i) else -333;
```
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 toInt and getSmallInt, then inspect their callers, especially the use in interface2.dd. Determine which equivalent function can be removed and how the affected calls should handle the result; done means redundant behavior is eliminated without mislabeling a user error as an internal error.
Written by the indexing model from the issue text.
Assessment
- Domain
- tooling
- Issue type
- Refactor
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100