polserver/testsuite/escript/classes/syntax.src
Kevin Eady 0fa1b893a0 Update core-changes, break-changes for classes support (#719)
* Format testsuite escript

* Format testsuite pol

* Update docs
Switch "attributes" to "members" to better align with Escript terms.

* Add core-changes, breaking-changes
2024-10-10 18:06:04 +02:00

30 lines
536 B
Text

class Animal()
function Animal( this, name )
this.name := name;
endfunction
endclass
class Walker()
function Walker( this, walk_speed )
this.walk_speed := walk_speed;
endfunction
function Speak( this )
print( "Woof!" );
endfunction
endclass
class Dog( Animal, Walker )
var static_var;
function Dog( this, name, breed, speed )
Animal( name );
Walker( speed );
this.walk_speed := walk_speed;
endfunction
endclass
// var dog := Dog(name, breed, speed);
// dog.Speak( );
// Dog.Speak( dog );