2008-01-09 01:36:11 -05:00
USING: help.markup help.syntax strings alien hashtables ;
IN: cocoa.subclassing
2007-09-20 18:09:08 -04:00
2017-08-05 21:54:02 -04:00
HELP: <CLASS:
{ $syntax "<CLASS: name < superclass protocols... imeth... ;CLASS>" }
2015-08-12 20:44:07 -04:00
{ $values { "name" "a new class name" } { "superclass" "a superclass name" } { "protocols" "zero or more protocol names" } { "imeth" "instance method definitions using " { $link POSTPONE: METHOD: } } }
2010-07-06 19:02:52 -04:00
{ $description "Defines a new Objective C class. Instance methods are defined with the " { $link POSTPONE: METHOD: } " parsing word."
2010-07-06 17:59:35 -04:00
$nl
2007-09-20 18:09:08 -04:00
"This word is preferred to calling " { $link define-objc-class } ", because it creates a class word in the " { $vocab-link "cocoa.classes" } " vocabulary at parse time, allowing code to refer to the class word in the same source file where the class is defined." } ;
2017-08-05 21:54:02 -04:00
{ define-objc-class POSTPONE: <CLASS: POSTPONE: METHOD: } related-words
2010-07-06 17:59:35 -04:00
HELP: METHOD:
2015-08-12 20:44:07 -04:00
{ $syntax "METHOD: return foo: type1 arg1 bar: type2 arg2 baz: ... [ body ] ;" }
2010-07-06 17:59:35 -04:00
{ $values { "return" "a C type name" } { "type1" "a C type name" } { "arg1" "a local variable name" } { "body" "arbitrary code" } }
2017-08-05 21:54:02 -04:00
{ $description "Defines a method inside of a " { $link POSTPONE: <CLASS: } " form." } ;
2007-09-20 18:09:08 -04:00
ARTICLE: "objc-subclassing" "Subclassing Objective C classes"
2010-07-06 17:59:35 -04:00
"Objective C classes can be subclassed, with new methods defined in Factor, using parsing words:"
2017-08-05 21:54:02 -04:00
{ $subsections POSTPONE: <CLASS: POSTPONE: METHOD: }
2007-09-20 18:09:08 -04:00
"Objective C class definitions are saved in the image. If the image is saved and Factor is restarted with the saved image, custom class definitions are made available to the Objective C runtime when they are first accessed from within Factor." ;
ABOUT: "objc-subclassing"