trivial lint changes

db4
Doug Coleman 2008-10-02 19:35:03 -05:00
parent b35db385d3
commit ec31e23ca7
1 changed files with 11 additions and 3 deletions

View File

@ -3,14 +3,15 @@
USING: accessors alien alien.accessors arrays assocs
combinators.lib io kernel macros math namespaces prettyprint
quotations sequences vectors vocabs words html.elements sets
slots.private combinators.short-circuit ;
slots.private combinators.short-circuit math.order hashtables
sequences.deep ;
IN: lint
SYMBOL: def-hash
SYMBOL: def-hash-keys
: set-hash-vector ( val key hash -- )
2dup at -rot >r >r ?push r> r> set-at ;
2dup at -rot [ ?push ] 2dip set-at ;
: add-word-def ( word quot -- )
dup callable? [
@ -67,7 +68,7 @@ def-hash get-global [
! Remove constants [ 1 ]
[
drop dup length 1 = swap first number? and not
drop { [ length 1 = ] [ first number? ] } 1&& not
] assoc-filter
! Remove set-alien-cell, etc.
@ -80,6 +81,13 @@ def-hash get-global [
drop trivial-defs member? not
] assoc-filter
[
drop {
[ [ wrapper? ] deep-contains? ]
[ [ hashtable? ] deep-contains? ]
} 1|| not
] assoc-filter
! Remove n m shift defs
[
drop dup length 3 = [