I/O related question, and ini parsing

Ali Çehreli acehreli at yahoo.com
Thu Dec 5 21:22:06 PST 2013


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



More information about the Digitalmars-d-learn mailing list