-
Notifications
You must be signed in to change notification settings - Fork 7
Closed
Labels
Description
One common use case for the C preprocessor is conditional compilation using #ifdef
/#else
/#endif
. Those can already be done in perlpp with <? if(...) { ?> <? } ?>
. Similarly, #define
/#undef
can already be done with variable assignments. However, I think syntactic sugar for those functions, together with a -D
command-line option, would make it easier for people to transition from cpp to perlpp.
I have an example implementation in branch defines of my fork. It fills %Defs
for use at generation time and %D
for use at execution time. Any thoughts on this approach? An alternative would be to merge %D
and %S
(-s name=val
options). I'll leave this issue open for a bit in case anyone has any ideas or concerns.