Thread overview | |||||||
---|---|---|---|---|---|---|---|
|
April 11, 2008 Fully qualified class name at compile-time | ||||
---|---|---|---|---|
| ||||
Hello, I'd like to get the fully qualified name of a class for some CTFE: `MyClass.classinfo.name` returns the expected result, but is not evaluated at compiletime. I already thought about demangle(MyClass.mangleof) but this seems to be bad coding style and I also didn't find a demangle-function in Tango yet. best regards Matthias Walter |
April 11, 2008 Re: Fully qualified class name at compile-time | ||||
---|---|---|---|---|
| ||||
Posted in reply to Matthias Walter | "Matthias Walter" <walter@mail.math.uni-magdeburg.de> wrote in message news:ftn3gh$urd$1@digitalmars.com... > Hello, > > I'd like to get the fully qualified name of a class for some CTFE: > > `MyClass.classinfo.name` > > returns the expected result, but is not evaluated at compiletime. > > I already thought about demangle(MyClass.mangleof) but this seems to be bad coding style and I also didn't find a demangle-function in Tango yet. Sadly that's about the best you can do. See: http://www.dsource.org/projects/ddl/browser/trunk/meta/demangle.d For an implementation that will demangle stuff at compile-time and allow you to get FQNs. |
April 11, 2008 Re: Fully qualified class name at compile-time | ||||
---|---|---|---|---|
| ||||
Posted in reply to Matthias Walter | Matthias Walter wrote: > Hello, > > I'd like to get the fully qualified name of a class for some CTFE: > > `MyClass.classinfo.name` > > returns the expected result, but is not evaluated at compiletime. > > I already thought about demangle(MyClass.mangleof) but this seems > to be bad coding style and I also didn't find a demangle-function > in Tango yet. > > best regards > Matthias Walter take a look at ".stringof", I /think/ it can be used for this. |
April 11, 2008 Re: Fully qualified class name at compile-time | ||||
---|---|---|---|---|
| ||||
Posted in reply to BCS | BCS Wrote:
> Matthias Walter wrote:
> > Hello,
> >
> > I'd like to get the fully qualified name of a class for some CTFE:
> >
> > `MyClass.classinfo.name`
> >
> > returns the expected result, but is not evaluated at compiletime.
> >
> > I already thought about demangle(MyClass.mangleof) but this seems
> > to be bad coding style and I also didn't find a demangle-function
> > in Tango yet.
> >
> > best regards
> > Matthias Walter
>
> take a look at ".stringof", I /think/ it can be used for this.
".stringof" doesn't return the fully qualified name.
|
April 11, 2008 Re: Fully qualified class name at compile-time | ||||
---|---|---|---|---|
| ||||
Posted in reply to Leonard Dahlmann | Leonard Dahlmann wrote:
> BCS Wrote:
>
>>take a look at ".stringof", I /think/ it can be used for this.
>
>
> ".stringof" doesn't return the fully qualified name.
Well than I think i was wrong. Crud.
|
Copyright © 1999-2021 by the D Language Foundation