extra: using empty? in some places.
parent
34160212d1
commit
31b22494a1
|
@ -46,7 +46,7 @@ M: tcp-echo handle-client*
|
|||
<tcp-echo> [
|
||||
\ threaded-server get server>address binary [
|
||||
#times [ #bytes read-write ] times
|
||||
contents length 0 = [ incorrect-#bytes ] unless
|
||||
contents empty? [ incorrect-#bytes ] unless
|
||||
] with-client
|
||||
] with-threaded-server ;
|
||||
|
||||
|
|
|
@ -31,7 +31,7 @@ IN: fuel.xref
|
|||
>alist natural-sort ;
|
||||
|
||||
: filter-prefix ( seq prefix -- seq )
|
||||
[ drop-prefix nip length 0 = ] curry filter members ;
|
||||
[ drop-prefix nip empty? ] curry filter members ;
|
||||
|
||||
MEMO: (vocab-words) ( name -- seq )
|
||||
>vocab-link words [ name>> ] map ;
|
||||
|
|
|
@ -65,12 +65,10 @@ SYMBOL: and-needed?
|
|||
[ " " glue ] unless-empty ;
|
||||
|
||||
: append-with-conjunction ( str1 str2 -- newstr )
|
||||
over length 0 = [
|
||||
nip
|
||||
] [
|
||||
swap and-needed? get " and " ", " ?
|
||||
glue and-needed? off
|
||||
] if ;
|
||||
swap [
|
||||
and-needed? get " and " ", " ? glue
|
||||
and-needed? off
|
||||
] unless-empty ;
|
||||
|
||||
: (recombine) ( str index seq -- newstr )
|
||||
2dup nth 0 = [
|
||||
|
|
|
@ -149,7 +149,7 @@ M: mdb-collection create-collection ( collection -- )
|
|||
over '[ [ ] [ name>> ] bi _ set-at ] each ;
|
||||
|
||||
: ensure-collection-map ( mdb-instance -- assoc )
|
||||
dup collections>> dup keys length 0 =
|
||||
dup collections>> dup assoc-empty?
|
||||
[ drop build-collection-map [ >>collections drop ] keep ]
|
||||
[ nip ] if ;
|
||||
|
||||
|
|
Loading…
Reference in New Issue