inverse of std.demangle?

Timothee Cour thelastmammoth at gmail.com
Wed Jul 10 12:03:09 PDT 2013


On Wed, Jul 10, 2013 at 11:39 AM, Adam D. Ruppe
<destructionator at gmail.com>wrote:

> On Wednesday, 10 July 2013 at 17:44:51 UTC, Timothee Cour wrote:
>
>> * One use case is using it in shared libraries:
>> user asks for a symbol via its demangled string representation (which is
>> most natural for user), then the string is mangled, and then calls dlsym to
>> retrieve the actual pointer to symbol in the shared lib.
>>
>
> I think in this case, it would be better to use .mangleof anyway because
> you'll want that type safety. You could still compare a user inputted
> string to typeof(S).stringof if you want to choose one at runtime.
>

How would that work, since this is runtime only? I'm interested in the case
where I don't have access to said symbol, all I have is a string
representation of it. For example when using dlopen on a library where we
don't have source code; so in this case typeof(S) doesn't make sense.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puremagic.com/pipermail/digitalmars-d-learn/attachments/20130710/5064d40a/attachment.html>


More information about the Digitalmars-d-learn mailing list