Thread overview | |||||
---|---|---|---|---|---|
|
May 24, 2002 Once keyword | ||||
---|---|---|---|---|
| ||||
Another interesting keyword I found whilst looking at Sather is the once keyword. It is used during iteration some thing along the lines of for ( int i = 0; i < 10, once(j != null); i++ ) where j !=null is only tested on the first evaluation, and is not checked subequently. |
May 24, 2002 Re: Once keyword | ||||
---|---|---|---|---|
| ||||
Posted in reply to Don Stewart | Don Stewart wrote: > Another interesting keyword I found whilst looking at Sather is the once keyword. It is used during iteration some thing along the lines of > > for ( int i = 0; i < 10, once(j != null); i++ ) > > where j !=null is only tested on the first evaluation, and is not checked subequently. So it's the same as: if(j != null) for( int i = 0; i < 10; i++ ) -- The Villagers are Online! http://villagersonline.com .[ (the fox.(quick,brown)) jumped.over(the dog.lazy) ] .[ (a version.of(English).(precise.more)) is(possible) ] ?[ you want.to(help(develop(it))) ] |
May 24, 2002 Re: Once keyword | ||||
---|---|---|---|---|
| ||||
Posted in reply to Don Stewart | Just write: if (j != null) for ( int i = 0; i < 10; i++ ) "Don Stewart" <donald@genient.com> wrote in message news:acln46$k12$1@digitaldaemon.com... > Another interesting keyword I found whilst looking at Sather is the once keyword. It is used during iteration some thing along the lines of > > for ( int i = 0; i < 10, once(j != null); i++ ) > > where j !=null is only tested on the first evaluation, and is not checked subequently. > > |
Copyright © 1999-2021 by the D Language Foundation