D Ranges

bearophile bearophileHUGS at lycos.com
Fri Sep 13 06:31:17 PDT 2013


Chris:

> A short report on component programming and ranges.
>
> A lot of my code deals with transforming and reformatting 
> input, e.g. text is split into sentences and words for 
> grammatical parsing (part of speech) and phonetic 
> transcriptions. I'm using D ranges and component programming 
> and I'm quite happy with "one-liners" like
>
> foreach 
> (bySentence().byWord().byWhateverFormat().byReformatAgain()) {
>    // Whatever
> }

In most cases today you are free to omit those ():

foreach (bySentence.byWord.byWhateverFormat.byReformatAgain) {

Bye,
bearophile


More information about the Digitalmars-d mailing list