Better HN
top
new
best
ask
show
jobs
Log in
Sign up
Better HN
Comment
by
elihu
· 3y ago · 0 comments
I suppose this is a relatively minor thing, but being able to have conditionals like "if (0 < x < 20)" has been on my "things I wish just worked" list for awhile.
Comments
[–]
ink
3y ago
I believe you can do this in Python
[–]
ducharmdev
3y ago
Yup, you can. Also in Clojure, like this:
(< 1 2 3 4 5 6) => true
[–]
codeflo
3y ago
How do you do the (IMO common) 0 <= index < length?
[–]
unlogic
3y ago
This you can't do, unfortunately. Would have to do something stupid like `(< -1 index length)`.