[ [ ... ] compare invert-comparison ] sort => [ ... ] inv-sort-with

db4
Joe Groff 2009-08-02 20:10:58 -05:00
parent 7c5ef08aab
commit 2a60451107
3 changed files with 4 additions and 4 deletions

View File

@ -83,7 +83,7 @@ M: comment entity-url
>>comments ;
: reverse-chronological-order ( seq -- sorted )
[ [ date>> ] compare invert-comparison ] sort ;
[ date>> ] inv-sort-with ;
: validate-author ( -- )
{ { "author" [ v-username ] } } validate-params ;

View File

@ -60,7 +60,7 @@ posting "POSTINGS"
: postings ( -- seq )
posting new select-tuples
[ [ date>> ] compare invert-comparison ] sort ;
[ date>> ] inv-sort-with ;
: <edit-blogroll-action> ( -- action )
<page-action>
@ -99,7 +99,7 @@ posting "POSTINGS"
[ '[ _ <posting> ] map ] 2map concat ;
: sort-entries ( entries -- entries' )
[ [ date>> ] compare invert-comparison ] sort ;
[ date>> ] inv-sort-with ;
: update-cached-postings ( -- )
blogroll fetch-blogroll sort-entries 8 short head [

View File

@ -66,7 +66,7 @@ M: revision feed-entry-date date>> ;
M: revision feed-entry-url id>> revision-url ;
: reverse-chronological-order ( seq -- sorted )
[ [ date>> ] compare invert-comparison ] sort ;
[ date>> ] inv-sort-with ;
: <revision> ( id -- revision )
revision new swap >>id ;