"Stop Designing Languages. Write Libraries Instead."

H. S. Teoh hsteoh at quickfur.ath.cx
Fri May 3 15:21:08 UTC 2019


On Fri, May 03, 2019 at 02:14:21PM +0000, rumbu via Digitalmars-d wrote:
> On Friday, 3 May 2019 at 12:52:43 UTC, H. S. Teoh wrote:
> > 
> > But currently, we have a standard range API that, in spite of some
> > warts, is universal across all D code. Everyone writes their API
> > around it rather than reinventing their own.  The Lisp Curse doesn't
> > set in, and everyone reaps the benefits.
> > 
> 
> Sorry, but I'm among the D users hating how the range stuff was
> designed and I try to avoid phobos as much as I can in all my projects
> and to rewrite bits of phobos replacement code to cover my needs. The
> fact that phobos is endorsed by someone is equal to nil as long it
> contains errors in design and sometimes even in implementation.

Expecting perfect software is a pipe dream.


> One of the reasons:
> https://forum.dlang.org/thread/ktdfnvoonjuzswryofsk@forum.dlang.org?page=1
[...]

To quote Jonathan in that thread:

	The only reason that you're even hitting this issue is because
	you're explicitly avoiding importing all of the range primitives
	together and are trying to grab certain ones individually, which
	was never an intended use case. So, if you're doing that and
	running into problems, I'm sorry, but you're trying to use the
	library in a way that it was not designed to be used.

You can't pull out a random piece of a complex machinery and expect it
to work by itself independently of the other parts.

But to address your point: this is one of the reasons I really, *really*
want to kill autodecoding with fire.  Then we can put array range
primitives in object.d where they belong, and this will no longer be an
issue.


T

-- 
Having a smoking section in a restaurant is like having a peeing section in a swimming pool. -- Edward Burr 


More information about the Digitalmars-d mailing list