From 28dc10908ab006a3a17d309d5aeff907674137b9 Mon Sep 17 00:00:00 2001 From: John Benediktsson Date: Sun, 22 Jul 2012 14:36:51 -0700 Subject: [PATCH] summary: adding a safe-summary that catches any errors calling summary. --- basis/summary/summary.factor | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/basis/summary/summary.factor b/basis/summary/summary.factor index e67be479ae..910d4012c7 100644 --- a/basis/summary/summary.factor +++ b/basis/summary/summary.factor @@ -1,7 +1,7 @@ ! Copyright (C) 2008 Slava Pestov. ! See http://factorcode.org/license.txt for BSD license. -USING: accessors classes sequences kernel namespaces -make words math math.parser assocs ; +USING: accessors assocs classes continuations kernel make math +math.parser sequences ; IN: summary GENERIC: summary ( object -- string ) @@ -31,3 +31,8 @@ M: assoc summary M: f summary object-summary ; M: integer summary object-summary ; + +: safe-summary ( object -- string ) + [ summary ] + [ drop object-summary "~summary error: " "~" surround ] + recover ;