Last update March 7, 2012

Doc Comments /
Statement



Difference (last change) (no other diffs, normal page display)

Deleted: 71,74d70

Foreach over Structs and Classes with opApply:
Please add a hint about dg being the foreach body or something. After understanding this, the rest was obvious.


Changed: 88,199c84
* synchronized statement
jam tangan
jam tangan murah
jam tangan kw
hostgator coupon
kata mutiara
Jasa SEO
EZido
RDAnet
pioneer deh-1300mp
asus a53e-xa2
asus tf101-b1
asus tf101-a1
asus n53sv-eh72
asus republic of gamers g74sx
asus acer a5250
acer chromebook ac700
asus asus 53u
lg infinia 55lw5600
Sonicview 360 premier
asus 7 cu ft freezer
asus 30 single wall oven
brother cs6000i sewing machine
brother 1034d serger
brother sewing machines
Yokohama Geolandar H/T-S
crib tent tots in mind
kidco peapod plus
foscam fi8910w
samsung pl120 review
gopro helmet cam
Canon SX130IS
powershot s100
ContourHD 1080p
canon vixia hf r21
digital picture frame
canon ef 50mm f1.4
canon ef 70-300mm review
wide angle lenses
moving comfort sports bra
moving comfort bra
womens argyle sweater
bebe dresses
ViewSonic VX2250WM
Le Pan TC 970
Apple MacBook Air MC965LL
Sennheiser CX 880
plantronics cs540
ultrasonic jewelry cleaner
Sennheiser RS120
bose quietcomfort 15 acoustic noise cancelling headphones
logitech harmony one remote
logitech harmony 900
sony mhc-ec69i
sony mhcec909ip
bose wave music system
sony htss380
logitech squeezebox touch
sony dvp-fx970
onkyo tx-nr509
onkyo tx - nr609
onkyo ht-s3400
energy 5.1 take classic home theater system
polk audio psw505
onkyo ht-s5400
onkyo tx-nr709
belkin pf60
onkyo ht-rc360
denon avr-1912
Yamaha YHT-S400BL
fujitsu scansnap s1500
brother hl-2270dw
epson workforce 545
hp laserjet p2055dn
bushnell 8mp trophy cam
toshiba 32c110u
panasonic viera tc-p60s30
VIZIO E220VA
hauppauge wintv dcr-2650
Acer AM3970-U5022
Acer AspireRevo AR3700-U3002
Dell Inspiron i570
Dell GX620
Gateway FX6860-UR20P
Western Digital My Passport Essential SE 1 TB USB 3.0
Fujitsu ScanSnap S1300
Epson Perfection V300
Fujitsu SCANSNAP S1100
NeatDesk Desktop Scanner and Digital Filing System
Epson WorkForce Pro GT-S50
Kodak P811BK
Epson Perfection V330
Viewsonic VX2453MH
Asus VE228H
ViewSonic VA2431WM
Samsung B2230
HP 2711x
ASUS ML228H
Epson PowerLite Home Cinema 8350
Optoma PK301
Epson EX7210
Epson EX5210
ViewSonic PJD5133
Acer X1161P
FAVI RioHD-LED-2
Epson EX3210
ViewSonic PJD6531w
Trinity 360 Breville 800JEXL
Skil 3320-02
Delta 46-460
Grizzly G0555
Delta 18-900L
* synchronized statement

Statements

Examples

DigitalMars:d/statement.html#try

The following code prints "FileException" because the best matching catch clause seems to be determined at runtime, while equivalent code for C++ would print "Exception" instead because ex is declared as Exception.

import std.file;

int main(char[][] args)
{
  try
  {
    Exception ex = new FileException("Something");

    throw ex;
  }
  catch (FileException exc)
  {
    printf("FileException\n");
  }
  catch (Exception exc)
  {
    printf("Exception\n");
  }

  return 0;
}

Messages

Shadowing by delegates

In the case where a variable in a delegate has the same name as a variable in the enclosing funtion, you say the variable in the delegate does not shadow the variable in the enclosing function and so there is no error.

I see your point since the delegate is implemented as a separate function. However, the point is to save confussion and the delegate is logically part of the enclosing function (and shares the same stack frame). It may make sence to not allow shadowing by delegates.

DavidO?

Empty statement blocks for while/if

Can you have empty statement blocks for while loops and if statements? e.g.

if (doit)
else
{
    didNotDoIt();
}

while (isItFinished()) ;

It would probably be beter if you could not for similar reasons to the for statement.

DavidO?

foreach grammar

DigitalMars:d/statement.html#foreach

why is ForeachType only defined as inout Type Identifier and Type Identifier but not also as in Type Identifier?

Because the default for the storage class is in DigitalMars:d/function.html#parameters

Correct, but you can explicitly use the in storage class for general functions.

for grammar

DigitalMars:d/statement.html#for (ThomasKühne)

If Initializer declares a variable, that variable's scope extends through the end of Statement.

Neither does this represent the actual implementation nor the general scoping rules.

Links


FrontPage | News | TestPage | MessageBoard | Search | Contributors | Folders | Index | Help | Preferences | Edit

Edit text of this page (date of last change: March 7, 2012 20:26 (diff))