core/basis/extra: use none?.
parent
01f7f6b76c
commit
bd9676e152
|
@ -256,7 +256,7 @@ M: sqlite-db-connection persistent-table ( -- assoc )
|
|||
" interpolate>string ;
|
||||
|
||||
: can-be-null? ( -- ? )
|
||||
"sql-spec" get modifiers>> [ +not-null+ = ] any? not ;
|
||||
"sql-spec" get modifiers>> [ +not-null+ = ] none? ;
|
||||
|
||||
: delete-cascade? ( -- ? )
|
||||
"sql-spec" get modifiers>> { +on-delete+ +cascade+ } swap subseq? ;
|
||||
|
|
|
@ -11,7 +11,7 @@ IN: math.primes.erato.fast
|
|||
|
||||
CONSTANT: wheel-2-3-5-7 $[
|
||||
11 dup 210 + [a,b] [
|
||||
{ 2 3 5 7 } [ divisor? ] with any? not
|
||||
{ 2 3 5 7 } [ divisor? ] with none?
|
||||
] B{ } filter-as differences
|
||||
]
|
||||
|
||||
|
|
|
@ -18,9 +18,9 @@ IN: math.primes.miller-rabin
|
|||
] [
|
||||
r <iota> [
|
||||
2^ s * a swap n ^mod n-1 =
|
||||
] any? not
|
||||
] none?
|
||||
] if
|
||||
] any? not ;
|
||||
] none? ;
|
||||
|
||||
PRIVATE>
|
||||
|
||||
|
|
|
@ -425,7 +425,7 @@ M: ebnf-sequence build-locals ( code ast -- code )
|
|||
elements>> filter-hidden dup length 1 = [
|
||||
first build-locals
|
||||
] [
|
||||
dup [ ebnf-var? ] any? not [
|
||||
dup [ ebnf-var? ] none? [
|
||||
drop
|
||||
] [
|
||||
[
|
||||
|
|
|
@ -31,7 +31,7 @@ M: prolog process
|
|||
: before-main? ( -- ? )
|
||||
xml-stack get {
|
||||
[ length 1 = ]
|
||||
[ first second [ tag? ] any? not ]
|
||||
[ first second [ tag? ] none? ]
|
||||
} 1&& ;
|
||||
|
||||
M: directive process
|
||||
|
|
|
@ -273,7 +273,7 @@ PRIVATE>
|
|||
ERROR: topological-sort-failed ;
|
||||
|
||||
: largest-class ( seq -- n elt )
|
||||
dup [ [ class< ] with any? not ] curry find-last
|
||||
dup [ [ class< ] with none? ] curry find-last
|
||||
[ topological-sort-failed ] unless* ;
|
||||
|
||||
: sort-classes ( seq -- newseq )
|
||||
|
|
|
@ -184,7 +184,7 @@ PRIVATE>
|
|||
{ [ dup empty? ] [ 2drop ] }
|
||||
{ [ dup [ length 4 <= ] [ [ word? ] any? ] bi or ] [ drop linear-case-quot ] }
|
||||
{ [ dup contiguous-range? ] [ drop dispatch-case-quot ] }
|
||||
{ [ dup [ wrapper? ] any? not ] [ drop hash-case-quot ] }
|
||||
{ [ dup [ wrapper? ] none? ] [ drop hash-case-quot ] }
|
||||
{ [ dup [ wrapper? ] all? ] [ drop [ [ wrapped>> ] dip ] assoc-map hash-case-quot ] }
|
||||
[ drop linear-case-quot ]
|
||||
} cond ;
|
||||
|
|
|
@ -39,7 +39,7 @@ PRIVATE>
|
|||
|
||||
: forward-reference? ( word -- ? )
|
||||
dup old-definitions get [ in? ] with any? [
|
||||
new-definitions get [ in? ] with any? not
|
||||
new-definitions get [ in? ] with none?
|
||||
] [ drop f ] if ;
|
||||
|
||||
SYMBOL: compiler-impl
|
||||
|
|
|
@ -5,7 +5,7 @@ grouping kernel math math.functions math.order math.vectors
|
|||
parser prettyprint.custom sequences sequences.deep ;
|
||||
IN: arrays.shaped
|
||||
|
||||
: flat? ( array -- ? ) [ sequence? ] any? not ; inline
|
||||
: flat? ( array -- ? ) [ sequence? ] none? ; inline
|
||||
|
||||
GENERIC: array-replace ( object -- shape )
|
||||
|
||||
|
|
|
@ -45,7 +45,7 @@ TUPLE: code-file
|
|||
|
||||
: include-file-name? ( name -- ? )
|
||||
{
|
||||
[ path-components [ "." head? ] any? not ]
|
||||
[ path-components [ "." head? ] none? ]
|
||||
[ link-info regular-file? ]
|
||||
} 1&& ;
|
||||
|
||||
|
|
|
@ -16,7 +16,7 @@ IN: math.primes.solovay-strassen
|
|||
a n jacobi n mod'
|
||||
a n 1 - 2 /i n ^mod = not
|
||||
] if
|
||||
] any? not ;
|
||||
] none? ;
|
||||
|
||||
PRIVATE>
|
||||
|
||||
|
|
|
@ -73,7 +73,7 @@ TUPLE: cell #adjacent mined? state ;
|
|||
{ [ lost? ] [ won? ] } 1|| ;
|
||||
|
||||
: new-game? ( cells -- ? )
|
||||
[ [ state>> +clicked+ = ] any? ] any? not ;
|
||||
[ [ state>> +clicked+ = ] any? ] none? ;
|
||||
|
||||
DEFER: click-cell-at
|
||||
|
||||
|
|
|
@ -76,7 +76,7 @@ SYMBOL: total
|
|||
! Part II: Topologically sorting specializers
|
||||
: maximal-element ( seq quot -- n elt )
|
||||
dupd [
|
||||
swapd [ call +lt+ = ] 2curry any? not
|
||||
swapd [ call +lt+ = ] 2curry none?
|
||||
] 2curry find [ "Topological sort failed" throw ] unless* ;
|
||||
inline
|
||||
|
||||
|
|
|
@ -28,7 +28,7 @@ IN: project-euler.035
|
|||
|
||||
: possible? ( seq -- ? )
|
||||
dup length 1 > [
|
||||
[ even? ] any? not
|
||||
[ even? ] none?
|
||||
] [
|
||||
drop t
|
||||
] if ;
|
||||
|
|
Loading…
Reference in New Issue