So, to print or not to print?

Brad Roberts via Digitalmars-d digitalmars-d at puremagic.com
Mon Apr 25 13:41:09 PDT 2016


Something that's been bouncing around in the back of my head for a while.  I can't decide if it's a 
good idea or a really bad one.  Consider a series of small modules that are essentially language 
mappers.  Something like:

    std.adapt.ruby
    std.adapt.python
    std.adapt.mumble

Each could contain little functions that map between idioms and names from the various languages to 
the d native version.   There's no way that we can or should have all those sorts of little helpers 
in the core library, but that doesn't mean that they shouldn't exist or wouldn't be useful.

On 4/25/16 12:35 PM, Andrei Alexandrescu via Digitalmars-d wrote:
> https://github.com/dlang/phobos/pull/3971
>
> Walter and I were talking this morning that there should be a high barrier of entry for one-liners
> in Phobos. The "print" function is technically a one-liner (i.e. writefln with the appropriate
> format string). On the other hand, it may be convivial enough to warrant inclusion, and saves us
> from embarrassing things such as producing meaningless output when numbers are printed together.
>
> There's been a bit of churn in the PR comments regarding the utility of "print", and discussion
> diverged into other functions such as "dump" etc. Keeping it on topic: any strong cons and pros
> regarding the function? I want to either merge or close the PR and move on.
>
>
> Thanks,
>
> Andrei


More information about the Digitalmars-d mailing list