Call an object method: Difference between revisions
Content added Content deleted
(Added Dyalect programming language) |
(add supercollider example) |
||
Line 1,663: | Line 1,663: | ||
Dialog information: 'sorry' |
Dialog information: 'sorry' |
||
]</lang> |
]</lang> |
||
=={{header|SuperCollider}}== |
|||
In SuperCollider, classes are objects. To call a class or object method, a message is passed to the class or the object instance. In the implementation, class method names are prefixed with an asterix, all other methods are instance methods. |
|||
<lang SuperCollider> |
|||
SomeClass { |
|||
*someClassMethod { |
|||
} |
|||
someInstanceMethod { |
|||
} |
|||
} |
|||
SomeClass.someClassMethod; |
|||
a = SomeClass.new; |
|||
a.someInstanceMethod; |
|||
</lang> |
|||
=={{header|Swift}}== |
=={{header|Swift}}== |