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