this is a nice find.
I even wasn't aware, that your working example is possible.
Where is your knowledge abut this syntax from?
If it is a LibreCAD site, we should possibly clarify this.
This functionality in LibreCAD is provided by the muparser library.
Because there was no update of muparser and no changes on the muparser implementation, I must assume, that this advanced using of the command line was never used before.
From my tests, I assume the problem is not muparser, but its implementation in LibreCAD.
I think the implementation is missing a recursive parsing of tokens.
Now the variable d becomes a simple string "\c+\c" which leads to the syntax error in expansion of \d.
So I see no workaround for this issue now. It needs a revamp of the muparser implementation.
thanks for your answer. I found the informations about command lines using variables on that webpage : https://librecad.readthedocs.io/en/latest/guides/cmdline.html It is written that "Multi-command input can be assigned to a variable and variables can also contain other variables (they are read recursively)" but it seems it doesn't work with calculs. Fortunately you suggest the spreadsheet alternative which will be very helpful to use variables and calculs with the command line.
Thanks you very muche,
have a nice day,