syntactic sugar when functions are defined using the : operator. When invoking a method using :, the object being indexed will be implicitly given as the first argument to the function being invoked. For example, the following two functions are equivalent: local obj = {} function obj.foo(arg1, arg2) print(arg1, arg2) -- cannot use "self" here end function obj:bar(arg) print(self, arg) -- "self" is an implicit first argument before arg end -- All functions can be invoked both ways, with "." or with ":" obj:foo("Foo") -- equivalent to obj.foo(obj, "Foo") obj.bar(obj, "Bar") -- equivalent to obj:bar("Bar") Lua itself is not object-oriented, but when combined with another feature called metatables, the use of self lets programmers define functions in a manner resembling object-oriented programming. PowerShell In PowerShell the special automatic variable $_ contains the current object in the pipeline object. You can use this variable in commands that perform an action on every object or on selected objects in a pipeline. "one", "two", "three" | % { write $_ }Also starting with PowerShell 5.0, which adds a formal syntax to define classes and other user-defined types, $this variable describes the current instance of the object. Python In Python, there is no keyword for this. When a member function is called on an object, it invokes the member function with the same name on the object's class object, with the object automatically bound to the first argument of the function. Thus, the obligatory first parameter of instance methods serves as this; this parameter is conventionally named self, but can be named anything. In class methods (created with the classmethod decorator), the first argument refers to the class object itself, and is conventionally called cls; these are primarily used for inheritable constructors, where the use of the class as a parameter allows subclassing the constructor. In static methods (created with the staticmethod decorator), no special first argument exists. Rust In Rust, types are declared separately from the functions associated with them. Functions designed to be analogous to instance methods in more traditionally object-oriented languages must explicitly take self as their first parameter. These functions can then be called using instance.method() syntax sugar. For example: struct Foo { bar: i32, } impl Foo { fn new() -> Foo { Foo { bar: 0, } } fn refer(&self) { println!("{}", self.bar); } fn mutate(&mut self, baz: i32) { self.bar = baz; } fn consume(self) { self.refer();