Make present work on vocabularies

db4
Slava Pestov 2009-01-09 17:58:00 -06:00
parent 63c0e5470b
commit 50a4e018e1
2 changed files with 12 additions and 2 deletions

View File

@ -0,0 +1,7 @@
IN: present.tests
USING: tools.test present math vocabs ;
[ "3" ] [ 3 present ] unit-test
[ "Hi" ] [ "Hi" present ] unit-test
[ "+" ] [ \ + present ] unit-test
[ "kernel" ] [ "kernel" vocab present ] unit-test

View File

@ -1,6 +1,7 @@
! Copyright (C) 2008 Slava Pestov.
! Copyright (C) 2008, 2009 Slava Pestov.
! See http://factorcode.org/license.txt for BSD license.
USING: accessors math math.parser strings words kernel effects ;
USING: accessors math math.parser strings words vocabs
kernel effects ;
IN: present
GENERIC: present ( object -- string )
@ -11,6 +12,8 @@ M: string present ;
M: word present name>> ;
M: vocab present name>> ;
M: effect present effect>string ;
M: f present drop "" ;