Release Candidate [was: Re: Beta 2.087.0]

Andre Pany andre at s-e-a-p.de
Wed Jul 3 07:30:37 UTC 2019


On Wednesday, 3 July 2019 at 06:43:50 UTC, Eugene Wissner wrote:
> On Wednesday, 3 July 2019 at 05:13:34 UTC, Andre Pany wrote:
>>
>> Hi,
>>
>> for this coding
>>
>> ```
>> import std;
>>
>> void main()
>> {
>>     assert("abc123".all!(c => (c.isAlpha && c.isUpper == 
>> false) || c.isDigit));
>> }
>> ```
>>
>>
>> 2.087.0 RC throws an error:
>>
>> C:\D\dmd2\windows\bin\..\..\src\phobos\std\algorithm\searching.d(123): Error: static assert:  "_lambda isn't a unary predicate function for range.front"
>> unary.d(5):        instantiated from here: all!string
>>
>> Is this a bug?
>>
>> Kind regards
>> André
>
> Both, std.uni and std.ascii have isAlpha and isUpper.

Thanks, you helped me to find the issue. The productive coding 
looks like this:

import std.algorithm : all;

void main()
{
     import std.ascii : isAlpha, isDigit;
     assert("abc123".all!(c => (c.isAlpha && c.isUpper == false) 
|| c.isDigit));
}

With previous dmd version, although import isUpper was not 
defined, somehow it worked.
This seems to be fixed now. This issue was the missing isUpper 
import statement.
The error message is a little bit odd:
Error: static assert:  "_lambda isn't a unary predicate function 
for range.front"

Kind regards
André


More information about the Digitalmars-d-announce mailing list