File tree Expand file tree Collapse file tree 2 files changed +1
-39
lines changed
Expand file tree Collapse file tree 2 files changed +1
-39
lines changed Original file line number Diff line number Diff line change @@ -21,22 +21,6 @@ test: "lambda equivalent to sub1 refactorable to sub1"
2121- (map sub1 (list 1 2 3 ))
2222
2323
24- test: "comparison equivalent to positive? refactorable to positive? "
25- - (> 42 0 )
26- - (< 0 42 )
27- - (not (<= 42 0 ))
28- - (not (>= 0 42 ))
29- - (positive? 42 )
30-
31-
32- test: "comparison equivalent to negative? refactorable to negative? "
33- - (< 42 0 )
34- - (> 0 42 )
35- - (not (>= 42 0 ))
36- - (not (<= 0 42 ))
37- - (negative? 42 )
38-
39-
4024test: "lambda equivalent to positive? refactorable to positive? "
4125- (filter (λ (x) (> x 0 )) (list -2 -1 0 1 2 ))
4226- (filter (λ (x) (< 0 x)) (list -2 -1 0 1 2 ))
Original file line number Diff line number Diff line change 3434 sub1)
3535
3636
37- (define-refactoring-rule zero-comparison-to-positive?
38- #:description "This expression is equivalent to calling the `positive?` predicate. "
39- #:literals (< > <= >= not)
40- (~or (> e:expr 0 )
41- (< 0 e:expr)
42- (not (<= e:expr 0 ))
43- (not (>= 0 e:expr)))
44- (positive? e))
45-
46-
4737(define-refactoring-rule zero-comparison-lambda-to-positive?
4838 #:description "This lambda function is equivalent to the built-in `positive?` predicate. "
4939 #:literals (< > <= >= not)
5646 positive?)
5747
5848
59- (define-refactoring-rule zero-comparison-to-negative?
60- #:description "This expression is equivalent to calling the `negative?` predicate. "
61- #:literals (< > <= >= not)
62- (~or (< e:expr 0 )
63- (> 0 e:expr)
64- (not (>= e:expr 0 ))
65- (not (<= 0 e:expr)))
66- (negative? e))
67-
68-
6949(define-refactoring-rule zero-comparison-lambda-to-negative?
7050 #:description "This lambda function is equivalent to the built-in `negative?` predicate. "
7151 #:literals (< > <= >= not)
9878 single-argument-plus-to-identity
9979 sub1-lambda-to-sub1
10080 zero-comparison-lambda-to-negative?
101- zero-comparison-lambda-to-positive?
102- zero-comparison-to-negative?
103- zero-comparison-to-positive?))
81+ zero-comparison-lambda-to-positive?))
You can’t perform that action at this time.
0 commit comments