[phobos] isStringLike

Dmitry Olshansky via phobos phobos at puremagic.com
Mon Oct 26 09:08:55 PDT 2015


On 26-Oct-2015 18:15, Andrei Alexandrescu via phobos wrote:
> Hi folks, isStringLike is a fine idea but there are a number of issues 
> I noticed while looking at the PR and the related pieces it works with.
>
[snip]
> I think a string-like structure is:
>
> (a) an array of characters or a subtype thereof
>
> (b) some other forward range with ElementType some character type, and 
> potentially ElementEncodingType a different character type as well.

Sadly the main reason for isStringLike is
(c) alias this to something that has a or b defined above.

>
> That's pretty much it. Algorithms dealing with string-like data should 
> be able to work with this definition, or temporarily convert to arrays 
> of characters.
>
> More importantly, while looking at 
> https://github.com/D-Programming-Language/phobos/pull/3770/ and 
> related work I can't stop noticing a growth of layers of complexity 
> that seems poorly scalable, instead of an increase in generic 
> simplicity and clarity of concepts. That does not bode well and we 
> need to curb it lest we end up with a standard library we ourselves 
> can't make sense of.
>
> I do understand there are issues to fix and we need to move forward. 
> But tactical solutions cannot substitute a lack of strategy.
>
> Please let us all stop and draw a little breath, and figure out how to 
> replace the monumental work in PR 3770 with simplifying abstractions. 
> Once something like isStringLike becomes part of Phobos, we're stuck 
> with it for eternity - there's no way we can fix it without breaking 
> code.
>

Release is unavoidable. Let us ship it then figure out the optimal 
string like definition. The whole auto-decoding mess together with alias 
this mess is important to solve but must not prevent us from releasing 
on time.

>
>
> Thanks,
>
> Andrei
>
> _______________________________________________
> phobos mailing list
> phobos at puremagic.com
> http://lists.puremagic.com/mailman/listinfo/phobos


-- 
Dmitry Olshansky


-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 3707 bytes
Desc: S/MIME Cryptographic Signature
URL: <http://lists.puremagic.com/pipermail/phobos/attachments/20151026/f2173990/attachment.bin>


More information about the phobos mailing list