a + b < c
b < c - a // subtract a from both sides; "bring to other side"
If they are unsigned, then we cannot do this. That is a barrier to refactoring code with arithmetic conditionals and just reasoning about it. 1> (macroexpand '(case x (1 'a) (2 'b) (3 'c) (4 'd) (5 'e)
(6 'f) (7 'g) (8 'h) (9 'i) (10 'j)))
(let ((#:test-0005
x)
(#:swres-0007
'#:nohit))
(and (integerp #:test-0005)
(<= 1 #:test-0005
10)
(sys:setq #:swres-0007
(sys:switch (- #:test-0005
1)
#(('a) ('b) ('c)
('d) ('e) ('f)
('g) ('h) ('i)
('j)))))
(if (eq #:swres-0007
'#:nohit)
(progn) #:swres-0007))
It is faster to do some checks and interpret the sys:switch special form to dispatch by a numeric index than to do a large number of exhaustive comparisons. $ . /path/to/script.sh
Want to talk to me? Drop me an e-mail:
[email protected]
This could change without notice; check the profile.
Git repositories: https://www.kylheku.com/cgit
Mastodon: @[email protected]
LinkedIn: https://www.linkedin.com/in/kaz-kylheku-8a8b94197/
meet.hn/city/49.2608724,-123.113952/Vancouver
Socials: - kazinator.at.hn
---