jackfirth / jackfirth/resyntax
impossible wish: unravel complex or-and expressions
Nobody has claimed this yet.
- Dominant language
- Racket
- Stars
- 70
- Forks
- 11
- PR merge metrics
- No merged PRs in 30d
Description
(or (and b (weak-box-value b))
(let ([e (make-cached-element style content key)])
(hash-set! element-cache key (make-weak-box e))
e))
could be much better communicated with:
(cond
[b (weak-box-value b)]
[else
(let ([e (make-cached-element style content key)])
(hash-set! element-cache key (make-weak-box e))
e)])
which then opens an opportunity for let-in-cond simplification rule to kick in.
It's an impossible wish because the two code are not quite semantically equivalent generally. They are equivalent here though, because (weak-box-value b) is guaranteed to be non #f.
Contributor guide
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
The issue names no files, tests, or entry points. Start by locating the refactoring rules for complex or-and expressions and let-in-cond simplification, then determine how the engine can establish the non-#f guarantee. Done means the transformation applies only when the expressions are semantically equivalent and is covered by tests.
Written by the indexing model from the issue text.
Assessment
- Domain
- tooling
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100