summary: adding a safe-summary that catches any errors calling summary.
parent
9e1f82add6
commit
0f1a89c7cd
|
@ -1,7 +1,7 @@
|
||||||
! Copyright (C) 2008 Slava Pestov.
|
! Copyright (C) 2008 Slava Pestov.
|
||||||
! See http://factorcode.org/license.txt for BSD license.
|
! See http://factorcode.org/license.txt for BSD license.
|
||||||
USING: accessors classes sequences kernel namespaces
|
USING: accessors assocs classes continuations kernel make math
|
||||||
make words math math.parser assocs ;
|
math.parser sequences ;
|
||||||
IN: summary
|
IN: summary
|
||||||
|
|
||||||
GENERIC: summary ( object -- string )
|
GENERIC: summary ( object -- string )
|
||||||
|
@ -31,3 +31,8 @@ M: assoc summary
|
||||||
M: f summary object-summary ;
|
M: f summary object-summary ;
|
||||||
|
|
||||||
M: integer 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