Do you plan for conditional code in macros?

+1 vote
asked Feb 19, 2019 in Question / help by anonymous

Is it possible to define parts of the macro conditionally? If not, is there any workaround for this? In the example below the macro is generating different output, which is controlled by parameter c.

@startuml

!define LAYER1 1
!define LAYER2 2

!definelong TEST_MACRO(a, b, c)
if c
a->b: defined c
endif
!enddefinelong

TEST_MACRO(a, b, LAYER1)
TEST_MACRO(c, d, LAYER1 | LAYER2)
TEST_MACRO(a, b, LAYER3)

@enduml

1 Answer

0 votes
answered Mar 11, 2019 by mgrol (3,150 points)

Please see the discussion here:

http://wiki.plantuml.net/site/plantumlshell

Feel free to join the discussion.

commented Mar 11, 2019 by anonymous
Yes, this functionality described on wiki is everything what I need. When do you plan to release it?
commented Mar 12, 2019 by mgrol (3,150 points)
There is no time frame discussed when to implement it. The first step is to discuss it thoroughly, afterwards it can be planned and implemented. So most likely not in the next release(s).
commented Mar 17, 2019 by plantuml (295,000 points)
No time frame indeed. However, we have begun to implement some stuff.
It's only a beginning, more details on http://wiki.plantuml.net/site/plantumlshell
...