reddit discussion about Go turns to D again

Timon Gehr timon.gehr at gmx.ch
Mon May 16 10:51:25 PDT 2011


Jonathan M Davis wrote:
> > bearophile wrote:
> > > Sean Kelly:
> > > > std.paralellogrithm ;-)
> > >
> > > The module name I like more so far is the simple "parallel_algorithm".
> > > But I don't mind the "p" prefix for the parallel function names.
> > >
> > > Bye,
> > > bearophile
> >
> > It is also possible to have both "p" prefix and identical names. The latter
> > would be mere aliases and would be activated by a version declaration or
> > similar. I think both possibilities have their merits, so letting the user
> > choose would be an option.
> >
> > parallel_algorithm is to the point, but not very concise. I do not think we
> > can do very much better.
>
> That doesn't work. As soon as the non-p versions exist, you have name clashes.
> So, if the point of starting the function names with p is to avoid name
> clashes, then you've gained nothing. Besides, we generally try to avoid
> aliases like that in Phobos. Such a scheme would never be accepted.
>
> - Jonathan M Davis

I think the point of having the same names is that you can parallelize code easily
that was sequential before (or even for mere cosmetic reasons, by substituting the
import, so no name clashes)
But if there is only one option, then the "p" prefix is as far as I can see to be
preferred, users can always do the aliases manually.

Timon


More information about the Digitalmars-d mailing list