CBA_A3 icon indicating copy to clipboard operation
CBA_A3 copied to clipboard

Main - New Macros: Q, QQ

Open OverlordZorn opened this issue 11 months ago • 9 comments

Introduces a shortend version of QUOTE()

#define Q(var1) QUOTE(var1)
#define QQ(var1) QUOTE(QUOTE(var1))

happy to add more when suggested

Why

1. Less convoluted and easier to read

Q(configName _x isEqualTo QQ(abe_banana)) configClasses (configFile >> QADDON) vs QUOTE(configName _x isEqualTo QUOTE(QUOTE(abe_banana))) configClasses (configFile >> QADDON)

2. Q as a prefix already widely used and known.

The Q is already in use as a prefix for many of the most used MACRO's like QGVAR QFUNC QPATHTOF but it does not exist as a standalone.

OverlordZorn avatar May 12 '25 14:05 OverlordZorn

Why, just use QUOTE I don't see why you'd need aliases for these

DartRuffian avatar Jul 26 '25 18:07 DartRuffian

Why, just use QUOTE I don't see why you'd need aliases for these

Like he said, they're shortened. I'd personally be happier with these shortened ones, since [I don't think] there's nothing else even remotely similarly named.

rautamiekka avatar Jul 26 '25 22:07 rautamiekka

I am not a fan of this, single-letter macros are too obscuring and too easy to define in your own projects if you really want them. I think they do not fit CBA.

jonpas avatar Jul 27 '25 11:07 jonpas

I am not a fan of this, single-letter macros are too obscuring and too easy to define in your own projects if you really want them. I think they do not fit CBA.

I'd like to argue that Q is already commonly known as its being used as a prefix: GVAR - QGVAR, FUNC - QFUNC, ... If people know what QGVAR means, i doubt its hard to undstand what Q stands for as a standalone

OverlordZorn avatar Jul 27 '25 11:07 OverlordZorn

Understanding is not the problem, single letter macro is. It is shortened in others for the purpose of not being so long, but Q and QQ is just crossing the line.

jonpas avatar Jul 27 '25 11:07 jonpas

I don't like this either. Single-letter macros don't read nicely, so I am 100% with Jonpas here. However, what I see is that the QUOTE(QUOTE(var1)) macro situation could be improved, and we should introduce a QQUOTE(var) macro.

jokoho48 avatar Jul 27 '25 11:07 jokoho48

QQUOTE makes sense, ACE and many other mods (or at least my mods) define it. Adding it in CBA would make sense

DartRuffian avatar Jul 30 '25 21:07 DartRuffian

QQUOTE makes sense, ACE and many other mods (or at least my mods) define it. Adding it in CBA would make sense

We actually had the discussion and it seems like your template has the QQUOTE but not ace nor any of the other bigger mods

jokoho48 avatar Jul 31 '25 09:07 jokoho48

Ah right I mispoke, QQUOTE itself isn't defined but there is stuff like QQGVAR in ace

DartRuffian avatar Jul 31 '25 12:07 DartRuffian