summary: adding a safe-summary that catches any errors calling summary.
parent
9e1f82add6
commit
0f1a89c7cd
|
@ -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 ;
|
||||
|
|
Loading…
Reference in New Issue