Skip to content

Conversation

@OverlordZorn
Copy link
Contributor

@OverlordZorn OverlordZorn commented May 12, 2025

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.

@DartRuffian
Copy link
Contributor

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

@rautamiekka
Copy link
Contributor

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.

@jonpas
Copy link
Member

jonpas commented Jul 27, 2025

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.

@OverlordZorn
Copy link
Contributor Author

OverlordZorn commented Jul 27, 2025

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

@jonpas
Copy link
Member

jonpas commented Jul 27, 2025

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.

@jokoho48
Copy link
Member

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.

@DartRuffian
Copy link
Contributor

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

@jokoho48
Copy link
Member

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

@DartRuffian
Copy link
Contributor

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants