Mail Archives: djgpp/1999/02/28/13:33:33
At 07:24 PM 2/28/99 +0200, you wrote:
>
>On Sun, 28 Feb 1999, Paul Derbyshire wrote:
>
>> const long double pi = 4*atan(1);
>
>It won't work in C, and calling a function instead of using a manifest
>constant seems like a waste.
>
>> Can Nate make this work without side effect problems?
>>
>> #define MAX(a,b) (((a) > (b)) ? (a) : (b))
>
>Ah, but Nate's macro wasn't like this: it only used the arguments once.
I am quite aware of that. :-)
Macros can have problems, subtle ones that might not show up until
run-time. Template problems, if subtle in the source code, become glaringly
obvious in the 400 lines of scary error messages from "cc1plus" followed by
"confused by earlier errors, bailing out". :-)
--
.*. "Clouds are not spheres, mountains are not cones, coastlines are not
-() < circles, and bark is not smooth, nor does lightning travel in a
`*' straight line." -------------------------------------------------
-- B. Mandelbrot |http://surf.to/pgd.net
_____________________ ____|________ Paul Derbyshire pderbysh AT usa DOT net
Programmer & Humanist|ICQ: 10423848|
- Raw text -