December 07, 2013 Re: I/O related question, and ini parsing | ||||
---|---|---|---|---|
| ||||
Posted in reply to nazriel | On Saturday, 7 December 2013 at 12:23:38 UTC, nazriel wrote: > imports are private by default. > > Also I noticed few overlaping private declarations, for example here: > https://github.com/MinekoRox/Breaker-3D-Game-Engine/blob/master/src/breaker/utility/belt.d#L54 Sorry for the double post, this just occured to me, and it'll keep me from getting lectured about scopes and imports. :P On Friday, 6 December 2013 at 17:32:24 UTC, Dicebot wrote: > On Friday, 6 December 2013 at 16:56:29 UTC, bearophile wrote: >> Mineko: >> >>> https://github.com/MinekoRox/Breaker-3D-Game-Engine >> >> Notes: >> - Usually in D imports are at the top (after module name and module ddoc). > > I think it is a bad practice that should be discouraged. Moving as much imports as possible into local scope has lot of practical benefits, primarily maintenance and compilation times. > > OP still has them global though, just in weird place, that is unusual for sure :) I'll probably just do that, actually, as I like having benefits. |
December 07, 2013 Re: I/O related question, and ini parsing | ||||
---|---|---|---|---|
| ||||
Posted in reply to Mineko | On Friday, 6 December 2013 at 05:32:56 UTC, Mineko wrote: > 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. You can read more about that here: http://nomad.so/2013/08/alternative-function-syntax-in-d/ |
Copyright © 1999-2021 by the D Language Foundation