1 ! Copyright (C) 2008, 2009 Slava Pestov.
2 ! See http://factorcode.org/license.txt for BSD license.
3 USING: accessors alien.c-types effects io.pathnames kernel math
4 math.parser quotations sequences splitting strings vocabs words ;
7 GENERIC: present ( object -- string )
9 M: real present number>string ;
12 [ real>> number>string ]
16 [ 0 >= [ "+" prepend ] when ] bi
21 M: word present name>> ;
23 M: vocab-spec present name>> ;
25 M: effect present effect>string ;
27 M: f present drop "" ;
29 M: pathname present string>> ;
34 [ [ present ] map unwords ]
35 [ drop " ]" ] tri 3append
39 to>> name>> "*" append ;