improving the join function

Andrei Alexandrescu SeeWebsiteForEmail at erdani.org
Tue Oct 12 08:02:41 PDT 2010


On 10/12/10 9:35 CDT, Justin Johansson wrote:
> On 13/10/2010 1:28 AM, Justin Johansson wrote:
>> Yes, "do the darn string version already and cut all that crap".
>>
>> This is probably the thing to do to make for familiarity among
>> library users [of other languages].
>>
>> However, if you have an urge to back-end the implementation
>> of the colloquial "join" by your ideas, do not give up your
>> dream. So long as it is implemented as your private dream
>> no one will notice and you will remain internally satisfied. :-)
>>
>> - JJ
>>
>
> I think I meant the "ubiquitous join" rather than the "colloquial
> join".

By both I understand "join as in Python". Right?

Question is, where to stop?

1. string only (i.e. leave as is)

2. const(char)[] only (to allow joining char[] values)

3. various width of char, i.e. why shouldn't you join an array of wstring?

 From 3, the incremental effort to generalize to any type is virtually 
nonexistent, and the effort to generalize to ranges instead of arrays is 
minor. To me these are positives.


Andrei


More information about the Digitalmars-d mailing list