The problem of abusing the predicate by performing anything other than
logging inside it.
You cannot get rid of the predicate without introducing side effects as
I've demonstrated throughout this thread.
On Apr 4, 2012 6:01 AM, "Marco Schulze" <marco.c.schulze at gmail.com> wrote:
> Which problem is solved? There's still a predicate there.
>
> On 03-04-2012 20:49, Zlatin Balevsky wrote:
>
>> May I suggest a nice little script someone ( novice? ) could write,
>> solve the logging problem and learning a thing or two about language
>> theory in the process :
>>
>> Transform:
>> ====
>> if (LOG.isLoggable(Level.DEBUG)) {
>> <some complex computation that wouldn't happen otherwise>
>> <log results of complex computation, maybe other stuff too>
>> }
>> ====
>> Into
>> ====
>> private static void logComplexComputation( .. arguments! .. ) {
>> < do the stuff above>
>> }
>>
>> if (LOG.isLoggable(Level.DEBUG)) {
>> logComplexComputation( .. arguments ..);
>> }
>> ====
>>
>> This gets run as pre-commit hook and the problem is solved with
>> positive run-time side effects.
>>
>>
>> On Sun, Mar 25, 2012 at 6:22 PM, Marco Schulze
>> <marco.c.schulze at gmail.com> wrote:
>>
>>> Working (but incomplete) code is available @
>>> https://github.com/Heiral/**fred-staging/tree/logger++<https://github.com/Heiral/fred-staging/tree/logger++>
>>> ______________________________**_________________
>>> Devl mailing list
>>> Devl at freenetproject.org
>>> https://emu.freenetproject.**org/cgi-bin/mailman/listinfo/**devl<https://emu.freenetproject.org/cgi-bin/mailman/listinfo/devl>
>>>
>> ______________________________**_________________
>> Devl mailing list
>> Devl at freenetproject.org
>> https://emu.freenetproject.**org/cgi-bin/mailman/listinfo/**devl<https://emu.freenetproject.org/cgi-bin/mailman/listinfo/devl>
>>
> ______________________________**_________________
> Devl mailing list
> Devl at freenetproject.org
> https://emu.freenetproject.**org/cgi-bin/mailman/listinfo/**devl<https://emu.freenetproject.org/cgi-bin/mailman/listinfo/devl>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
<https://emu.freenetproject.org/pipermail/devl/attachments/20120404/b43b43df/attachment.html>