D and Nim

Daniel Murphy via Digitalmars-d digitalmars-d at puremagic.com
Sun Jan 4 19:13:37 PST 2015


"bearophile"  wrote in message news:bwxlgpicmmnvphyiqyxt at forum.dlang.org... 

> > D:
> >
> >    foreach(immutable route neighbour; nodes[nodeID].neighbours){
> >
> > Correctly written D:
> >
> >     foreach (neighbour; nodes[nodeID].neighbours){
> 
> I don't agree, the good D way is:
> 
> foreach (immutable neighbour; nodes[nodeID].neighbours) {
> 
> D programmers should apply const/immutable to every variable that 
> doesn't need to mutate.

Reading Walter's post, I somehow knew you'd be posting this exact reply.


More information about the Digitalmars-d mailing list