[Harbour] -z switch seems to be overly anti-lazy
Przemysław Czerpak
druzus at acn.waw.pl
Wed Feb 3 04:10:52 EST 2010
On Tue, 02 Feb 2010, smu johnson wrote:
Hi,
> I have the test which has been proven with our Clipper 5.2e running on DOS
> of a difference in Harbour.... below is an explanation I received by e-mail:
> ====== start here
> If eval({||devout("hello"),.f.)}) .or. .t.
> endif
> In Clipper the eval() will process (even though it appears redundant because
> .t. will make the IF statement always return .t.
> Harbour does not process the eval()
The above is not true.
Both Clipper (5.2 and 5.3) and Harbour execute above code in exactly
the same way:
iF -z compile time switch is used then "hello" is printed otherwise not.
Please compile your example with Clipper and check results.
> Unfortunately, my code could be scattered with situations where I have used
> the Clipper behaviour to do something intentional (as in my search routine).
> I will need to look for other places (or more likely wait for things to
> break) and change the logic to get around this unless Harbour is interested
> in making this fully compatible.
If you need help then you have to show us the difference.
Otherwise we do not know what is the problem.
> ======
> Any thoughts? Is it because the guy who showed me this line of code relied
> too much on Clipper bugs when programming?
Without real code example I cannot help you.
Maybe you are not talking about normal code but about macrocompiler?
Clipper does not have compile time optimizations in macrocompiler so
it may give different results for the same code compiled directly and
by macrocompiler. This is self contain exmaple which illustrates the
difference:
? eval({||qout("hello"),.f.}) .or. .t.
? &('eval({||qout("WORLD"),.f.}) .or. .t.')
If you show me the _exact_ code which creates problems for you then
I can try to help you to resolve it or find workaround but I have to
know what it is.
best regards,
Przemek
More information about the Harbour
mailing list