ljr/wcmtools/s2/tests/String_Object.s2

25 lines
336 B
C++
Executable File

#-*-c++-*-
layerinfo "type" = "core";
layerinfo "majorversion" = 0;
class string {
function repeat () : string;
}
function string::repeat () : string
{
return $this + $this;
}
function main ()
{
var string b = "foo ";
var string r = "";
$r = $b->repeat();
$r = $r->repeat();
println "repeated: $r";
}