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

Changeset 1365

Show
Ignore:
Timestamp:
12/06/09 09:12:15 (15 years ago)
Author:
walter
Message:

bugzilla 3571

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/docsrc/expression.dd

    r1347 r1365  
    971971    It is an error if those 
    972972    bounds are out of range. 
    973973    ) 
    974974 
    975975<h2>Primary Expressions</h2> 
    976976 
    977977$(GRAMMAR 
    978978$(GNAME PrimaryExpression): 
    979979    $(I Identifier) 
    980980    $(B .)$(I Identifier) 
    981     $(B this
    982     $(B super
     981    $(LINK2 #this, $(B this)
     982    $(LINK2 #super, $(B super)
    983983    $(LINK2 #null, $(B null)) 
    984984    $(B true) 
    985985    $(B false) 
    986986    $(B $) 
    987987$(V2 
    988988    $(B __FILE__) 
    989989    $(B __LINE__)) 
    990990    $(I NumericLiteral) 
    991991    $(GLINK CharacterLiteral) 
    992992    $(GLINK StringLiterals) 
     
    10021002    $(B $(LPAREN)) $(I Expression) $(B $(RPAREN)) 
    10031003$(V2 
    10041004    $(I TraitsExpression)) 
    10051005) 
    10061006 
    10071007<h3>.Identifier</h3> 
    10081008 
    10091009    $(I Identifier) is looked up at module scope, rather than the current 
    10101010    lexically nested scope. 
    10111011 
    1012 <h3>this</h3> 
     1012<h3>$(LNAME2 this, this)</h3> 
    10131013 
    10141014    $(P Within a non-static member function, $(B this) resolves to 
    10151015    a reference to the object for which the function was called. 
    10161016    If the object is an instance of a struct, $(B this) will 
    10171017    be a pointer to that instance. 
    10181018    If a member function is called with an explicit reference 
    10191019    to $(B typeof(this)), a non-virtual call is made: 
    10201020    ) 
    10211021 
    10221022------------- 
     
    10361036void main() 
    10371037{ 
    10381038    B b = new B(); 
    10391039 
    10401040    b.foo();        // returns 'A' 
    10411041    b.bar();        // returns 'B' 
    10421042} 
    10431043------------- 
    10441044 
    10451045 
    1046 <h3>super</h3> 
     1046<h3>$(LNAME2 super, super)</h3> 
    10471047 
    10481048    $(P $(B super) is identical to $(B this), except that it is 
    10491049    cast to $(B this)'s base class. 
    10501050    It is an error if there is no base class. 
    10511051    It is an error to use $(B super) within a struct member function. 
    10521052    (Only class $(TT Object) has no base class.) 
    1053     $(B super) is not allowed in struct member 
    1054     functions. 
    10551053    If a member function is called with an explicit reference 
    10561054    to $(B super), a non-virtual call is made. 
    10571055    ) 
    10581056 
    10591057<h3>$(LNAME2 null, null)</h3> 
    10601058 
    10611059    $(P $(B null) represents the null value for 
    10621060    pointers, pointers to functions, delegates, 
    10631061    dynamic arrays, associative arrays, 
    10641062    and class objects.