Cleanup some lint warnings.

db4
John Benediktsson 2011-10-15 19:19:44 -07:00
parent df2000d8e7
commit 6f1c44b46d
29 changed files with 48 additions and 50 deletions

View File

@ -264,7 +264,7 @@ ERROR: invalid-timestamp-format ;
[ (hms>timestamp) ] with-string-reader ;
: (ymd>timestamp) ( -- timestamp )
read-ymd 0 0 0 instant <timestamp> ;
read-ymd <date-gmt> ;
: ymd>timestamp ( str -- timestamp )
[ (ymd>timestamp) ] with-string-reader ;

View File

@ -297,7 +297,7 @@ SPECIALIZED-ARRAY: struct-test-optimization
[ t ] [ [ struct-test-optimization memory>struct y>> ] { memory>struct y>> } inlined? ] unit-test
[ t ] [
[ 3 <direct-struct-test-optimization-array> third y>> ]
[ 3 struct-test-optimization <c-direct-array> third y>> ]
{ <tuple> <tuple-boa> memory>struct y>> } inlined?
] unit-test

View File

@ -128,7 +128,7 @@ GENERIC: write-full-response ( request response -- )
over unparse-content-type "content-type" pick set-at
over cookies>> [
ensure-domain unparse-set-cookie
"set-cookie" swap 2array over push
"set-cookie" swap 2array suffix!
] each
write-header ;

View File

@ -52,29 +52,29 @@ ERROR: json-error ;
dup last V{ } = not [ v-over-push ] when ;
: (close-array) ( accum -- accum' )
(close) dup pop >array over push ;
(close) dup pop >array suffix! ;
: (close-hash) ( accum -- accum' )
(close) dup dup [ pop ] bi@ swap zip >hashtable over push ;
(close) dup dup [ pop ] bi@ swap zip >hashtable suffix! ;
: scan ( accum char -- accum )
! 2dup 1string swap . . ! Great for debug...
{
{ CHAR: \" [ j-string over push ] }
{ CHAR: [ [ V{ } clone over push ] }
{ CHAR: \" [ j-string suffix! ] }
{ CHAR: [ [ V{ } clone suffix! ] }
{ CHAR: , [ v-over-push ] }
{ CHAR: ] [ (close-array) ] }
{ CHAR: { [ 2 [ V{ } clone over push ] times ] }
{ CHAR: { [ 2 [ V{ } clone suffix! ] times ] }
{ CHAR: : [ v-pick-push ] }
{ CHAR: } [ (close-hash) ] }
{ CHAR: \s [ ] }
{ CHAR: \t [ ] }
{ CHAR: \r [ ] }
{ CHAR: \n [ ] }
{ CHAR: t [ 3 read drop t over push ] }
{ CHAR: f [ 4 read drop f over push ] }
{ CHAR: n [ 3 read drop json-null over push ] }
[ value [ over push ] dip [ scan ] when* ]
{ CHAR: t [ 3 read drop t suffix! ] }
{ CHAR: f [ 4 read drop f suffix! ] }
{ CHAR: n [ 3 read drop json-null suffix! ] }
[ value [ suffix! ] dip [ scan ] when* ]
} case ;
PRIVATE>

View File

@ -2,7 +2,7 @@
! See http://factorcode.org/license.txt for BSD license.
USING: arrays assocs combinators combinators.smart fry kernel
macros math math.bits sequences sequences.private words
byte-arrays alien alien.c-types specialized-arrays ;
byte-arrays alien alien.c-types alien.data specialized-arrays ;
SPECIALIZED-ARRAY: uchar
IN: math.bitwise
@ -117,7 +117,7 @@ M: byte-array bit-count
byte-array-bit-count ;
M: object bit-count
binary-object <direct-uchar-array> byte-array-bit-count ;
binary-object uchar <c-direct-array> byte-array-bit-count ;
: even-parity? ( obj -- ? ) bit-count even? ;

View File

@ -124,7 +124,7 @@ PRIVATE>
<combo> apply-combination ;
: all-combinations ( seq k -- seq' )
[ ] combinations-quot map ;
[ ] map-combinations ;
: reduce-combinations ( seq k identity quot -- result )
[ -rot ] dip each-combination ; inline

View File

@ -8,8 +8,8 @@ IN: math.polynomials
: 2pad-head ( p q n -- p q ) [ 0 pad-head ] curry bi@ ;
: 2pad-tail ( p q n -- p q ) [ 0 pad-tail ] curry bi@ ;
: pextend ( p q -- p q ) 2dup [ length ] bi@ max 2pad-tail ;
: pextend-left ( p q -- p q ) 2dup [ length ] bi@ max 2pad-head ;
: pextend ( p q -- p q ) 2dup max-length 2pad-tail ;
: pextend-left ( p q -- p q ) 2dup max-length 2pad-head ;
: unempty ( seq -- seq ) [ { 0 } ] when-empty ;
: 2unempty ( seq seq -- seq seq ) [ unempty ] bi@ ;

View File

@ -17,7 +17,7 @@ IN: math.rectangles.positioning
[ loc>> first ] 2dip swap [ first ] bi@ - min 0 max ;
: preferred-y ( visible-rect -- y )
[ loc>> ] [ dim>> ] bi [ second ] bi@ + ;
rect-bounds [ second ] bi@ + ;
: alternate-y ( visible-rect popup-dim -- y )
[ loc>> ] dip [ second ] bi@ - ;

View File

@ -92,7 +92,7 @@ PRIVATE>
: mode ( seq -- x )
histogram >alist
[ ] [ [ [ second ] bi@ > ] 2keep ? ] map-reduce first ;
[ ] [ [ [ second ] bi@ > ] most ] map-reduce first ;
ERROR: empty-sequence ;

View File

@ -42,7 +42,7 @@ reset-gl-function-number-counter
'[ @ _ _ _ alien-indirect ] ;
:: define-indirect ( abi return function-name function-ptr-quot types names -- )
function-name create-in dup reset-generic
function-name create-function
function-ptr-quot return types abi indirect-quot
names return function-effect
define-declared ;

View File

@ -12,7 +12,7 @@ SINGLETON: openssl
ERR_clear_error f ERR_error_string ;
: ssl-error-string ( -- string )
ERR_get_error ERR_clear_error f ERR_error_string ;
ERR_get_error (ssl-error-string) ;
: (ssl-error) ( -- * )
ssl-error-string throw ;

View File

@ -16,12 +16,12 @@ MEMO: any-char-parser ( -- parser )
[ drop t ] satisfy ;
: search ( string parser -- seq )
any-char-parser [ drop f ] action 2array choice repeat0
any-char-parser [ drop f ] action 2choice repeat0
[ parse sift ] [ 3drop { } ] recover ;
: (replace) ( string parser -- seq )
any-char-parser 2array choice repeat0 parse sift ;
any-char-parser 2choice repeat0 parse sift ;
: replace ( string parser -- result )
[ (replace) [ tree-write ] each ] with-string-writer ;

View File

@ -1,8 +1,8 @@
! Copyright (C) 2008 Slava Pestov.
! See http://factorcode.org/license.txt for BSD license.
USING: layouts kernel parser math sequences ;
USING: layouts kernel parser math math.bitwise sequences ;
IN: persistent.hashtables.config
: radix-bits ( -- n ) << cell 4 = 4 5 ? suffix! >> ; foldable
: radix-mask ( -- n ) radix-bits 2^ 1 - ; foldable
: full-bitmap-mask ( -- n ) radix-bits 2^ 2^ 1 - ; inline
: radix-mask ( -- n ) radix-bits on-bits ; foldable
: full-bitmap-mask ( -- n ) radix-bits 2^ on-bits ; inline

View File

@ -137,8 +137,8 @@ M: LETTER-class modify-class modify-letter-class ;
: cased-range? ( range -- ? )
[ from>> ] [ to>> ] bi {
[ [ letter? ] bi@ and ]
[ [ LETTER? ] bi@ and ]
[ [ letter? ] both? ]
[ [ LETTER? ] both? ]
} 2|| ;
M: range-class modify-class

View File

@ -88,8 +88,7 @@ TUPLE: entry title url description date ;
} cleave ;
: atom1.0 ( xml -- feed )
feed new
swap
<feed> swap
[ "title" tag-named children>string >>title ]
[ "link" tag-named "href" attr >url >>url ]
[ "entry" tags-named [ atom1.0-entry ] map set-entries ]

View File

@ -415,7 +415,7 @@ IN: tools.deploy.shaker
! On Windows, even if deploy-io is 3, C streams are still used
! for the console, so don't strip it there.
strip-io?
deploy-io get 3 = os windows? not and
native-io? os windows? not and
or [
"Stripping C I/O" show
"vocab:tools/deploy/shaker/strip-c-io.factor" run-file

View File

@ -44,7 +44,7 @@ STRUCT: group-directory-entry
bytes ico-header memory>struct :> header
ico-header heap-size bytes <displaced-alien>
header ImageCount>> <direct-ico-directory-entry-array> :> directory
header ImageCount>> ioc-directory-entry <c-direct-array> :> directory
directory dup length iota [ ico>group-directory-entry ] { } 2map-as
:> group-directory

View File

@ -167,7 +167,7 @@ ERROR: vocab-name-contains-dot path ;
: $values. ( word -- )
"declared-effect" word-prop [
[ in>> ] [ out>> ] bi
2dup [ empty? ] bi@ and [
2dup [ empty? ] both? [
2drop
] [
[ members ] dip over diff

View File

@ -15,7 +15,7 @@ exclude-vocabs { "math" "accessors" } swap set-global
<PRIVATE
: callstack-depth ( callstack -- n )
callstack>array length 2/ ;
callstack>array midpoint@ ;
SYMBOL: end

View File

@ -137,7 +137,7 @@ CONSTANT: button-clicked-background COLOR: FactorDarkSlateBlue
dup label? [ [ clone t >>bold? ] change-font ] when drop ;
: border-button-theme ( gadget -- gadget )
dup children>> first border-button-label-theme
dup gadget-child border-button-label-theme
horizontal >>orientation
<border-button-pen> >>interior
dup dup interior>> pen-pref-dim >>min-dim

View File

@ -142,12 +142,11 @@ elevator H{
[ slider>screen elevator-padding + ] tri ;
: layout-thumb-loc ( thumb slider -- )
[ thumb-loc ] [ orientation>> ] bi n*v
[ floor ] map >>loc drop ;
[ thumb-loc ] [ orientation>> ] bi n*v vfloor >>loc drop ;
: layout-thumb-dim ( thumb slider -- )
[ dim>> ] [ thumb-dim ] [ orientation>> ] tri [ n*v ] keep set-axis
[ ceiling ] map >>dim drop ;
vceiling >>dim drop ;
: slider-enabled? ( slider -- ? )
visible-portion 1 = not ;

View File

@ -318,7 +318,7 @@ M: object accept-completion-hook 2drop ;
: quot-action ( interactor -- lines )
[ history>> history-add drop ] [ control-value ] [ select-all ] tri
[ parse-lines ] with-compilation-unit ;
parse-lines-interactive ;
: <debugger-popup> ( error continuation -- popup )
over compute-restarts [ hide-glass ] <debugger> "Error" <labeled-gadget> ;

View File

@ -250,7 +250,7 @@ M: mark-previous-rule handle-rule-start
: rule-set-empty? ( ruleset -- ? )
[ rules>> ] [ keywords>> ] bi
[ assoc-empty? ] bi@ and ;
[ assoc-empty? ] both? ;
: check-word-break ( -- ? )
current-char dup blank? [

View File

@ -3,7 +3,7 @@
USING: kernel math math.private math.order ;
IN: math.floats.private
: float-unordered? ( x y -- ? ) [ fp-nan? ] bi@ or ;
: float-unordered? ( x y -- ? ) [ fp-nan? ] either? ;
: float-min ( x y -- z ) [ float< ] most ; foldable
: float-max ( x y -- z ) [ float> ] most ; foldable

View File

@ -351,7 +351,7 @@ M: ratio >base
: float>hex-value ( mantissa -- str )
>hex 13 CHAR: 0 pad-head [ CHAR: 0 = ] trim-tail
[ "0" ] [ ] if-empty "1." prepend ;
[ "0" ] when-empty "1." prepend ;
: float>hex-expt ( mantissa -- str )
10 >base "p" prepend ;

View File

@ -4,10 +4,10 @@ USING: math math.order kernel ;
IN: math.compare
: absmin ( a b -- x )
[ [ abs ] bi@ < ] 2keep ? ;
[ [ abs ] bi@ < ] most ;
: absmax ( a b -- x )
[ [ abs ] bi@ > ] 2keep ? ;
[ [ abs ] bi@ > ] most ;
: posmax ( a b -- x )
0 max max ;

View File

@ -32,7 +32,7 @@ IN: project-euler.044
dup 3 * 1 - * 2 /i ; inline
: sum-and-diff? ( m n -- ? )
[ + ] [ - ] 2bi [ pentagonal? ] bi@ and ; inline
[ + ] [ - ] 2bi [ pentagonal? ] both? ; inline
: euler044-step ( min m n -- min' )
[ nth-pentagonal ] bi@

View File

@ -40,7 +40,7 @@ visit-time request-rate crawl-delay unknowns ;
[ first "sitemap" = ] partition [ values ] dip
[
{
[ [ first "user-agent" = ] bi@ and ]
[ [ first "user-agent" = ] both? ]
[ nip first "user-agent" = not ]
} 2||
] monotonic-split ;

View File

@ -32,7 +32,7 @@ TUPLE: user-admin < dispatcher ;
[ [ param empty? not ] keep set-value ] each ;
: selected-capabilities ( -- seq )
"capabilities" value [ value ] filter [ string>word ] map ;
"capabilities" value [ value ] filter strings>words ;
: validate-user ( -- )
{