Untested return values.

Lionello Lunesu lio at lunesu.remove.com
Thu Oct 5 02:26:11 PDT 2006


Andrei Khropov wrote:
> Walter Bright wrote:
> 
>> I tried this back in the '80s. It's one of those things that sure sounds like
>> a good idea. The problem is, there are just too many cases where the return
>> value is legitimately ignored (like printf's), so you wind up filling your
>> code with chaff like:
>>
>> 	cast(void) printf( ... );
>>
>> After a few dozen of those, it starts looking like a bad idea <g>.
> 
> Well, it depends on a particular syntax. 
> In Nemerle for example it's just 
> 
> " _ = SomeFunc();"
> 

That's true! How about: "void = printf()", similar to the void 
initializer "int[] x = void;"

L.



More information about the Digitalmars-d mailing list