digitalmars.D - Help with demangling
- g (3/3) Jan 10 2010 Hi
- g (5/8) Jan 10 2010 let's repeat : "Google is your friend!"
- Trass3r (1/1) Jan 11 2010 What about std.demangle?
- g (2/3) Jan 11 2010 doesn't work in ctfe
- grauzone (5/8) Jan 11 2010 If you have to use such dirty tricks, you probably should consider to
- Brad Roberts (10/20) Jan 11 2010 And how do bugs get fixed? Step one is finding them.. which typically i...
Hi Is there a way to demangle .mangleof strings at CTFE or at least know the fully qualified name of a class or template instance.
Jan 10 2010
g Wrote:Hi Is there a way to demangle .mangleof strings at CTFE or at least know the fully qualified name of a class or template instance.let's repeat : "Google is your friend!" http://www.dsource.org/projects/ddl/browser/trunk/meta/demangle.d but is severely outdated (dmd 0.166! btw im using dmd 2.039) so it will fail with invariant,shared,__gshared,inout(the new),etc. Is that the only alternative?
Jan 10 2010
g wrote:Hi Is there a way to demangle .mangleof strings at CTFE or at least know the fully qualified name of a class or template instance.If you have to use such dirty tricks, you probably should consider to turn back NOW for your own good. D always lures you into doing tricky template and CTFE stuff, and then you end up either in compiler bugs or other dead ends.
Jan 11 2010
On 1/11/2010 11:20 PM, grauzone wrote:g wrote:And how do bugs get fixed? Step one is finding them.. which typically involves writing code that uses the features. Secondarily, a good number of bugs have been fixed over the last couple months, so re-exploring the area might well bear good fruit. Anyway, doom and gloom pronouncements like this aren't particularly helpful. That said, demangling a symbol and using that inside compile time expressions does sound like one good definition of hell, regardless of how well it works. Later, BradHi Is there a way to demangle .mangleof strings at CTFE or at least know the fully qualified name of a class or template instance.If you have to use such dirty tricks, you probably should consider to turn back NOW for your own good. D always lures you into doing tricky template and CTFE stuff, and then you end up either in compiler bugs or other dead ends.
Jan 11 2010
Brad Roberts wrote:On 1/11/2010 11:20 PM, grauzone wrote:Some types of bugs just never seem to disappear: when one specific bug got fixed, a regression occurs and you have a similar bug. (This happened with forward references in the current dmd release.) Nothing wrong with a warning.g wrote:And how do bugs get fixed? Step one is finding them.. which typically involves writing code that uses the features. Secondarily, a good number of bugs have been fixed over the last couple months, so re-exploring the area might well bear good fruit. Anyway, doom and gloom pronouncements like this aren't particularly helpful.Hi Is there a way to demangle .mangleof strings at CTFE or at least know the fully qualified name of a class or template instance.If you have to use such dirty tricks, you probably should consider to turn back NOW for your own good. D always lures you into doing tricky template and CTFE stuff, and then you end up either in compiler bugs or other dead ends.That said, demangling a symbol and using that inside compile time expressions does sound like one good definition of hell, regardless of how well it works.Exactly. The thing is just (and that I wanted to say in my previous post): you get easily fascinated by the possibilities, but then either the language or dmd hit an unexpected barrier and fail. Then you start hacks by throwing heaps of CTFE and mixins on the problem, or stuff like parsing .mangleof. I believe choosing a simpler solution instead (although it's boring in terms of hacking) is better.Later, Brad
Jan 11 2010
grauzone Wrote:Brad Roberts wrote:well, but is there a way to get by other means the fully qualified name of a class for use to a mixin (is a project for automatic generation of lua bindings)On 1/11/2010 11:20 PM, grauzone wrote:Some types of bugs just never seem to disappear: when one specific bug got fixed, a regression occurs and you have a similar bug. (This happened with forward references in the current dmd release.) Nothing wrong with a warning.g wrote:And how do bugs get fixed? Step one is finding them.. which typically involves writing code that uses the features. Secondarily, a good number of bugs have been fixed over the last couple months, so re-exploring the area might well bear good fruit. Anyway, doom and gloom pronouncements like this aren't particularly helpful.Hi Is there a way to demangle .mangleof strings at CTFE or at least know the fully qualified name of a class or template instance.If you have to use such dirty tricks, you probably should consider to turn back NOW for your own good. D always lures you into doing tricky template and CTFE stuff, and then you end up either in compiler bugs or other dead ends.That said, demangling a symbol and using that inside compile time expressions does sound like one good definition of hell, regardless of how well it works.Exactly. The thing is just (and that I wanted to say in my previous post): you get easily fascinated by the possibilities, but then either the language or dmd hit an unexpected barrier and fail. Then you start hacks by throwing heaps of CTFE and mixins on the problem, or stuff like parsing .mangleof. I believe choosing a simpler solution instead (although it's boring in terms of hacking) is better.Later, Brad
Jan 12 2010