add singleton classes
parent
b8eb5abd13
commit
6fe9e6f1ce
|
@ -0,0 +1 @@
|
|||
Doug Coleman
|
|
@ -0,0 +1,14 @@
|
|||
USING: help.markup help.syntax ;
|
||||
IN: singleton
|
||||
|
||||
HELP: SINGLETON:
|
||||
{ $syntax "SINGLETON: class"
|
||||
} { $values
|
||||
{ "class" "a new tuple class to define" }
|
||||
} { $description
|
||||
"Defines a new tuple class with membership predicate name? and a default empty constructor that is the class name itself."
|
||||
} { $examples
|
||||
{ $example "SINGLETON: foo\nfoo ." "T{ foo f }" }
|
||||
} { $see-also
|
||||
POSTPONE: TUPLE:
|
||||
} ;
|
|
@ -0,0 +1,9 @@
|
|||
! Copyright (C) 2007 Doug Coleman.
|
||||
! See http://factorcode.org/license.txt for BSD license.
|
||||
USING: kernel parser quotations tuples words ;
|
||||
IN: singleton
|
||||
|
||||
: SINGLETON:
|
||||
CREATE-CLASS
|
||||
dup { } define-tuple-class
|
||||
dup construct-empty 1quotation define ; parsing
|
Loading…
Reference in New Issue