Impossible wish: display( x <= y < z)
Nobody has claimed this yet.
- Dominant language
- Racket
- Stars
- 601
- Forks
- 74
- Avg merge
- 2d 10h
- Merged PRs (30d)
- 5
Description
I think this is impossible, and I posted this before as a comment, but I want to post it here in case someone has a idea to make it happen.
With some of the proposal it is possible to write
display(x < y < z)
and it will interpreted as
(display (< x y z))
and the result is a boolean.
I'd like to be able to write
display(x < y <= z)
and also get a boolean as the result.
In Phyton you can write
phyton> print(x < y <= z)
but I suspect they are "cheating", i.e. the internal representation is different from the a naive transformation of the text. I think it is important to not add too many weird transformation be able to write macros without understanding all the details.
One possibility is to redefine < and <= as
(define (< x y) (and x y (old-< x y) y)
(define (<= x y) (and x y (old-<= x y) y)
so
display(x < y <= z)
is
(display (<= (< x y) z))
but the result is the number z instead of a boolean.
One solution is to write
display(x < y <= z && #t)
but the last && #t is not beginners friendly.
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
No files, tests, or entry points are named. Start by examining the language proposal and the handling of chained comparisons and macros, then determine whether mixed < and <= comparisons can produce a boolean without breaking the stated expansion model.
Written by the indexing model from the issue text.
Assessment
- Domain
- compilers
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 20/100