I/O related question, and ini parsing

Mineko uminekorox at gmail.com
Thu Dec 5 21:32:55 PST 2013


On Friday, 6 December 2013 at 05:22:07 UTC, Ali Çehreli wrote:
> On 12/05/2013 08:43 PM, Mineko wrote:
>
> > I might be missing out on some D-only features
>
> The first thing I've noticed is that you are not using UFCS, 
> perhaps because you don't like it (yet ;) ) but look how 
> natural the syntax becomes:
>
> existing code (my indentation):
>
>     temp = findSplitAfter(findSplitBefore(find(source, var~" = 
> "),
>                                           ";")[0], " = ")[1];
>
> code taking advantage of D's UFCS (I hope I got it right; I 
> have not compiled it):
>
>     temp = source
>            .find(var~" = ")
>            .findSplitBefore(";")[0]
>            .findSplitAfter(" = ")[1];
>
> Ali

I didn't even know that existed, I'll jump on that right now.


More information about the Digitalmars-d-learn mailing list