]> gitweb.factorcode.org Git - factor.git/blob - basis/cocoa/subclassing/subclassing-docs.factor
45669ff2473388c656e36c7808464cea36b9ca7f
[factor.git] / basis / cocoa / subclassing / subclassing-docs.factor
1 USING: help.markup help.syntax strings alien hashtables ;
2 IN: cocoa.subclassing
3
4 HELP: <CLASS:
5 { $syntax "<CLASS: name < superclass protocols... imeth... ;CLASS>" }
6 { $values { "name" "a new class name" } { "superclass" "a superclass name" } { "protocols" "zero or more protocol names" } { "imeth" "instance method definitions using " { $link POSTPONE: METHOD: } } }
7 { $description "Defines a new Objective C class. Instance methods are defined with the " { $link POSTPONE: METHOD: } " parsing word."
8 $nl
9 "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." } ;
10
11 { define-objc-class POSTPONE: <CLASS: POSTPONE: METHOD: } related-words
12
13 HELP: METHOD:
14 { $syntax "METHOD: return foo: type1 arg1 bar: type2 arg2 baz: ... [ body ] ;" }
15 { $values { "return" "a C type name" } { "type1" "a C type name" } { "arg1" "a local variable name" } { "body" "arbitrary code" } }
16 { $description "Defines a method inside of a " { $link POSTPONE: <CLASS: } " form." } ;
17
18 ARTICLE: "objc-subclassing" "Subclassing Objective C classes"
19 "Objective C classes can be subclassed, with new methods defined in Factor, using parsing words:"
20 { $subsections POSTPONE: <CLASS: POSTPONE: METHOD: }
21 "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." ;
22
23 ABOUT: "objc-subclassing"