Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var range = object(
- "init" => function(start, end)
- {
- this.start = start;
- this.end = end;
- return this;
- },
- "count" => function()
- {
- return (this.end - this.start) + 1;
- },
- "get" => function(n)
- {
- return this.start + n;
- }
- );
- for(i in range(5, 8))
- {
- print("i: %d\n" % (i));
- }
Add Comment
Please, Sign In to add comment