Generic memory allocation in D

Walter Bright newshound2 at digitalmars.com
Tue Mar 5 23:40:48 UTC 2024


On 3/4/2024 7:39 PM, Richard (Rikki) Andrew Cattermole wrote:
>> However, "isPure" asks a question. "checkPurity" does not, and so it isn't 
>> implicit how the logic should go.
> 
> s/checkPurity/isFunctionCallableWrtPurity/
> 
> A much longer name, but now the purpose is very clear what it does.
> 
> True for success, false for failure.
> 
> Based upon my understanding of its body it looks like this is a valid 
> name/behavior.
> 
> https://github.com/dlang/dmd/blob/95ba36a3fdd46850666aaebf2db31dd7c5dc9012/compiler/src/dmd/expressionsem.d#L1860

check* functions do more than just return status - they print error messages, 
too. and is* function should only answer the question.


More information about the Digitalmars-d mailing list