installing dranges? (Re: Flatten range of ranges)

Graham Fawcett fawcett at uwindsor.ca
Thu May 6 10:46:05 PDT 2010


On Thu, 06 May 2010 17:25:44 +0000, Graham Fawcett wrote:

> On Thu, 06 May 2010 19:01:04 +0200, Philippe Sigaud wrote:
> 
>> On Thu, May 6, 2010 at 18:24, Ali Çehreli <acehreli at yahoo.com> wrote:
>> 
>>> Ali Çehreli wrote:
>>>
>>>> new to d wrote:
>>>>
>>>>> Is there any function in phobos that does something like that:
>>>>>
>>>>> auto a = [[1,2],[3,4]];
>>>>> assert(equals(flatten(a), [1,2,3,4]));
>>>>>
>>>>> I am just learning D and ca't find anything like that in the docs.
>>>>>
>>>>>
>> I've this in a dsource project:
>> 
>> http://svn.dsource.org/projects/dranges/trunk/docs/range2.html (look
>> for flatten or concat). It's a lazy range. Flatten depends on a
>> template for wrapping code, present in the traits2 module.
>> 
>> http://www.dsource.org/projects/dranges/browser/trunk/range2.d
>> http://www.dsource.org/projects/dranges/browser/trunk/traits2.d
> 
> Newbie setup question: I'm interested in trying out dranges. What's the
> best way for me to "install" dranges, so that my test code can reference
> range2 and the other drange modules?

I should clarify that I know I can just put the dranges sources in, e.g, 
a 'dranges' subdirectory, compile drange/*.d into a library and do 
something like:

dmd -Ldranges/dranges.a -Idranges test.d

...and I could modify /etc/dmd.conf by hand to add my dranges directory 
to the appropriate paths. But I wonder if I'm missing a more idiomatic 
way to install third-party libraries for D2.

Thanks,
Graham



More information about the Digitalmars-d-learn mailing list