lint: some more trivial-defs.

db4
John Benediktsson 2014-06-04 09:10:23 -07:00
parent c04db38570
commit 27d929b8e5
1 changed files with 9 additions and 6 deletions

View File

@ -3,10 +3,10 @@
USING: accessors alien arrays assocs classes USING: accessors alien arrays assocs classes
classes.tuple.private combinators.short-circuit continuations classes.tuple.private combinators.short-circuit continuations
fry hashtables io kernel kernel.private locals.backend make fry hashtables io kernel kernel.private locals.backend make math
math namespaces prettyprint quotations sequences sequences.deep math.private namespaces prettyprint quotations sequences
shuffle slots.private splitting stack-checker vectors vocabs sequences.deep shuffle slots.private splitting stack-checker
words words.alias ; vectors vocabs words words.alias ;
IN: lint IN: lint
@ -44,6 +44,9 @@ CONSTANT: trivial-defs
[ compose compose ] [ compose compose ]
[ empty? ] [ empty? not ] [ empty? ] [ empty? not ]
[ dup empty? ] [ dup empty? not ] [ dup empty? ] [ dup empty? not ]
[ 2dup both-fixnums? ]
[ [ drop ] prepose ]
[ 1 0 ? ]
} }
: lintable-word? ( word -- ? ) : lintable-word? ( word -- ? )
@ -183,13 +186,13 @@ CONSTANT: trivial-defs
} 1&& } 1&&
] ]
! Remove [ { foo } declare class ] ! Remove [ { foo } declare class-of ]
[ [
{ {
[ length 3 = ] [ length 3 = ]
[ first { [ array? ] [ length 1 = ] } 1&& ] [ first { [ array? ] [ length 1 = ] } 1&& ]
[ second \ declare = ] [ second \ declare = ]
[ third \ class = ] [ third \ class-of = ]
} 1&& } 1&&
] ]