factor/extra/singleton/singleton.factor

16 lines
419 B
Factor
Raw Normal View History

! Copyright (C) 2008 Doug Coleman.
2008-03-05 22:35:08 -05:00
! See http://factorcode.org/license.txt for BSD license.
USING: classes.predicate kernel namespaces parser quotations
sequences words ;
2008-03-05 22:35:08 -05:00
IN: singleton
: define-singleton ( token -- )
2008-03-11 04:36:09 -04:00
\ word swap create-class-in
dup [ eq? ] curry define-predicate-class ;
2008-03-05 22:35:08 -05:00
: SINGLETON:
scan define-singleton ; parsing
: SINGLETONS:
";" parse-tokens [ define-singleton ] each ; parsing