Programming: switch macro => function