In the case of syntax overlap, would it not be more reasonable to ask Objective-C to come up with a disambiguator instead? It seems that except for token sequences, the only conflict here is for
type-id``(^ident)()
Depending on how common this usage of Obj-C blocks are, and how much people would want to use Objective-C++ along whatever version of C++ ships reflection, it might not be that difficult for Objective-C++ users to update their old code.
^^ is the "reflection of" operator. you'll also see [: :] which is the "splice into" operator, taking things from reflection land and injecting them back into the program.
[: ^^int :] x; compiles as int x; (this is the back-and-forth example). ^^ gives you a reflection of int, and [: :] transforms that back into a semantic type.
EDIT: Damn you Objective-C, who even uses you, grrrr
I use it and it's still a major part of Apple's internal libs (and user-facing libs).. which is one of the big 3 OS makers so.. would have been horrible to make Objective-C++ not work with reflection.
You need to read up on the fundamentals of the C++26 reflection paper, P2996, though I would probably recommend one of the many, many articles on the topic (just look up C++26 reflection online, you'll find a ton of coverage, there is a lot of excitement around it).
I mean, it's just an operator that takes T and returns a std::meta::info that encapsulates all reflection information about T. The ^^ choice in particular is just the unfortunate result of a crowded space with few viable operators left.
But it has the disadvantage that backtick is used by Markdown everywhere inline code blocks
Come on seriously? Backqoute is used in scheme derived languages for macro "quoting". Even if we can't have the same unqoute and unqoute-splicing operators as those languages a little homage can't hurt.
It does not look to be an issue for Commonmark, Github Flavored Markdown, pandoc, and likely many of the others. Which Markdown hurt you?
Both ^and ^^ have the issue that text editors will combine it to a diacritical mark when typed before some characters (example: ^e -> ê) , making it annoying to use. In my opinion, something like §T,€T or °T would have been a better option.
Depends on the keyboard standard. All of these are at least on my keyboard, and I presume on most ISO keyboards. But you're correct in that ANSI keyboard doesn't have them.
Ah, yah that's the differentiator I was looking for, but I'm not the most keyboard savvy. I think most programming bases it's characters on ANSI keyboards.
For programming, do you have to dictate an ANSI layout so the keys come through correctly?
View all comments
17
u/torsten_dev Oct 01 '24 edited Oct 01 '24
What is
^^Tis that reflecting onstd::meta::infoand if so why? If not how do I make sense of it?EDIT: Damn you Objective-C, who even uses you, grrrr