DMD 0.165 release
Unknown W. Brackets
unknown at simplemachines.org
Tue Aug 22 07:03:09 PDT 2006
If you always want the SQL stuff run, you have to do it separately.
But it goes back to this:
if (logging)
log(RunSQLStuff());
You wouldn't make that mistake. Given the name of log(), assuming it is
properly named, and your understanding of D, assuming you don't think
it's just C, you should be able to put 2 and 2 together.
Anyway, I would suggest that RunSQLStuff() shouldn't return a loggable
string, because that's just silly. It should make log() calls itself.
If you can't change that, it's really unlikely you'll have it returning
a string worth logging anyway.
But that's specific to this case.
-[Unknown]
> Walter Bright wrote:
>> Derek Parnell wrote:
>>
>>> On Mon, 21 Aug 2006 11:06:12 -0700, Walter Bright wrote:
>>>
>>>> BCS wrote:
>>>>
>>>>> given
>>>>>
>>>>> void foo(char[]);
>>>>> void foo(char[] delegate());
>>>>>
>>>>> how do I force the use of the first?
>>>>
>>>> You can't. Think of it like:
>>>>
>>>> void foo(in int x);
>>>> void foo(out int y);
>>>> void foo(inout int z);
>>>>
>>>> Can't force the use of one of those, either.
>>>
>>>
>>> But why is that *not* a problem with the language?
>>
>>
>> A good question. I think the answer is that one would be want to
>> overload based on in/out/inout only to write obfuscated code.
>
> but the lazy vs. non-lazy question isn't so simple
>
>
> log(RunSQLStuff());
>
> vs.
>
> log("This is a string");
>
>
> ???
More information about the Digitalmars-d-announce
mailing list