factor/core/classes/singleton/singleton-docs.factor

15 lines
602 B
Factor
Raw Normal View History

USING: help.markup help.syntax kernel words ;
2008-04-01 17:51:48 -04:00
IN: classes.singleton
2008-03-05 22:35:08 -05:00
HELP: SINGLETON:
{ $syntax "SINGLETON: class"
} { $values
{ "class" "a new singleton to define" }
2008-03-05 22:35:08 -05:00
} { $description
"Defines a new predicate class whose superclass is " { $link word } ". Only one instance of a singleton may exist because classes are " { $link eq? } " to themselves. Methods may be defined on a singleton."
2008-03-05 22:35:08 -05:00
} { $examples
2008-03-11 22:01:39 -04:00
{ $example "USING: singleton kernel io ;" "SINGLETON: foo\nGENERIC: bar ( obj -- )\nM: foo bar drop \"a foo!\" print ;\nfoo bar" "a foo!" }
2008-03-05 22:35:08 -05:00
} { $see-also
POSTPONE: PREDICATE:
2008-03-05 22:35:08 -05:00
} ;