From bb9d24c18a7b624859fb313a3f1ad4821ede4151 Mon Sep 17 00:00:00 2001 From: Slava Pestov Date: Tue, 23 Sep 2008 14:06:49 -0500 Subject: [PATCH] Fix paste order --- extra/webapps/pastebin/pastebin.factor | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/extra/webapps/pastebin/pastebin.factor b/extra/webapps/pastebin/pastebin.factor index 3aeb21420f..2de31c82e7 100644 --- a/extra/webapps/pastebin/pastebin.factor +++ b/extra/webapps/pastebin/pastebin.factor @@ -2,8 +2,8 @@ ! See http://factorcode.org/license.txt for BSD license. USING: namespaces assocs sorting sequences kernel accessors hashtables sequences.lib db.types db.tuples db combinators -calendar calendar.format math.parser syndication urls xml.writer -xmode.catalog validators +calendar calendar.format math.parser math.order syndication urls +xml.writer xmode.catalog validators html.forms html.components html.templates.chloe @@ -58,7 +58,9 @@ TUPLE: paste < entity annotations ; swap >>id ; : pastes ( -- pastes ) - f select-tuples ; + f select-tuples + [ [ date>> ] compare ] sort + reverse ; TUPLE: annotation < entity parent ; @@ -111,7 +113,7 @@ M: annotation entity-url [ pastebin-url ] >>url [ "Factor Pastebin" ] >>title - [ pastes ] >>entries ; + [ pastes ] >>entries ; ! ! ! ! PASTES