Note: This website is archived. For up-to-date information about D projects and development, please visit wiki.dlang.org.

Changes between Version 52 and Version 53 of LanguageSpec/Expressions

Show
Ignore:
Author:
JarrettBillingsley (IP: 71.199.122.84)
Timestamp:
02/29/08 03:57:45 (16 years ago)
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • LanguageSpec/Expressions

    v52 v53  
    248248If the dot is followed by the '`class`' keyword, it will get the class of the instance on the left side of the dot.  Using it on any other types will throw an exception. 
    249249 
    250 '''Call expressions.''' Using call expressions, you can call functions, classes (to make new class instances), delegates, and other types which have an opCall metamethod.  If the expression before the parentheses is a dot expression, the right side of the dot expression is the name of the method to call, and the left side of the dot expression is passed as the 'this' parameter of the called function.  This is a method call.  When a non-method call occurs, the value passed as the 'this' parameter is determined in other ways.  See [wiki:LanguageSpec/Functions Functions] for more details. 
     250'''Call expressions.''' Using call expressions, you can call functions, classes (to make new class instances), threads (to resume them), and other types which have an opCall metamethod.  If the expression before the parentheses is a dot expression, the right side of the dot expression is the name of the method to call, and the left side of the dot expression is passed as the 'this' parameter of the called function.  This is a method call.  When a non-method call occurs, the value passed as the 'this' parameter is determined in other ways.  See [wiki:LanguageSpec/Functions Functions] for more details. 
    251251 
    252252If you want to call a function with an arbitrary context rather than having MiniD figure out the context, you can use the `with` keyword to indicate the context with which to call the function.  This can be done with regular function calls and with method calls.  Examples: