langs a-z
This commit is contained in:
parent
db842d013d
commit
d066446780
11389 changed files with 98361 additions and 1020 deletions
22
Task/Classes/SuperCollider/classes.supercollider
Normal file
22
Task/Classes/SuperCollider/classes.supercollider
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
MyClass {
|
||||
classvar someVar, <another, <>thirdVar; // Class variables.
|
||||
var <>something, <>somethingElse; // Instance variables.
|
||||
// Note: variables are private by default. In the above, "<" enables getting, ">" enables setting
|
||||
|
||||
*new {
|
||||
^super.new.init // constructor is a class method. typically calls some instance method to set up, here "init"
|
||||
}
|
||||
|
||||
init {
|
||||
something = thirdVar.squared;
|
||||
somethingElse = this.class.name;
|
||||
}
|
||||
|
||||
*aClassMethod {
|
||||
^ someVar + thirdVar // The "^" means to return the result. If not specified, then the object itself will be returned ("^this")
|
||||
}
|
||||
|
||||
anInstanceMethod {
|
||||
something = something + 1;
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue