On Wed, Apr 17, 2013 at 7:29 AM, Greg London <[email protected]> wrote:
>> You can write macros that have varargs,
>
> Dumb hardware engineer question:
>
> Why use macros when you can write a function?

Lisp weenie answer: because the arguments to functions may produce
side effects, while with macros you can control that.  Of course the
Lisp answer is inapplicable in other languages because their macros
are less reliable.

C/C++ answer: because with a macro you can choose whether to try to
call functions that might or might not exist on your platform, and
would make the compiler miserable if it saw it.

_______________________________________________
Boston-pm mailing list
[email protected]
http://mail.pm.org/mailman/listinfo/boston-pm

Reply via email to