summary: adding a safe-summary that catches any errors calling summary.

db4
John Benediktsson 2012-07-22 14:36:51 -07:00
parent 9e1f82add6
commit 0f1a89c7cd
1 changed files with 7 additions and 2 deletions

View File

@ -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 ;