Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
|
|
@ -0,0 +1,22 @@
|
|||
class Example {
|
||||
method foo {
|
||||
say "this is foo"
|
||||
}
|
||||
method bar {
|
||||
say "this is bar"
|
||||
}
|
||||
method AUTOLOAD(_, name, *args) {
|
||||
say ("tried to handle unknown method %s" % name);
|
||||
if (args.len > 0) {
|
||||
say ("it had arguments: %s" % args.join(', '));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
var example = Example.new;
|
||||
|
||||
example.foo; # prints “this is foo”
|
||||
example.bar; # prints “this is bar”
|
||||
example.grill; # prints “tried to handle unknown method grill”
|
||||
example.ding("dong"); # prints “tried to handle unknown method ding”
|
||||
# prints “it had arguments: dong”
|
||||
Loading…
Add table
Add a link
Reference in a new issue